Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix binary nokogiri gems on musl based Linux #1990

Closed
wants to merge 2 commits into from

Commits on Feb 7, 2020

  1. Fix binary compat with musl based Linux

    The binary nokogiri gem built with rake-compiler-dock-1.0.0 segfaults on x86_64-linux-musl.
    This happens in:
      lib/nokogiri/xml/reader.rb:92:in `namespaces'
    It turned out that any calls to sprintf() with %-arguments fail.
    
    I did not dig deeper on assembly level, since this is the only use of sprintf in nokogiri.
    Moreover it can be replaced by calls to ruby string functions easily.
    
    Related to sparklemotion#1983
    larskanis committed Feb 7, 2020
    Configuration menu
    Copy the full SHA
    659c923 View commit details
    Browse the repository at this point in the history
  2. Fix failing test case on musl based Linux

    Musl doesn't recognize cp932 encoding.
    It also fails when used on the command line with iconv.
    For this test case cp932 can be replaced by Shift_JIS, which is identical for the characters in question and that is handled by musl.
    
    Error was:
    
      1) Error:
    Nokogiri::HTML::TestDocumentEncoding#test_encoding_without_charset:
    ArgumentError: invalid byte sequence in UTF-8
        /home/lars/comcard/nokogiri/test/html/test_document_encoding.rb:26:in `test_encoding_without_charset'
    
    Related to sparklemotion#1983
    larskanis committed Feb 7, 2020
    Configuration menu
    Copy the full SHA
    61dadef View commit details
    Browse the repository at this point in the history