[ruby-dev:50093] [Ruby trunk Bug#13489] "make test-all" fails on macOS with case-sensitive filesystem

From: watson1978@...
Date: 2017-04-21 03:20:44 UTC
List: ruby-dev #50093
Issue #13489 has been updated by watson1978 (Shizuo Fujita).


以下の変更をテストに加え `#include <Ruby/ruby.h>` を生成することで、`conftest.c` のコンパイルエラーは解消しました。

```diff
diff --git a/test/mkmf/test_framework.rb b/test/mkmf/test_framework.rb
index ae05b0cffc..9959437f6f 100644
--- a/test/mkmf/test_framework.rb
+++ b/test/mkmf/test_framework.rb
@@ -22,11 +22,11 @@ def create_framework(fw, hdrname = "#{fw}.h")
     end
 
     def test_single_framework
-      assert(have_framework("Ruby"), mkmflog("try as Objective-C"))
+      assert(have_framework(["Ruby", "ruby.h"]), mkmflog("try as Objective-C"))
     end
 
     def test_multi_frameworks
-      assert(have_framework("Ruby"), mkmflog("try as Objective-C"))
+      assert(have_framework(["Ruby", "ruby.h"]), mkmflog("try as Objective-C"))
       create_framework("MkmfTest") do |fw|
         assert(have_framework(fw), MKMFLOG)
       end
```

テスト結果は以下のようになりました。case sensitive ではない Filesystem を利用している macOS では、
上記の変更を加えてもエラーは無かったので、まだ何か問題があるようです。

```
$ make test-all -j 8

... snip ...

# Running tests:


Retrying...
[ 16/117] TestFileExhaustive#test_expand_path = 0.00 s
  1) Failure:
TestFileExhaustive#test_expand_path [/Users/watson/src/ruby/test/ruby/test_file_exhaustive.rb:750]:
"\uFEFF".
<"/var/folders/fs/gltv6wcd3m70hcgqcp2njt_80000gn/T/rubytest-file20170421-96294-zcv8tx/file.test"> expected but was
<"/var/folders/fs/gltv6wcd3m70hcgqcp2njt_80000gn/T/rubytest-file20170421-96294-zcv8tx/file.test">.

Finished tests in 222.421277s, 75.9415 tests/s, 9876.3168 assertions/s.
16891 tests, 2196703 assertions, 1 failures, 0 errors, 80 skips

ruby -v: ruby 2.5.0dev (2017-04-20 trunk 58401) [x86_64-darwin16]
make: *** [yes-test-all] Error 1
```

----------------------------------------
Bug #13489: "make test-all" fails on macOS with case-sensitive filesystem
https://bugs.ruby-lang.org/issues/13489#change-64413

* Author: watson1978 (Shizuo Fujita)
* Status: Feedback
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 
* Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
普段使用している macOS は HFS+ case-sensitive でフォーマットしています。
"make test-all" をそのマシン上で実行すると以下のようなエラーが発生し、
どうやら conftest.c でのコンパイルエラーが原因のようです。

conftest.c には

~~~
#include <Ruby/Ruby.h>
~~~

 という行が生成されるらしいのですが、
case-sensitive なファイルシステムではそのファイルパスを見つけることができません。

~~~
#include <ruby/ruby.h>
~~~
と生成されるべきかと思います。

https://github.com/ruby/ruby/blob/3e92b635fb5422207b7bbdc924e292e51e21f040/test/mkmf/test_framework.rb#L24-L33
の have_framework("Ruby") でinclude文が生成されているのかと思われます。


### エラーログ

~~~
$ make test-all -j 8

... snip ...

# Running tests:


Retrying...
[  3/121] TestMkmf::TestHaveFramework#test_multi_frameworks = 0.10 s
  1) Failure:
TestMkmf::TestHaveFramework#test_multi_frameworks [/Users/watson/src/ruby/test/mkmf/test_framework.rb:29]:
have_framework: checking for Ruby... -------------------- no

