ruby-changes:59794
From: =E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3 <ko1@a...>
Date: Fri, 24 Jan 2020 10:50:58 +0900 (JST)
Subject: [ruby-changes:59794] 50925b6409 (master): reroute musl unistd.h weirdness
https://git.ruby-lang.org/ruby.git/commit/?id=50925b6409 From 50925b64099df2021f7cdf652f7e807808cb1482 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?= <shyouhei@r...> Date: Thu, 23 Jan 2020 12:14:19 +0900 Subject: reroute musl unistd.h weirdness Musl is (of course) not glibc. Its confstr(3) does not understand _CS_GNU_LIBC_VERSION. That's fair. Problem is, its unistd.h has that constant defined for unknown reason. We cannot blindly say the libc is glibc by looking at it. Instead we have to kick it, then see if it quacks like a duck. See https://git.musl-libc.org/cgit/musl/tree/include/unistd.h diff --git a/test/ruby/test_m17n_comb.rb b/test/ruby/test_m17n_comb.rb index cfb8bff..4914179 100644 --- a/test/ruby/test_m17n_comb.rb +++ b/test/ruby/test_m17n_comb.rb @@ -751,8 +751,14 @@ class TestM17NComb < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_m17n_comb.rb#L751 # glibc 2.16 or later denies salt contained other than [0-9A-Za-z./] #7312 # we use this check to test strict and non-strict behavior separately #11045 strict_crypt = if defined? Etc::CS_GNU_LIBC_VERSION - glibcver = Etc.confstr(Etc::CS_GNU_LIBC_VERSION).scan(/\d+/).map(&:to_i) - (glibcver <=> [2, 16]) >= 0 + begin + confstr = Etc.confstr(Etc::CS_GNU_LIBC_VERSION) + rescue Errno::EINVAL + false + else + glibcver = confstr.scan(/\d+/).map(&:to_i) + (glibcver <=> [2, 16]) >= 0 + end end def test_str_crypt -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/