"clang -o conftest -I. -I/Users/watson/src/ruby/.ext/include/x86_64-darwin16 -I/Users/watson/src/ruby/include -I./test  -I/usr/local/opt/openssl/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens  -pipe conftest.c  -L. -L/Users/watson/src/ruby -L/usr/local/opt/openssl/lib -L. -fstack-protector -L/usr/local/lib -L/usr/local/opt/openssl/lib     -lruby.2.5.0-static -framework CoreFoundation  -framework Ruby -lpthread -lgmp -ldl -lobjc "
conftest.c:3:10: fatal error: 'Ruby/Ruby.h' file not found
#include <Ruby/Ruby.h>
         ^
1 error generated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <Ruby/Ruby.h>
4:
5: int main(void){return 0;}
/* end */

"clang -o conftest -I. -I/Users/watson/src/ruby/.ext/include/x86_64-darwin16 -I/Users/watson/src/ruby/include -I./test  -I/usr/local/opt/openssl/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens  -pipe conftest.c  -L. -L/Users/watson/src/ruby -L/usr/local/opt/openssl/lib -L. -fstack-protector -L/usr/local/lib -L/usr/local/opt/openssl/lib     -lruby.2.5.0-static -framework CoreFoundation -ObjC -framework Ruby -lpthread -lgmp -ldl -lobjc "
conftest.c:3:10: fatal error: 'Ruby/Ruby.h' file not found
#include <Ruby/Ruby.h>
         ^
1 error generated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <Ruby/Ruby.h>
4:
5: int main(void){return 0;}
/* end */

--------------------

try as Objective-C

[  4/121] TestMkmf::TestHaveFramework#test_single_framework = 0.10 s
  2) Failure:
TestMkmf::TestHaveFramework#test_single_framework [/Users/watson/src/ruby/test/mkmf/test_framework.rb:25]:
have_framework: checking for Ruby... -------------------- no

"clang -o conftest -I. -I/Users/watson/src/ruby/.ext/include/x86_64-darwin16 -I/Users/watson/src/ruby/include -I./test  -I/usr/local/opt/openssl/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens  -pipe conftest.c  -L. -L/Users/watson/src/ruby -L/usr/local/opt/openssl/lib -L. -fstack-protector -L/usr/local/lib -L/usr/local/opt/openssl/lib     -lruby.2.5.0-static -framework CoreFoundation  -framework Ruby -lpthread -lgmp -ldl -lobjc "
conftest.c:3:10: fatal error: 'Ruby/Ruby.h' file not found
#include <Ruby/Ruby.h>
         ^
1 error generated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <Ruby/Ruby.h>
4:
5: int main(void){return 0;}
/* end */

"clang -o conftest -I. -I/Users/watson/src/ruby/.ext/include/x86_64-darwin16 -I/Users/watson/src/ruby/include -I./test  -I/usr/local/opt/openssl/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens  -pipe conftest.c  -L. -L/Users/watson/src/ruby -L/usr/local/opt/openssl/lib -L. -fstack-protector -L/usr/local/lib -L/usr/local/opt/openssl/lib     -lruby.2.5.0-static -framework CoreFoundation -ObjC -framework Ruby -lpthread -lgmp -ldl -lobjc "
conftest.c:3:10: fatal error: 'Ruby/Ruby.h' file not found
#include <Ruby/Ruby.h>
         ^
1 error generated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <Ruby/Ruby.h>
4:
5: int main(void){return 0;}
/* end */

--------------------

try as Objective-C

[ 20/121] TestFileExhaustive#test_expand_path = 0.00 s
  3) Failure:
TestFileExhaustive#test_expand_path [/Users/watson/src/ruby/test/ruby/test_file_exhaustive.rb:750]:
"\uFEFF".
<"/var/folders/fs/gltv6wcd3m70hcgqcp2njt_80000gn/T/rubytest-file20170420-79876-gvlo69/file.test"> expected but was
<"/var/folders/fs/gltv6wcd3m70hcgqcp2njt_80000gn/T/rubytest-file20170420-79876-gvlo69/file.test">.

Finished tests in 223.305106s, 75.8290 tests/s, 9835.1132 assertions/s.
16933 tests, 2196231 assertions, 3 failures, 0 errors, 80 skips

ruby -v: ruby 2.5.0dev (2017-04-20 trunk 58401) [x86_64-darwin16]
make: *** [yes-test-all] Error 3
[trunk][~/src/ruby]$                                                                                                           rbenv:2.4.1
~~~




-- 
https://bugs.ruby-lang.org/

In This Thread

Prev Next