ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:109201] [Ruby master Bug#18912] Build failure with macOS 13 (Ventura) Beta
@ 2022-07-14  5:40 hsbt (Hiroshi SHIBATA)
  2022-07-19 15:44 ` [ruby-core:109248] " alanwu (Alan Wu)
                   ` (18 more replies)
  0 siblings, 19 replies; 20+ messages in thread
From: hsbt (Hiroshi SHIBATA) @ 2022-07-14  5:40 UTC (permalink / raw)
  To: ruby-core

Issue #18912 has been reported by hsbt (Hiroshi SHIBATA).

----------------------------------------
Bug #18912: Build failure with macOS 13 (Ventura) Beta
https://bugs.ruby-lang.org/issues/18912

* Author: hsbt (Hiroshi SHIBATA)
* Status: Open
* Priority: Normal
* Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN
----------------------------------------
Today, I tried to build ruby master with macOS 13 (Ventura) Beta. It breaks the build status caused by Xcode 14 beta changes.

TL;DR: We should add `--without=+,bigdecimal --enable-shared` to the `configure` option.

1. Build failed without `--enable-shared`.

I build ruby master without `--enable-shared` option. I got the following error.

```
(snip)
linking shared-object -test-/arith_seq/extract.bundle
Undefined symbols for architecture arm64:
  "_rb_arithmetic_sequence_extract", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_ary_new_capa", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_ary_store", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_define_singleton_method", referenced from:
      _Init_extract in extract.o
  "_rb_path2class", referenced from:
      _Init_extract in extract.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

@katei says this error affects with `-undefined dynamic_lookup` flags.

2. Build error with bigdecimal

With `--enabled-shared` resolved the first error. But I got the another build failure.

```
compiling bigdecimal.c
In file included from bigdecimal.c:13:
In file included from ./bigdecimal.h:14:
./missing.h:127:1: error: static declaration of 'rb_rational_num' follows non-static declaration
rb_rational_num(VALUE rat)
^
../.././include/ruby/internal/intern/rational.h:128:7: note: previous declaration is here
VALUE rb_rational_num(VALUE rat);
      ^
In file included from bigdecimal.c:13:
In file included from ./bigdecimal.h:14:
(snip)
```

It's affected with `static inline` declaration in missing.h of bigdecimal.

3. test failure with mjit

I could build with `--with-out-ext=+,bigdecimal --enable-share` option. But I also got the test failure with mjit.

```
[215/402] TestMJIT#test_lambda_longjmp = 0.19 s
192) Failure:
TestMJIT#test_lambda_longjmp [/Users/hsbt/Documents/github.com/ruby/ruby/test/ruby/test_mjit.rb:1045]:
Expected 1 times of JIT success, but succeeded 0 times.

script:
"""

fib = lambda do |x|
  return x if x == 0 || x == 1
  fib.call(x-1) + fib.call(x-2)
end
print fib.call(5)

"""


stderr:
"""
Undefined symbols for architecture arm64:
  "_mjit_call_p", referenced from:
      __mjit0 in _ruby_mjit_p39885u0-643ab5.o
      _vm_sendish in _ruby_mjit_p39885u0-643ab5.o
```

I already shared this to @k0kubun .

macOS 13 beta is still development status. I will track this until the official release date.






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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [ruby-core:109248] [Ruby master Bug#18912] Build failure with macOS 13 (Ventura) Beta
  2022-07-14  5:40 [ruby-core:109201] [Ruby master Bug#18912] Build failure with macOS 13 (Ventura) Beta hsbt (Hiroshi SHIBATA)
@ 2022-07-19 15:44 ` alanwu (Alan Wu)
  2022-07-28  8:32 ` [ruby-core:109350] " hsbt (Hiroshi SHIBATA)
                   ` (17 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: alanwu (Alan Wu) @ 2022-07-19 15:44 UTC (permalink / raw)
  To: ruby-core

Issue #18912 has been updated by alanwu (Alan Wu).


Can you build with `bigdecimal` included and post
`cat ext/bigdecimal/mkmf.log` from the build directory?
I ran into similar errors when building on illumos and
it was due to `bigdecimal` not configuring properly.

----------------------------------------
Bug #18912: Build failure with macOS 13 (Ventura) Beta
https://bugs.ruby-lang.org/issues/18912#change-98382

* Author: hsbt (Hiroshi SHIBATA)
* Status: Open
* Priority: Normal
* Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN
----------------------------------------
Today, I tried to build ruby master with macOS 13 (Ventura) Beta. It breaks the build status caused by Xcode 14 beta changes.

TL;DR: We should add `--without=+,bigdecimal --enable-shared` to the `configure` option.

1. Build failed without `--enable-shared`.

I build ruby master without `--enable-shared` option. I got the following error.

```
(snip)
linking shared-object -test-/arith_seq/extract.bundle
Undefined symbols for architecture arm64:
  "_rb_arithmetic_sequence_extract", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_ary_new_capa", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_ary_store", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_define_singleton_method", referenced from:
      _Init_extract in extract.o
  "_rb_path2class", referenced from:
      _Init_extract in extract.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

@katei says this error affects with `-undefined dynamic_lookup` flags.

2. Build error with bigdecimal

With `--enabled-shared` resolved the first error. But I got the another build failure.

```
compiling bigdecimal.c
In file included from bigdecimal.c:13:
In file included from ./bigdecimal.h:14:
./missing.h:127:1: error: static declaration of 'rb_rational_num' follows non-static declaration
rb_rational_num(VALUE rat)
^
../.././include/ruby/internal/intern/rational.h:128:7: note: previous declaration is here
VALUE rb_rational_num(VALUE rat);
      ^
In file included from bigdecimal.c:13:
In file included from ./bigdecimal.h:14:
(snip)
```

It's affected with `static inline` declaration in missing.h of bigdecimal.

3. test failure with mjit

I could build with `--with-out-ext=+,bigdecimal --enable-share` option. But I also got the test failure with mjit.

```
[215/402] TestMJIT#test_lambda_longjmp = 0.19 s
192) Failure:
TestMJIT#test_lambda_longjmp [/Users/hsbt/Documents/github.com/ruby/ruby/test/ruby/test_mjit.rb:1045]:
Expected 1 times of JIT success, but succeeded 0 times.

script:
"""

fib = lambda do |x|
  return x if x == 0 || x == 1
  fib.call(x-1) + fib.call(x-2)
end
print fib.call(5)

"""


stderr:
"""
Undefined symbols for architecture arm64:
  "_mjit_call_p", referenced from:
      __mjit0 in _ruby_mjit_p39885u0-643ab5.o
      _vm_sendish in _ruby_mjit_p39885u0-643ab5.o
```

I already shared this to @k0kubun .

macOS 13 beta is still development status. I will track this until the official release date.






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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [ruby-core:109350] [Ruby master Bug#18912] Build failure with macOS 13 (Ventura) Beta
  2022-07-14  5:40 [ruby-core:109201] [Ruby master Bug#18912] Build failure with macOS 13 (Ventura) Beta hsbt (Hiroshi SHIBATA)
  2022-07-19 15:44 ` [ruby-core:109248] " alanwu (Alan Wu)
@ 2022-07-28  8:32 ` hsbt (Hiroshi SHIBATA)
  2022-07-28  9:04 ` [ruby-core:109351] " katei (Yuta Saito)
                   ` (16 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: hsbt (Hiroshi SHIBATA) @ 2022-07-28  8:32 UTC (permalink / raw)
  To: ruby-core

Issue #18912 has been updated by hsbt (Hiroshi SHIBATA).


@alanwu full log is here https://gist.github.com/hsbt/293250f86a2731b4f76ceea4d903bd64



----------------------------------------
Bug #18912: Build failure with macOS 13 (Ventura) Beta
https://bugs.ruby-lang.org/issues/18912#change-98494

* Author: hsbt (Hiroshi SHIBATA)
* Status: Open
* Priority: Normal
* Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN
----------------------------------------
Today, I tried to build ruby master with macOS 13 (Ventura) Beta. It breaks the build status caused by Xcode 14 beta changes.

TL;DR: We should add `--without=+,bigdecimal --enable-shared` to the `configure` option.

1. Build failed without `--enable-shared`.

I build ruby master without `--enable-shared` option. I got the following error.

```
(snip)
linking shared-object -test-/arith_seq/extract.bundle
Undefined symbols for architecture arm64:
  "_rb_arithmetic_sequence_extract", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_ary_new_capa", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_ary_store", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_define_singleton_method", referenced from:
      _Init_extract in extract.o
  "_rb_path2class", referenced from:
      _Init_extract in extract.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

@katei says this error affects with `-undefined dynamic_lookup` flags.

2. Build error with bigdecimal

With `--enabled-shared` resolved the first error. But I got the another build failure.

```
compiling bigdecimal.c
In file included from bigdecimal.c:13:
In file included from ./bigdecimal.h:14:
./missing.h:127:1: error: static declaration of 'rb_rational_num' follows non-static declaration
rb_rational_num(VALUE rat)
^
../.././include/ruby/internal/intern/rational.h:128:7: note: previous declaration is here
VALUE rb_rational_num(VALUE rat);
      ^
In file included from bigdecimal.c:13:
In file included from ./bigdecimal.h:14:
(snip)
```

It's affected with `static inline` declaration in missing.h of bigdecimal.

3. test failure with mjit

I could build with `--with-out-ext=+,bigdecimal --enable-share` option. But I also got the test failure with mjit.

```
[215/402] TestMJIT#test_lambda_longjmp = 0.19 s
192) Failure:
TestMJIT#test_lambda_longjmp [/Users/hsbt/Documents/github.com/ruby/ruby/test/ruby/test_mjit.rb:1045]:
Expected 1 times of JIT success, but succeeded 0 times.

script:
"""

fib = lambda do |x|
  return x if x == 0 || x == 1
  fib.call(x-1) + fib.call(x-2)
end
print fib.call(5)

"""


stderr:
"""
Undefined symbols for architecture arm64:
  "_mjit_call_p", referenced from:
      __mjit0 in _ruby_mjit_p39885u0-643ab5.o
      _vm_sendish in _ruby_mjit_p39885u0-643ab5.o
```

I already shared this to @k0kubun .

macOS 13 beta is still development status. I will track this until the official release date.






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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [ruby-core:109351] [Ruby master Bug#18912] Build failure with macOS 13 (Ventura) Beta
  2022-07-14  5:40 [ruby-core:109201] [Ruby master Bug#18912] Build failure with macOS 13 (Ventura) Beta hsbt (Hiroshi SHIBATA)
  2022-07-19 15:44 ` [ruby-core:109248] " alanwu (Alan Wu)
  2022-07-28  8:32 ` [ruby-core:109350] " hsbt (Hiroshi SHIBATA)
@ 2022-07-28  9:04 ` katei (Yuta Saito)
  2022-07-28  9:43 ` [ruby-core:109352] " hsbt (Hiroshi SHIBATA)
                   ` (15 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: katei (Yuta Saito) @ 2022-07-28  9:04 UTC (permalink / raw)
  To: ruby-core

Issue #18912 has been updated by katei (Yuta Saito).


I've made a patch to address the linking failure issue by replacing `-undefined dynamic_lookup` with `-bundle_loader`.
https://github.com/ruby/ruby/pull/6193

The patch has been tested with Xcode 14 beta2 toolchain on macOS 12.4 Monterey, but not tested on the actual Ventura yet.

----------------------------------------
Bug #18912: Build failure with macOS 13 (Ventura) Beta
https://bugs.ruby-lang.org/issues/18912#change-98495

* Author: hsbt (Hiroshi SHIBATA)
* Status: Open
* Priority: Normal
* Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN
----------------------------------------
Today, I tried to build ruby master with macOS 13 (Ventura) Beta. It breaks the build status caused by Xcode 14 beta changes.

TL;DR: We should add `--without=+,bigdecimal --enable-shared` to the `configure` option.

1. Build failed without `--enable-shared`.

I build ruby master without `--enable-shared` option. I got the following error.

```
(snip)
linking shared-object -test-/arith_seq/extract.bundle
Undefined symbols for architecture arm64:
  "_rb_arithmetic_sequence_extract", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_ary_new_capa", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_ary_store", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_define_singleton_method", referenced from:
      _Init_extract in extract.o
  "_rb_path2class", referenced from:
      _Init_extract in extract.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

@katei says this error affects with `-undefined dynamic_lookup` flags.

2. Build error with bigdecimal

With `--enabled-shared` resolved the first error. But I got the another build failure.

```
compiling bigdecimal.c
In file included from bigdecimal.c:13:
In file included from ./bigdecimal.h:14:
./missing.h:127:1: error: static declaration of 'rb_rational_num' follows non-static declaration
rb_rational_num(VALUE rat)
^
../.././include/ruby/internal/intern/rational.h:128:7: note: previous declaration is here
VALUE rb_rational_num(VALUE rat);
      ^
In file included from bigdecimal.c:13:
In file included from ./bigdecimal.h:14:
(snip)
```

It's affected with `static inline` declaration in missing.h of bigdecimal.

3. test failure with mjit

I could build with `--with-out-ext=+,bigdecimal --enable-share` option. But I also got the test failure with mjit.

```
[215/402] TestMJIT#test_lambda_longjmp = 0.19 s
192) Failure:
TestMJIT#test_lambda_longjmp [/Users/hsbt/Documents/github.com/ruby/ruby/test/ruby/test_mjit.rb:1045]:
Expected 1 times of JIT success, but succeeded 0 times.

script:
"""

fib = lambda do |x|
  return x if x == 0 || x == 1
  fib.call(x-1) + fib.call(x-2)
end
print fib.call(5)

"""


stderr:
"""
Undefined symbols for architecture arm64:
  "_mjit_call_p", referenced from:
      __mjit0 in _ruby_mjit_p39885u0-643ab5.o
      _vm_sendish in _ruby_mjit_p39885u0-643ab5.o
```

I already shared this to @k0kubun .

macOS 13 beta is still development status. I will track this until the official release date.






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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [ruby-core:109352] [Ruby master Bug#18912] Build failure with macOS 13 (Ventura) Beta
  2022-07-14  5:40 [ruby-core:109201] [Ruby master Bug#18912] Build failure with macOS 13 (Ventura) Beta hsbt (Hiroshi SHIBATA)
                   ` (2 preceding siblings ...)
  2022-07-28  9:04 ` [ruby-core:109351] " katei (Yuta Saito)
@ 2022-07-28  9:43 ` hsbt (Hiroshi SHIBATA)
  2022-07-28 12:01 ` [ruby-core:109355] " alanwu (Alan Wu)
                   ` (14 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: hsbt (Hiroshi SHIBATA) @ 2022-07-28  9:43 UTC (permalink / raw)
  To: ruby-core

Issue #18912 has been updated by hsbt (Hiroshi SHIBATA).


@katei Thanks! I will test your patch when it's complete.

FYI: Xcode 14 beta 3 with macOS 13.0 public beta is still same results.



----------------------------------------
Bug #18912: Build failure with macOS 13 (Ventura) Beta
https://bugs.ruby-lang.org/issues/18912#change-98496

* Author: hsbt (Hiroshi SHIBATA)
* Status: Open
* Priority: Normal
* Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN
----------------------------------------
Today, I tried to build ruby master with macOS 13 (Ventura) Beta. It breaks the build status caused by Xcode 14 beta changes.

TL;DR: We should add `--without=+,bigdecimal --enable-shared` to the `configure` option.

1. Build failed without `--enable-shared`.

I build ruby master without `--enable-shared` option. I got the following error.

```
(snip)
linking shared-object -test-/arith_seq/extract.bundle
Undefined symbols for architecture arm64:
  "_rb_arithmetic_sequence_extract", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_ary_new_capa", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_ary_store", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_define_singleton_method", referenced from:
      _Init_extract in extract.o
  "_rb_path2class", referenced from:
      _Init_extract in extract.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

@katei says this error affects with `-undefined dynamic_lookup` flags.

2. Build error with bigdecimal

With `--enabled-shared` resolved the first error. But I got the another build failure.

```
compiling bigdecimal.c
In file included from bigdecimal.c:13:
In file included from ./bigdecimal.h:14:
./missing.h:127:1: error: static declaration of 'rb_rational_num' follows non-static declaration
rb_rational_num(VALUE rat)
^
../.././include/ruby/internal/intern/rational.h:128:7: note: previous declaration is here
VALUE rb_rational_num(VALUE rat);
      ^
In file included from bigdecimal.c:13:
In file included from ./bigdecimal.h:14:
(snip)
```

It's affected with `static inline` declaration in missing.h of bigdecimal.

3. test failure with mjit

I could build with `--with-out-ext=+,bigdecimal --enable-share` option. But I also got the test failure with mjit.

```
[215/402] TestMJIT#test_lambda_longjmp = 0.19 s
192) Failure:
TestMJIT#test_lambda_longjmp [/Users/hsbt/Documents/github.com/ruby/ruby/test/ruby/test_mjit.rb:1045]:
Expected 1 times of JIT success, but succeeded 0 times.

script:
"""

fib = lambda do |x|
  return x if x == 0 || x == 1
  fib.call(x-1) + fib.call(x-2)
end
print fib.call(5)

"""


stderr:
"""
Undefined symbols for architecture arm64:
  "_mjit_call_p", referenced from:
      __mjit0 in _ruby_mjit_p39885u0-643ab5.o
      _vm_sendish in _ruby_mjit_p39885u0-643ab5.o
```

I already shared this to @k0kubun .

macOS 13 beta is still development status. I will track this until the official release date.






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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [ruby-core:109355] [Ruby master Bug#18912] Build failure with macOS 13 (Ventura) Beta
  2022-07-14  5:40 [ruby-core:109201] [Ruby master Bug#18912] Build failure with macOS 13 (Ventura) Beta hsbt (Hiroshi SHIBATA)
                   ` (3 preceding siblings ...)
  2022-07-28  9:43 ` [ruby-core:109352] " hsbt (Hiroshi SHIBATA)
@ 2022-07-28 12:01 ` alanwu (Alan Wu)
  2022-08-01  4:24 ` [ruby-core:109398] " hsbt (Hiroshi SHIBATA)
                   ` (13 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: alanwu (Alan Wu) @ 2022-07-28 12:01 UTC (permalink / raw)
  To: ruby-core

Issue #18912 has been updated by alanwu (Alan Wu).


@hsbt Thanks for the logs. Some symbols are
indeed not found due to link errors. For example,
`rb_complex_real()` is provided but not found.

The linker error contradicts itself:

```
have_func: checking for rb_complex_real() in ruby.h... -------------------- no
...
ld: warning: ignoring file ../../libruby.3.2-static.a, building for macOS-arm64 but attempting to link with file built for macOS-arm64
```

So the error message could be better, at least.
Maybe the linker is not printing out the full
architecture stamp that it's comparing. You could
try checking `otool -hv libruby.3.2-static.a` and
comparing that with `otool -hv bigdecimal.o`.
The `cpusubtype` column might be different.
Also, maybe bigdecimal and libruby are built with
different toolchains due the way the XCode beta is
setup? I should find some time to install the beta...

----------------------------------------
Bug #18912: Build failure with macOS 13 (Ventura) Beta
https://bugs.ruby-lang.org/issues/18912#change-98499

* Author: hsbt (Hiroshi SHIBATA)
* Status: Open
* Priority: Normal
* Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN
----------------------------------------
Today, I tried to build ruby master with macOS 13 (Ventura) Beta. It breaks the build status caused by Xcode 14 beta changes.

TL;DR: We should add `--without=+,bigdecimal --enable-shared` to the `configure` option.

1. Build failed without `--enable-shared`.

I build ruby master without `--enable-shared` option. I got the following error.

```
(snip)
linking shared-object -test-/arith_seq/extract.bundle
Undefined symbols for architecture arm64:
  "_rb_arithmetic_sequence_extract", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_ary_new_capa", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_ary_store", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_define_singleton_method", referenced from:
      _Init_extract in extract.o
  "_rb_path2class", referenced from:
      _Init_extract in extract.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

@katei says this error affects with `-undefined dynamic_lookup` flags.

2. Build error with bigdecimal

With `--enabled-shared` resolved the first error. But I got the another build failure.

```
compiling bigdecimal.c
In file included from bigdecimal.c:13:
In file included from ./bigdecimal.h:14:
./missing.h:127:1: error: static declaration of 'rb_rational_num' follows non-static declaration
rb_rational_num(VALUE rat)
^
../.././include/ruby/internal/intern/rational.h:128:7: note: previous declaration is here
VALUE rb_rational_num(VALUE rat);
      ^
In file included from bigdecimal.c:13:
In file included from ./bigdecimal.h:14:
(snip)
```

It's affected with `static inline` declaration in missing.h of bigdecimal.

3. test failure with mjit

I could build with `--with-out-ext=+,bigdecimal --enable-share` option. But I also got the test failure with mjit.

```
[215/402] TestMJIT#test_lambda_longjmp = 0.19 s
192) Failure:
TestMJIT#test_lambda_longjmp [/Users/hsbt/Documents/github.com/ruby/ruby/test/ruby/test_mjit.rb:1045]:
Expected 1 times of JIT success, but succeeded 0 times.

script:
"""

fib = lambda do |x|
  return x if x == 0 || x == 1
  fib.call(x-1) + fib.call(x-2)
end
print fib.call(5)

"""


stderr:
"""
Undefined symbols for architecture arm64:
  "_mjit_call_p", referenced from:
      __mjit0 in _ruby_mjit_p39885u0-643ab5.o
      _vm_sendish in _ruby_mjit_p39885u0-643ab5.o
```

I already shared this to @k0kubun .

macOS 13 beta is still development status. I will track this until the official release date.






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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [ruby-core:109398] [Ruby master Bug#18912] Build failure with macOS 13 (Ventura) Beta
  2022-07-14  5:40 [ruby-core:109201] [Ruby master Bug#18912] Build failure with macOS 13 (Ventura) Beta hsbt (Hiroshi SHIBATA)
                   ` (4 preceding siblings ...)
  2022-07-28 12:01 ` [ruby-core:109355] " alanwu (Alan Wu)
@ 2022-08-01  4:24 ` hsbt (Hiroshi SHIBATA)
  2022-08-01  6:23 ` [ruby-core:109399] " hsbt (Hiroshi SHIBATA)
                   ` (12 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: hsbt (Hiroshi SHIBATA) @ 2022-08-01  4:24 UTC (permalink / raw)
  To: ruby-core

Issue #18912 has been updated by hsbt (Hiroshi SHIBATA).


I tried https://github.com/ruby/ruby/pull/6193 .

The first try is failed. Because my environment mixed the homebrew `binutils` built by macOS 12.0(monterey). 

I could build ruby after removing GNU `binutils` from `PATH`. and it could build `bigdecimal` and pass with tests related MJIT.

----------------------------------------
Bug #18912: Build failure with macOS 13 (Ventura) Beta
https://bugs.ruby-lang.org/issues/18912#change-98549

* Author: hsbt (Hiroshi SHIBATA)
* Status: Open
* Priority: Normal
* Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN
----------------------------------------
Today, I tried to build ruby master with macOS 13 (Ventura) Beta. It breaks the build status caused by Xcode 14 beta changes.

TL;DR: We should add `--without=+,bigdecimal --enable-shared` to the `configure` option.

1. Build failed without `--enable-shared`.

I build ruby master without `--enable-shared` option. I got the following error.

```
(snip)
linking shared-object -test-/arith_seq/extract.bundle
Undefined symbols for architecture arm64:
  "_rb_arithmetic_sequence_extract", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_ary_new_capa", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_ary_store", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_define_singleton_method", referenced from:
      _Init_extract in extract.o
  "_rb_path2class", referenced from:
      _Init_extract in extract.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

@katei says this error affects with `-undefined dynamic_lookup` flags.

2. Build error with bigdecimal

With `--enabled-shared` resolved the first error. But I got the another build failure.

```
compiling bigdecimal.c
In file included from bigdecimal.c:13:
In file included from ./bigdecimal.h:14:
./missing.h:127:1: error: static declaration of 'rb_rational_num' follows non-static declaration
rb_rational_num(VALUE rat)
^
../.././include/ruby/internal/intern/rational.h:128:7: note: previous declaration is here
VALUE rb_rational_num(VALUE rat);
      ^
In file included from bigdecimal.c:13:
In file included from ./bigdecimal.h:14:
(snip)
```

It's affected with `static inline` declaration in missing.h of bigdecimal.

3. test failure with mjit

I could build with `--with-out-ext=+,bigdecimal --enable-share` option. But I also got the test failure with mjit.

```
[215/402] TestMJIT#test_lambda_longjmp = 0.19 s
192) Failure:
TestMJIT#test_lambda_longjmp [/Users/hsbt/Documents/github.com/ruby/ruby/test/ruby/test_mjit.rb:1045]:
Expected 1 times of JIT success, but succeeded 0 times.

script:
"""

fib = lambda do |x|
  return x if x == 0 || x == 1
  fib.call(x-1) + fib.call(x-2)
end
print fib.call(5)

"""


stderr:
"""
Undefined symbols for architecture arm64:
  "_mjit_call_p", referenced from:
      __mjit0 in _ruby_mjit_p39885u0-643ab5.o
      _vm_sendish in _ruby_mjit_p39885u0-643ab5.o
```

I already shared this to @k0kubun .

macOS 13 beta is still development status. I will track this until the official release date.






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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [ruby-core:109399] [Ruby master Bug#18912] Build failure with macOS 13 (Ventura) Beta
  2022-07-14  5:40 [ruby-core:109201] [Ruby master Bug#18912] Build failure with macOS 13 (Ventura) Beta hsbt (Hiroshi SHIBATA)
                   ` (5 preceding siblings ...)
  2022-08-01  4:24 ` [ruby-core:109398] " hsbt (Hiroshi SHIBATA)
@ 2022-08-01  6:23 ` hsbt (Hiroshi SHIBATA)
  2022-08-05  3:40 ` [ruby-core:109424] " hsbt (Hiroshi SHIBATA)
                   ` (11 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: hsbt (Hiroshi SHIBATA) @ 2022-08-01  6:23 UTC (permalink / raw)
  To: ruby-core

Issue #18912 has been updated by hsbt (Hiroshi SHIBATA).

Assignee set to hsbt (Hiroshi SHIBATA)
Status changed from Open to Assigned

----------------------------------------
Bug #18912: Build failure with macOS 13 (Ventura) Beta
https://bugs.ruby-lang.org/issues/18912#change-98550

* Author: hsbt (Hiroshi SHIBATA)
* Status: Assigned
* Priority: Normal
* Assignee: hsbt (Hiroshi SHIBATA)
* Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN
----------------------------------------
Today, I tried to build ruby master with macOS 13 (Ventura) Beta. It breaks the build status caused by Xcode 14 beta changes.

TL;DR: We should add `--without=+,bigdecimal --enable-shared` to the `configure` option.

1. Build failed without `--enable-shared`.

I build ruby master without `--enable-shared` option. I got the following error.

```
(snip)
linking shared-object -test-/arith_seq/extract.bundle
Undefined symbols for architecture arm64:
  "_rb_arithmetic_sequence_extract", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_ary_new_capa", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_ary_store", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_define_singleton_method", referenced from:
      _Init_extract in extract.o
  "_rb_path2class", referenced from:
      _Init_extract in extract.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

@katei says this error affects with `-undefined dynamic_lookup` flags.

2. Build error with bigdecimal

With `--enabled-shared` resolved the first error. But I got the another build failure.

```
compiling bigdecimal.c
In file included from bigdecimal.c:13:
In file included from ./bigdecimal.h:14:
./missing.h:127:1: error: static declaration of 'rb_rational_num' follows non-static declaration
rb_rational_num(VALUE rat)
^
../.././include/ruby/internal/intern/rational.h:128:7: note: previous declaration is here
VALUE rb_rational_num(VALUE rat);
      ^
In file included from bigdecimal.c:13:
In file included from ./bigdecimal.h:14:
(snip)
```

It's affected with `static inline` declaration in missing.h of bigdecimal.

3. test failure with mjit

I could build with `--with-out-ext=+,bigdecimal --enable-share` option. But I also got the test failure with mjit.

```
[215/402] TestMJIT#test_lambda_longjmp = 0.19 s
192) Failure:
TestMJIT#test_lambda_longjmp [/Users/hsbt/Documents/github.com/ruby/ruby/test/ruby/test_mjit.rb:1045]:
Expected 1 times of JIT success, but succeeded 0 times.

script:
"""

fib = lambda do |x|
  return x if x == 0 || x == 1
  fib.call(x-1) + fib.call(x-2)
end
print fib.call(5)

"""


stderr:
"""
Undefined symbols for architecture arm64:
  "_mjit_call_p", referenced from:
      __mjit0 in _ruby_mjit_p39885u0-643ab5.o
      _vm_sendish in _ruby_mjit_p39885u0-643ab5.o
```

I already shared this to @k0kubun .

macOS 13 beta is still development status. I will track this until the official release date.






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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [ruby-core:109424] [Ruby master Bug#18912] Build failure with macOS 13 (Ventura) Beta
  2022-07-14  5:40 [ruby-core:109201] [Ruby master Bug#18912] Build failure with macOS 13 (Ventura) Beta hsbt (Hiroshi SHIBATA)
                   ` (6 preceding siblings ...)
  2022-08-01  6:23 ` [ruby-core:109399] " hsbt (Hiroshi SHIBATA)
@ 2022-08-05  3:40 ` hsbt (Hiroshi SHIBATA)
  2022-08-23 10:09 ` [ruby-core:109640] " hsbt (Hiroshi SHIBATA)
                   ` (10 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: hsbt (Hiroshi SHIBATA) @ 2022-08-05  3:40 UTC (permalink / raw)
  To: ruby-core

Issue #18912 has been updated by hsbt (Hiroshi SHIBATA).


After merging https://github.com/ruby/ruby/pull/6193. We could build Ruby.

But We have still failing tests:

```
TestProcess#test_daemon_nocloseobjc[10525]: +[NSPlaceholderMutableString initialize] may have been in progress in another thread when fork() was called.
objc[10525]: +[NSPlaceholderMutableString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
 = 0.00 s
  1) Failure:
TestProcess#test_daemon_noclose [/Users/hsbt/Documents/github.com/ruby/ruby/test/ruby/test_process.rb:1846]:
<"ok\n" + "/\n"> expected but was
<"">.
```

and `spec/ruby/core/process/daemon_spec.rb` is also failed.

----------------------------------------
Bug #18912: Build failure with macOS 13 (Ventura) Beta
https://bugs.ruby-lang.org/issues/18912#change-98578

* Author: hsbt (Hiroshi SHIBATA)
* Status: Assigned
* Priority: Normal
* Assignee: hsbt (Hiroshi SHIBATA)
* Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN
----------------------------------------
Today, I tried to build ruby master with macOS 13 (Ventura) Beta. It breaks the build status caused by Xcode 14 beta changes.

TL;DR: We should add `--without=+,bigdecimal --enable-shared` to the `configure` option.

1. Build failed without `--enable-shared`.

I build ruby master without `--enable-shared` option. I got the following error.

```
(snip)
linking shared-object -test-/arith_seq/extract.bundle
Undefined symbols for architecture arm64:
  "_rb_arithmetic_sequence_extract", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_ary_new_capa", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_ary_store", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_define_singleton_method", referenced from:
      _Init_extract in extract.o
  "_rb_path2class", referenced from:
      _Init_extract in extract.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

@katei says this error affects with `-undefined dynamic_lookup` flags.

2. Build error with bigdecimal

With `--enabled-shared` resolved the first error. But I got the another build failure.

```
compiling bigdecimal.c
In file included from bigdecimal.c:13:
In file included from ./bigdecimal.h:14:
./missing.h:127:1: error: static declaration of 'rb_rational_num' follows non-static declaration
rb_rational_num(VALUE rat)
^
../.././include/ruby/internal/intern/rational.h:128:7: note: previous declaration is here
VALUE rb_rational_num(VALUE rat);
      ^
In file included from bigdecimal.c:13:
In file included from ./bigdecimal.h:14:
(snip)
```

It's affected with `static inline` declaration in missing.h of bigdecimal.

3. test failure with mjit

I could build with `--with-out-ext=+,bigdecimal --enable-share` option. But I also got the test failure with mjit.

```
[215/402] TestMJIT#test_lambda_longjmp = 0.19 s
192) Failure:
TestMJIT#test_lambda_longjmp [/Users/hsbt/Documents/github.com/ruby/ruby/test/ruby/test_mjit.rb:1045]:
Expected 1 times of JIT success, but succeeded 0 times.

script:
"""

fib = lambda do |x|
  return x if x == 0 || x == 1
  fib.call(x-1) + fib.call(x-2)
end
print fib.call(5)

"""


stderr:
"""
Undefined symbols for architecture arm64:
  "_mjit_call_p", referenced from:
      __mjit0 in _ruby_mjit_p39885u0-643ab5.o
      _vm_sendish in _ruby_mjit_p39885u0-643ab5.o
```

I already shared this to @k0kubun .

macOS 13 beta is still development status. I will track this until the official release date.






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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [ruby-core:109640] [Ruby master Bug#18912] Build failure with macOS 13 (Ventura) Beta
  2022-07-14  5:40 [ruby-core:109201] [Ruby master Bug#18912] Build failure with macOS 13 (Ventura) Beta hsbt (Hiroshi SHIBATA)
                   ` (7 preceding siblings ...)
  2022-08-05  3:40 ` [ruby-core:109424] " hsbt (Hiroshi SHIBATA)
@ 2022-08-23 10:09 ` hsbt (Hiroshi SHIBATA)
  2022-09-17  7:47 ` [ruby-core:109936] [Ruby master Bug#18912] Build failure with Xcode 14 and " hsbt (Hiroshi SHIBATA)
                   ` (9 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: hsbt (Hiroshi SHIBATA) @ 2022-08-23 10:09 UTC (permalink / raw)
  To: ruby-core

Issue #18912 has been updated by hsbt (Hiroshi SHIBATA).


`TestProcess#test_daemon_noclose` passed with `export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES` from https://github.com/rails/rails/issues/38560



----------------------------------------
Bug #18912: Build failure with macOS 13 (Ventura) Beta
https://bugs.ruby-lang.org/issues/18912#change-98861

* Author: hsbt (Hiroshi SHIBATA)
* Status: Assigned
* Priority: Normal
* Assignee: hsbt (Hiroshi SHIBATA)
* Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN
----------------------------------------
Today, I tried to build ruby master with macOS 13 (Ventura) Beta. It breaks the build status caused by Xcode 14 beta changes.

TL;DR: We should add `--without=+,bigdecimal --enable-shared` to the `configure` option.

1. Build failed without `--enable-shared`.

I build ruby master without `--enable-shared` option. I got the following error.

```
(snip)
linking shared-object -test-/arith_seq/extract.bundle
Undefined symbols for architecture arm64:
  "_rb_arithmetic_sequence_extract", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_ary_new_capa", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_ary_store", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_define_singleton_method", referenced from:
      _Init_extract in extract.o
  "_rb_path2class", referenced from:
      _Init_extract in extract.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

@katei says this error affects with `-undefined dynamic_lookup` flags.

2. Build error with bigdecimal

With `--enabled-shared` resolved the first error. But I got the another build failure.

```
compiling bigdecimal.c
In file included from bigdecimal.c:13:
In file included from ./bigdecimal.h:14:
./missing.h:127:1: error: static declaration of 'rb_rational_num' follows non-static declaration
rb_rational_num(VALUE rat)
^
../.././include/ruby/internal/intern/rational.h:128:7: note: previous declaration is here
VALUE rb_rational_num(VALUE rat);
      ^
In file included from bigdecimal.c:13:
In file included from ./bigdecimal.h:14:
(snip)
```

It's affected with `static inline` declaration in missing.h of bigdecimal.

3. test failure with mjit

I could build with `--with-out-ext=+,bigdecimal --enable-share` option. But I also got the test failure with mjit.

```
[215/402] TestMJIT#test_lambda_longjmp = 0.19 s
192) Failure:
TestMJIT#test_lambda_longjmp [/Users/hsbt/Documents/github.com/ruby/ruby/test/ruby/test_mjit.rb:1045]:
Expected 1 times of JIT success, but succeeded 0 times.

script:
"""

fib = lambda do |x|
  return x if x == 0 || x == 1
  fib.call(x-1) + fib.call(x-2)
end
print fib.call(5)

"""


stderr:
"""
Undefined symbols for architecture arm64:
  "_mjit_call_p", referenced from:
      __mjit0 in _ruby_mjit_p39885u0-643ab5.o
      _vm_sendish in _ruby_mjit_p39885u0-643ab5.o
```

I already shared this to @k0kubun .

macOS 13 beta is still development status. I will track this until the official release date.






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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [ruby-core:109936] [Ruby master Bug#18912] Build failure with Xcode 14 and macOS 13 (Ventura) Beta
  2022-07-14  5:40 [ruby-core:109201] [Ruby master Bug#18912] Build failure with macOS 13 (Ventura) Beta hsbt (Hiroshi SHIBATA)
                   ` (8 preceding siblings ...)
  2022-08-23 10:09 ` [ruby-core:109640] " hsbt (Hiroshi SHIBATA)
@ 2022-09-17  7:47 ` hsbt (Hiroshi SHIBATA)
  2022-09-17 11:29 ` [ruby-core:109939] " katei (Yuta Saito)
                   ` (8 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: hsbt (Hiroshi SHIBATA) @ 2022-09-17  7:47 UTC (permalink / raw)
  To: ruby-core

Issue #18912 has been updated by hsbt (Hiroshi SHIBATA).

Subject changed from Build failure with macOS 13 (Ventura) Beta to Build failure with Xcode 14 and macOS 13 (Ventura) Beta

Xcode 14 has been released. The all stable versions of Ruby couldn't build with Xcode 14.

We fixed this issue at Ruby 2.7-3.1 and master branch. But the stable versions are not released yet.

I strongly recommend to not upgrade Xcode 14 and its toolchains for macOS users. If you already update Xcode 14, you remove them with

```
sudo rm -rf /Library/Developer/CommandLineTools
```

and install Xcode 13.x or toolchains from https://developer.apple.com/download/all



----------------------------------------
Bug #18912: Build failure with Xcode 14 and macOS 13 (Ventura) Beta
https://bugs.ruby-lang.org/issues/18912#change-99183

* Author: hsbt (Hiroshi SHIBATA)
* Status: Assigned
* Priority: Normal
* Assignee: hsbt (Hiroshi SHIBATA)
* Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN
----------------------------------------
Today, I tried to build ruby master with macOS 13 (Ventura) Beta. It breaks the build status caused by Xcode 14 beta changes.

TL;DR: We should add `--without=+,bigdecimal --enable-shared` to the `configure` option.

1. Build failed without `--enable-shared`.

I build ruby master without `--enable-shared` option. I got the following error.

```
(snip)
linking shared-object -test-/arith_seq/extract.bundle
Undefined symbols for architecture arm64:
  "_rb_arithmetic_sequence_extract", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_ary_new_capa", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_ary_store", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_define_singleton_method", referenced from:
      _Init_extract in extract.o
  "_rb_path2class", referenced from:
      _Init_extract in extract.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

@katei says this error affects with `-undefined dynamic_lookup` flags.

2. Build error with bigdecimal

With `--enabled-shared` resolved the first error. But I got the another build failure.

```
compiling bigdecimal.c
In file included from bigdecimal.c:13:
In file included from ./bigdecimal.h:14:
./missing.h:127:1: error: static declaration of 'rb_rational_num' follows non-static declaration
rb_rational_num(VALUE rat)
^
../.././include/ruby/internal/intern/rational.h:128:7: note: previous declaration is here
VALUE rb_rational_num(VALUE rat);
      ^
In file included from bigdecimal.c:13:
In file included from ./bigdecimal.h:14:
(snip)
```

It's affected with `static inline` declaration in missing.h of bigdecimal.

3. test failure with mjit

I could build with `--with-out-ext=+,bigdecimal --enable-share` option. But I also got the test failure with mjit.

```
[215/402] TestMJIT#test_lambda_longjmp = 0.19 s
192) Failure:
TestMJIT#test_lambda_longjmp [/Users/hsbt/Documents/github.com/ruby/ruby/test/ruby/test_mjit.rb:1045]:
Expected 1 times of JIT success, but succeeded 0 times.

script:
"""

fib = lambda do |x|
  return x if x == 0 || x == 1
  fib.call(x-1) + fib.call(x-2)
end
print fib.call(5)

"""


stderr:
"""
Undefined symbols for architecture arm64:
  "_mjit_call_p", referenced from:
      __mjit0 in _ruby_mjit_p39885u0-643ab5.o
      _vm_sendish in _ruby_mjit_p39885u0-643ab5.o
```

I already shared this to @k0kubun .

macOS 13 beta is still development status. I will track this until the official release date.






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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [ruby-core:109939] [Ruby master Bug#18912] Build failure with Xcode 14 and macOS 13 (Ventura) Beta
  2022-07-14  5:40 [ruby-core:109201] [Ruby master Bug#18912] Build failure with macOS 13 (Ventura) Beta hsbt (Hiroshi SHIBATA)
                   ` (9 preceding siblings ...)
  2022-09-17  7:47 ` [ruby-core:109936] [Ruby master Bug#18912] Build failure with Xcode 14 and " hsbt (Hiroshi SHIBATA)
@ 2022-09-17 11:29 ` katei (Yuta Saito)
  2022-09-18  2:47 ` [ruby-core:109943] " nobu (Nobuyoshi Nakada)
                   ` (7 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: katei (Yuta Saito) @ 2022-09-17 11:29 UTC (permalink / raw)
  To: ruby-core

Issue #18912 has been updated by katei (Yuta Saito).


I've been doing some digging around the `TestProcess#test_daemon_noclose` test failure.
Minimum reproducible code is here

```
Process.daemon(false, true)
Dir.pwd
```

 And got some facts:

- On macOS, you should not use Objective-C classes for the first time in a process forked from a multithreaded process without exec
  - Because the +initialize mechanism called the first time you use an Objective-C class is not async signal safe.
  - Sources: [detailed blog post](http://sealiesoftware.com/blog/archive/2017/6/5/Objective-C_and_fork_in_macOS_1013.html), [comments in objc4 source code](https://github.com/apple-oss-distributions/objc4/blob/8701d5672d3fd3cd817aeb84db1077aafe1a1604/runtime/objc-initialize.mm#L426-L458)
- CRuby on macOS is always multithreaded due to the timer thread.
- `Kernel.fork` and `Process.daemon` can create "forked process without exec".
  - In other words, using Objective-C API after forked process may cause deadlock.
- CoreFoundation API used by `Dir.pwd` now depends on Objective-C classes from Ventura. (NEW in Ventura)

So, I guess this means that the potential deadlock was everywhere even before Ventura, and it was not caught in test suites. However it was finally revealed, thanks(?) to the CoreFoundation change introduced in Ventura.

IMHO this unsafe-ness is a problem that can only be solved on the user program side, not CRuby. So we can leave this problem to user responsibility and update the test case to be Objective-C friendly...
(I know this is not ideal solution, so let me know if you have a better solution)

----------------------------------------
Bug #18912: Build failure with Xcode 14 and macOS 13 (Ventura) Beta
https://bugs.ruby-lang.org/issues/18912#change-99186

* Author: hsbt (Hiroshi SHIBATA)
* Status: Assigned
* Priority: Normal
* Assignee: hsbt (Hiroshi SHIBATA)
* Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN
----------------------------------------
Today, I tried to build ruby master with macOS 13 (Ventura) Beta. It breaks the build status caused by Xcode 14 beta changes.

TL;DR: We should add `--without=+,bigdecimal --enable-shared` to the `configure` option.

1. Build failed without `--enable-shared`.

I build ruby master without `--enable-shared` option. I got the following error.

```
(snip)
linking shared-object -test-/arith_seq/extract.bundle
Undefined symbols for architecture arm64:
  "_rb_arithmetic_sequence_extract", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_ary_new_capa", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_ary_store", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_define_singleton_method", referenced from:
      _Init_extract in extract.o
  "_rb_path2class", referenced from:
      _Init_extract in extract.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

@katei says this error affects with `-undefined dynamic_lookup` flags.

2. Build error with bigdecimal

With `--enabled-shared` resolved the first error. But I got the another build failure.

```
compiling bigdecimal.c
In file included from bigdecimal.c:13:
In file included from ./bigdecimal.h:14:
./missing.h:127:1: error: static declaration of 'rb_rational_num' follows non-static declaration
rb_rational_num(VALUE rat)
^
../.././include/ruby/internal/intern/rational.h:128:7: note: previous declaration is here
VALUE rb_rational_num(VALUE rat);
      ^
In file included from bigdecimal.c:13:
In file included from ./bigdecimal.h:14:
(snip)
```

It's affected with `static inline` declaration in missing.h of bigdecimal.

3. test failure with mjit

I could build with `--with-out-ext=+,bigdecimal --enable-share` option. But I also got the test failure with mjit.

```
[215/402] TestMJIT#test_lambda_longjmp = 0.19 s
192) Failure:
TestMJIT#test_lambda_longjmp [/Users/hsbt/Documents/github.com/ruby/ruby/test/ruby/test_mjit.rb:1045]:
Expected 1 times of JIT success, but succeeded 0 times.

script:
"""

fib = lambda do |x|
  return x if x == 0 || x == 1
  fib.call(x-1) + fib.call(x-2)
end
print fib.call(5)

"""


stderr:
"""
Undefined symbols for architecture arm64:
  "_mjit_call_p", referenced from:
      __mjit0 in _ruby_mjit_p39885u0-643ab5.o
      _vm_sendish in _ruby_mjit_p39885u0-643ab5.o
```

I already shared this to @k0kubun .

macOS 13 beta is still development status. I will track this until the official release date.






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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [ruby-core:109943] [Ruby master Bug#18912] Build failure with Xcode 14 and macOS 13 (Ventura) Beta
  2022-07-14  5:40 [ruby-core:109201] [Ruby master Bug#18912] Build failure with macOS 13 (Ventura) Beta hsbt (Hiroshi SHIBATA)
                   ` (10 preceding siblings ...)
  2022-09-17 11:29 ` [ruby-core:109939] " katei (Yuta Saito)
@ 2022-09-18  2:47 ` nobu (Nobuyoshi Nakada)
  2022-09-19  3:32 ` [ruby-core:109954] " nobu (Nobuyoshi Nakada)
                   ` (6 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: nobu (Nobuyoshi Nakada) @ 2022-09-18  2:47 UTC (permalink / raw)
  To: ruby-core

Issue #18912 has been updated by nobu (Nobuyoshi Nakada).

Backport changed from 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN to 2.7: REQUIRED, 3.0: REQUIRED, 3.1: REQUIRED

Thank you, then is it ok if `CFString` has been initialized first?

```diff
diff --git a/file.c b/file.c
index de7ed5e33ba..b91b8c346cd 100644
--- a/file.c
+++ b/file.c
@@ -268,6 +268,20 @@ rb_str_encode_ospath(VALUE path)
 
 #ifdef __APPLE__
 # define NORMALIZE_UTF8PATH 1
+__attribute__((constructor))
+static void
+finish_async_unsafe_CFString_class_initialization(void)
+{
+    const UInt8 empty[1] = {0};
+    CFStringRef s = CFStringCreateWithBytesNoCopy(kCFAllocatorDefault,
+                                                  empty, 0,
+                                                  kCFStringEncodingUTF8, FALSE,
+                                                  kCFAllocatorNull);
+    CFMutableStringRef m = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, s);
+    CFRelease(m);
+    CFRelease(s);
+}
+
 static VALUE
 rb_str_append_normalized_ospath(VALUE str, const char *ptr, long len)
 {
```

----------------------------------------
Bug #18912: Build failure with Xcode 14 and macOS 13 (Ventura) Beta
https://bugs.ruby-lang.org/issues/18912#change-99191

* Author: hsbt (Hiroshi SHIBATA)
* Status: Assigned
* Priority: Normal
* Assignee: hsbt (Hiroshi SHIBATA)
* Backport: 2.7: REQUIRED, 3.0: REQUIRED, 3.1: REQUIRED
----------------------------------------
Today, I tried to build ruby master with macOS 13 (Ventura) Beta. It breaks the build status caused by Xcode 14 beta changes.

TL;DR: We should add `--without=+,bigdecimal --enable-shared` to the `configure` option.

1. Build failed without `--enable-shared`.

I build ruby master without `--enable-shared` option. I got the following error.

```
(snip)
linking shared-object -test-/arith_seq/extract.bundle
Undefined symbols for architecture arm64:
  "_rb_arithmetic_sequence_extract", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_ary_new_capa", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_ary_store", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_define_singleton_method", referenced from:
      _Init_extract in extract.o
  "_rb_path2class", referenced from:
      _Init_extract in extract.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

@katei says this error affects with `-undefined dynamic_lookup` flags.

2. Build error with bigdecimal

With `--enabled-shared` resolved the first error. But I got the another build failure.

```
compiling bigdecimal.c
In file included from bigdecimal.c:13:
In file included from ./bigdecimal.h:14:
./missing.h:127:1: error: static declaration of 'rb_rational_num' follows non-static declaration
rb_rational_num(VALUE rat)
^
../.././include/ruby/internal/intern/rational.h:128:7: note: previous declaration is here
VALUE rb_rational_num(VALUE rat);
      ^
In file included from bigdecimal.c:13:
In file included from ./bigdecimal.h:14:
(snip)
```

It's affected with `static inline` declaration in missing.h of bigdecimal.

3. test failure with mjit

I could build with `--with-out-ext=+,bigdecimal --enable-share` option. But I also got the test failure with mjit.

```
[215/402] TestMJIT#test_lambda_longjmp = 0.19 s
192) Failure:
TestMJIT#test_lambda_longjmp [/Users/hsbt/Documents/github.com/ruby/ruby/test/ruby/test_mjit.rb:1045]:
Expected 1 times of JIT success, but succeeded 0 times.

script:
"""

fib = lambda do |x|
  return x if x == 0 || x == 1
  fib.call(x-1) + fib.call(x-2)
end
print fib.call(5)

"""


stderr:
"""
Undefined symbols for architecture arm64:
  "_mjit_call_p", referenced from:
      __mjit0 in _ruby_mjit_p39885u0-643ab5.o
      _vm_sendish in _ruby_mjit_p39885u0-643ab5.o
```

I already shared this to @k0kubun .

macOS 13 beta is still development status. I will track this until the official release date.






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

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [ruby-core:109954] [Ruby master Bug#18912] Build failure with Xcode 14 and macOS 13 (Ventura) Beta
  2022-07-14  5:40 [ruby-core:109201] [Ruby master Bug#18912] Build failure with macOS 13 (Ventura) Beta hsbt (Hiroshi SHIBATA)
                   ` (11 preceding siblings ...)
  2022-09-18  2:47 ` [ruby-core:109943] " nobu (Nobuyoshi Nakada)
@ 2022-09-19  3:32 ` nobu (Nobuyoshi Nakada)
  2022-09-23 18:53 ` [ruby-core:110051] " katei (Yuta Saito)
                   ` (5 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: nobu (Nobuyoshi Nakada) @ 2022-09-19  3:32 UTC (permalink / raw)
  To: ruby-core

Issue #18912 has been updated by nobu (Nobuyoshi Nakada).


According to @katei's experiments, the followings are ok.
* `IO.popen`
  ```ruby
  p IO.popen("-") { |f|
    if f
      f.gets
    else
      puts Dir.pwd
    end
  }
  ```
* `Dir.pwd` in forked process
  ```ruby
  fork {p Dir.pwd}
  ```
* `Dir.pwd` in doubly forked process
  ```ruby
  fork {fork {p Dir.pwd}}
  ```

Only the code using `Process.daemon` in #note-12 does crash.


----------------------------------------
Bug #18912: Build failure with Xcode 14 and macOS 13 (Ventura) Beta
https://bugs.ruby-lang.org/issues/18912#change-99204

* Author: hsbt (Hiroshi SHIBATA)
* Status: Assigned
* Priority: Normal
* Assignee: hsbt (Hiroshi SHIBATA)
* Backport: 2.7: REQUIRED, 3.0: REQUIRED, 3.1: REQUIRED
----------------------------------------
Today, I tried to build ruby master with macOS 13 (Ventura) Beta. It breaks the build status caused by Xcode 14 beta changes.

TL;DR: We should add `--without=+,bigdecimal --enable-shared` to the `configure` option.

1. Build failed without `--enable-shared`.

I build ruby master without `--enable-shared` option. I got the following error.

```
(snip)
linking shared-object -test-/arith_seq/extract.bundle
Undefined symbols for architecture arm64:
  "_rb_arithmetic_sequence_extract", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_ary_new_capa", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_ary_store", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_define_singleton_method", referenced from:
      _Init_extract in extract.o
  "_rb_path2class", referenced from:
      _Init_extract in extract.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

@katei says this error affects with `-undefined dynamic_lookup` flags.

2. Build error with bigdecimal

With `--enabled-shared` resolved the first error. But I got the another build failure.

```
compiling bigdecimal.c
In file included from bigdecimal.c:13:
In file included from ./bigdecimal.h:14:
./missing.h:127:1: error: static declaration of 'rb_rational_num' follows non-static declaration
rb_rational_num(VALUE rat)
^
../.././include/ruby/internal/intern/rational.h:128:7: note: previous declaration is here
VALUE rb_rational_num(VALUE rat);
      ^
In file included from bigdecimal.c:13:
In file included from ./bigdecimal.h:14:
(snip)
```

It's affected with `static inline` declaration in missing.h of bigdecimal.

3. test failure with mjit

I could build with `--with-out-ext=+,bigdecimal --enable-share` option. But I also got the test failure with mjit.

```
[215/402] TestMJIT#test_lambda_longjmp = 0.19 s
192) Failure:
TestMJIT#test_lambda_longjmp [/Users/hsbt/Documents/github.com/ruby/ruby/test/ruby/test_mjit.rb:1045]:
Expected 1 times of JIT success, but succeeded 0 times.

script:
"""

fib = lambda do |x|
  return x if x == 0 || x == 1
  fib.call(x-1) + fib.call(x-2)
end
print fib.call(5)

"""


stderr:
"""
Undefined symbols for architecture arm64:
  "_mjit_call_p", referenced from:
      __mjit0 in _ruby_mjit_p39885u0-643ab5.o
      _vm_sendish in _ruby_mjit_p39885u0-643ab5.o
```

I already shared this to @k0kubun .

macOS 13 beta is still development status. I will track this until the official release date.






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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [ruby-core:110051] [Ruby master Bug#18912] Build failure with Xcode 14 and macOS 13 (Ventura) Beta
  2022-07-14  5:40 [ruby-core:109201] [Ruby master Bug#18912] Build failure with macOS 13 (Ventura) Beta hsbt (Hiroshi SHIBATA)
                   ` (12 preceding siblings ...)
  2022-09-19  3:32 ` [ruby-core:109954] " nobu (Nobuyoshi Nakada)
@ 2022-09-23 18:53 ` katei (Yuta Saito)
  2022-09-26  2:40 ` [ruby-core:110076] " hsbt (Hiroshi SHIBATA)
                   ` (4 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: katei (Yuta Saito) @ 2022-09-23 18:53 UTC (permalink / raw)
  To: ruby-core

Issue #18912 has been updated by katei (Yuta Saito).



From my further debugging, I found that CoreFoundation internally creates NSTaggedPointerString for small strings since macOS 13.

This C code can check a string is represented by tagged pointer in CoreFoundation.

```c
// $ clang -g main.c -framework CoreFoundation
// $ ./a.out # on macOS ~12
// CFStringCreateWithBytesNoCopy("/") =     0x600003d94780 (tagged = NO)
// $ ./a.out # on macOS 13
// CFStringCreateWithBytesNoCopy("/") = 0xab98bd5bc57e5fed (tagged = YES)

#include <CoreFoundation/CFString.h>
#include <stdio.h>

// Ref: https://github.com/apple-oss-distributions/objc4/blob/8701d5672d3fd3cd817aeb84db1077aafe1a1604/runtime/objc-internal.h#L446-L482
#if (TARGET_OS_OSX || TARGET_OS_MACCATALYST) && __x86_64__
# define _OBJC_TAG_MASK 1ULL
#else
# define _OBJC_TAG_MASK 0x8000000000000000ULL
#endif

#define _objc_isTaggedPointer(x) (((uintptr_t)(x)&_OBJC_TAG_MASK) != 0)

int main(void) {
  long len = 1;
  const char *ptr = "/";
  CFStringRef s = CFStringCreateWithBytesNoCopy(
      kCFAllocatorDefault, (const UInt8 *)ptr, len, kCFStringEncodingUTF8,
      FALSE, kCFAllocatorNull);
  printf("CFStringCreateWithBytesNoCopy(\"%s\") = %18p (tagged = %s)\n", ptr, s,
         _objc_isTaggedPointer(s) ? "YES" : "NO");
  return 0;
}
```


In the above reproducible case in #note-12,
1. `Process.daemon(false, true)` performs `chdir("/")`
2. `Dir.pwd` calls `CFStringCreateWithBytesNoCopy` API with `"/"`
3. `CFStringCreateWithBytesNoCopy` returns `NSTaggedPointerString` because `"/"` is small enough to fit in the tagged string.
4. `CFStringCreateMutableCopy` calls `NSMutableString`'s methods based on the tagged string.

So a reduced minimum repro can be:

```ruby
pid = fork { p File.realpath "/" }
Process.waitpid(pid)
```

To avoid Objective-C runtime crash, we need to warm up Objective-C classes internally used in CFString family API by passing small string before `fork()`.

Here is a patch to address it https://github.com/ruby/ruby/pull/6426



----------------------------------------
Bug #18912: Build failure with Xcode 14 and macOS 13 (Ventura) Beta
https://bugs.ruby-lang.org/issues/18912#change-99302

* Author: hsbt (Hiroshi SHIBATA)
* Status: Assigned
* Priority: Normal
* Assignee: hsbt (Hiroshi SHIBATA)
* Backport: 2.7: REQUIRED, 3.0: REQUIRED, 3.1: REQUIRED
----------------------------------------
Today, I tried to build ruby master with macOS 13 (Ventura) Beta. It breaks the build status caused by Xcode 14 beta changes.

TL;DR: We should add `--without=+,bigdecimal --enable-shared` to the `configure` option.

1. Build failed without `--enable-shared`.

I build ruby master without `--enable-shared` option. I got the following error.

```
(snip)
linking shared-object -test-/arith_seq/extract.bundle
Undefined symbols for architecture arm64:
  "_rb_arithmetic_sequence_extract", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_ary_new_capa", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_ary_store", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_define_singleton_method", referenced from:
      _Init_extract in extract.o
  "_rb_path2class", referenced from:
      _Init_extract in extract.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

@katei says this error affects with `-undefined dynamic_lookup` flags.

2. Build error with bigdecimal

With `--enabled-shared` resolved the first error. But I got the another build failure.

```
compiling bigdecimal.c
In file included from bigdecimal.c:13:
In file included from ./bigdecimal.h:14:
./missing.h:127:1: error: static declaration of 'rb_rational_num' follows non-static declaration
rb_rational_num(VALUE rat)
^
../.././include/ruby/internal/intern/rational.h:128:7: note: previous declaration is here
VALUE rb_rational_num(VALUE rat);
      ^
In file included from bigdecimal.c:13:
In file included from ./bigdecimal.h:14:
(snip)
```

It's affected with `static inline` declaration in missing.h of bigdecimal.

3. test failure with mjit

I could build with `--with-out-ext=+,bigdecimal --enable-share` option. But I also got the test failure with mjit.

```
[215/402] TestMJIT#test_lambda_longjmp = 0.19 s
192) Failure:
TestMJIT#test_lambda_longjmp [/Users/hsbt/Documents/github.com/ruby/ruby/test/ruby/test_mjit.rb:1045]:
Expected 1 times of JIT success, but succeeded 0 times.

script:
"""

fib = lambda do |x|
  return x if x == 0 || x == 1
  fib.call(x-1) + fib.call(x-2)
end
print fib.call(5)

"""


stderr:
"""
Undefined symbols for architecture arm64:
  "_mjit_call_p", referenced from:
      __mjit0 in _ruby_mjit_p39885u0-643ab5.o
      _vm_sendish in _ruby_mjit_p39885u0-643ab5.o
```

I already shared this to @k0kubun .

macOS 13 beta is still development status. I will track this until the official release date.






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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [ruby-core:110076] [Ruby master Bug#18912] Build failure with Xcode 14 and macOS 13 (Ventura) Beta
  2022-07-14  5:40 [ruby-core:109201] [Ruby master Bug#18912] Build failure with macOS 13 (Ventura) Beta hsbt (Hiroshi SHIBATA)
                   ` (13 preceding siblings ...)
  2022-09-23 18:53 ` [ruby-core:110051] " katei (Yuta Saito)
@ 2022-09-26  2:40 ` hsbt (Hiroshi SHIBATA)
  2022-09-26  8:16 ` [ruby-core:110082] " hsbt (Hiroshi SHIBATA)
                   ` (3 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: hsbt (Hiroshi SHIBATA) @ 2022-09-26  2:40 UTC (permalink / raw)
  To: ruby-core

Issue #18912 has been updated by hsbt (Hiroshi SHIBATA).


@katei Thanks for your investigation. I confirmed to pass the failing tests with https://github.com/ruby/ruby/pull/6426 on macOS Ventura beta 8.

----------------------------------------
Bug #18912: Build failure with Xcode 14 and macOS 13 (Ventura) Beta
https://bugs.ruby-lang.org/issues/18912#change-99327

* Author: hsbt (Hiroshi SHIBATA)
* Status: Assigned
* Priority: Normal
* Assignee: hsbt (Hiroshi SHIBATA)
* Backport: 2.7: REQUIRED, 3.0: REQUIRED, 3.1: REQUIRED
----------------------------------------
Today, I tried to build ruby master with macOS 13 (Ventura) Beta. It breaks the build status caused by Xcode 14 beta changes.

TL;DR: We should add `--without=+,bigdecimal --enable-shared` to the `configure` option.

1. Build failed without `--enable-shared`.

I build ruby master without `--enable-shared` option. I got the following error.

```
(snip)
linking shared-object -test-/arith_seq/extract.bundle
Undefined symbols for architecture arm64:
  "_rb_arithmetic_sequence_extract", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_ary_new_capa", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_ary_store", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_define_singleton_method", referenced from:
      _Init_extract in extract.o
  "_rb_path2class", referenced from:
      _Init_extract in extract.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

@katei says this error affects with `-undefined dynamic_lookup` flags.

2. Build error with bigdecimal

With `--enabled-shared` resolved the first error. But I got the another build failure.

```
compiling bigdecimal.c
In file included from bigdecimal.c:13:
In file included from ./bigdecimal.h:14:
./missing.h:127:1: error: static declaration of 'rb_rational_num' follows non-static declaration
rb_rational_num(VALUE rat)
^
../.././include/ruby/internal/intern/rational.h:128:7: note: previous declaration is here
VALUE rb_rational_num(VALUE rat);
      ^
In file included from bigdecimal.c:13:
In file included from ./bigdecimal.h:14:
(snip)
```

It's affected with `static inline` declaration in missing.h of bigdecimal.

3. test failure with mjit

I could build with `--with-out-ext=+,bigdecimal --enable-share` option. But I also got the test failure with mjit.

```
[215/402] TestMJIT#test_lambda_longjmp = 0.19 s
192) Failure:
TestMJIT#test_lambda_longjmp [/Users/hsbt/Documents/github.com/ruby/ruby/test/ruby/test_mjit.rb:1045]:
Expected 1 times of JIT success, but succeeded 0 times.

script:
"""

fib = lambda do |x|
  return x if x == 0 || x == 1
  fib.call(x-1) + fib.call(x-2)
end
print fib.call(5)

"""


stderr:
"""
Undefined symbols for architecture arm64:
  "_mjit_call_p", referenced from:
      __mjit0 in _ruby_mjit_p39885u0-643ab5.o
      _vm_sendish in _ruby_mjit_p39885u0-643ab5.o
```

I already shared this to @k0kubun .

macOS 13 beta is still development status. I will track this until the official release date.






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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [ruby-core:110082] [Ruby master Bug#18912] Build failure with Xcode 14 and macOS 13 (Ventura) Beta
  2022-07-14  5:40 [ruby-core:109201] [Ruby master Bug#18912] Build failure with macOS 13 (Ventura) Beta hsbt (Hiroshi SHIBATA)
                   ` (14 preceding siblings ...)
  2022-09-26  2:40 ` [ruby-core:110076] " hsbt (Hiroshi SHIBATA)
@ 2022-09-26  8:16 ` hsbt (Hiroshi SHIBATA)
  2022-10-01  9:12 ` [ruby-core:110158] " nagachika (Tomoyuki Chikanaga)
                   ` (2 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: hsbt (Hiroshi SHIBATA) @ 2022-09-26  8:16 UTC (permalink / raw)
  To: ruby-core

Issue #18912 has been updated by hsbt (Hiroshi SHIBATA).

Status changed from Assigned to Closed

I created changesets for Ventura and Xcode14 with https://bugs.ruby-lang.org/issues/19005

* https://github.com/ruby/ruby/pull/6440
* https://github.com/ruby/ruby/pull/6441
* https://github.com/ruby/ruby/pull/6442

----------------------------------------
Bug #18912: Build failure with Xcode 14 and macOS 13 (Ventura) Beta
https://bugs.ruby-lang.org/issues/18912#change-99336

* Author: hsbt (Hiroshi SHIBATA)
* Status: Closed
* Priority: Normal
* Assignee: hsbt (Hiroshi SHIBATA)
* Backport: 2.7: REQUIRED, 3.0: REQUIRED, 3.1: REQUIRED
----------------------------------------
Today, I tried to build ruby master with macOS 13 (Ventura) Beta. It breaks the build status caused by Xcode 14 beta changes.

TL;DR: We should add `--without=+,bigdecimal --enable-shared` to the `configure` option.

1. Build failed without `--enable-shared`.

I build ruby master without `--enable-shared` option. I got the following error.

```
(snip)
linking shared-object -test-/arith_seq/extract.bundle
Undefined symbols for architecture arm64:
  "_rb_arithmetic_sequence_extract", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_ary_new_capa", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_ary_store", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_define_singleton_method", referenced from:
      _Init_extract in extract.o
  "_rb_path2class", referenced from:
      _Init_extract in extract.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

@katei says this error affects with `-undefined dynamic_lookup` flags.

2. Build error with bigdecimal

With `--enabled-shared` resolved the first error. But I got the another build failure.

```
compiling bigdecimal.c
In file included from bigdecimal.c:13:
In file included from ./bigdecimal.h:14:
./missing.h:127:1: error: static declaration of 'rb_rational_num' follows non-static declaration
rb_rational_num(VALUE rat)
^
../.././include/ruby/internal/intern/rational.h:128:7: note: previous declaration is here
VALUE rb_rational_num(VALUE rat);
      ^
In file included from bigdecimal.c:13:
In file included from ./bigdecimal.h:14:
(snip)
```

It's affected with `static inline` declaration in missing.h of bigdecimal.

3. test failure with mjit

I could build with `--with-out-ext=+,bigdecimal --enable-share` option. But I also got the test failure with mjit.

```
[215/402] TestMJIT#test_lambda_longjmp = 0.19 s
192) Failure:
TestMJIT#test_lambda_longjmp [/Users/hsbt/Documents/github.com/ruby/ruby/test/ruby/test_mjit.rb:1045]:
Expected 1 times of JIT success, but succeeded 0 times.

script:
"""

fib = lambda do |x|
  return x if x == 0 || x == 1
  fib.call(x-1) + fib.call(x-2)
end
print fib.call(5)

"""


stderr:
"""
Undefined symbols for architecture arm64:
  "_mjit_call_p", referenced from:
      __mjit0 in _ruby_mjit_p39885u0-643ab5.o
      _vm_sendish in _ruby_mjit_p39885u0-643ab5.o
```

I already shared this to @k0kubun .

macOS 13 beta is still development status. I will track this until the official release date.






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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [ruby-core:110158] [Ruby master Bug#18912] Build failure with Xcode 14 and macOS 13 (Ventura) Beta
  2022-07-14  5:40 [ruby-core:109201] [Ruby master Bug#18912] Build failure with macOS 13 (Ventura) Beta hsbt (Hiroshi SHIBATA)
                   ` (15 preceding siblings ...)
  2022-09-26  8:16 ` [ruby-core:110082] " hsbt (Hiroshi SHIBATA)
@ 2022-10-01  9:12 ` nagachika (Tomoyuki Chikanaga)
  2022-10-12  9:21 ` [ruby-core:110272] " hsbt (Hiroshi SHIBATA)
  2022-11-12  4:24 ` [ruby-core:110721] " mrkn (Kenta Murata)
  18 siblings, 0 replies; 20+ messages in thread
From: nagachika (Tomoyuki Chikanaga) @ 2022-10-01  9:12 UTC (permalink / raw)
  To: ruby-core

Issue #18912 has been updated by nagachika (Tomoyuki Chikanaga).

Backport changed from 2.7: REQUIRED, 3.0: REQUIRED, 3.1: REQUIRED to 2.7: REQUIRED, 3.0: REQUIRED, 3.1: DONE

merged https://github.com/ruby/ruby/pull/6440 

----------------------------------------
Bug #18912: Build failure with Xcode 14 and macOS 13 (Ventura) Beta
https://bugs.ruby-lang.org/issues/18912#change-99415

* Author: hsbt (Hiroshi SHIBATA)
* Status: Closed
* Priority: Normal
* Assignee: hsbt (Hiroshi SHIBATA)
* Backport: 2.7: REQUIRED, 3.0: REQUIRED, 3.1: DONE
----------------------------------------
Today, I tried to build ruby master with macOS 13 (Ventura) Beta. It breaks the build status caused by Xcode 14 beta changes.

TL;DR: We should add `--without=+,bigdecimal --enable-shared` to the `configure` option.

1. Build failed without `--enable-shared`.

I build ruby master without `--enable-shared` option. I got the following error.

```
(snip)
linking shared-object -test-/arith_seq/extract.bundle
Undefined symbols for architecture arm64:
  "_rb_arithmetic_sequence_extract", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_ary_new_capa", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_ary_store", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_define_singleton_method", referenced from:
      _Init_extract in extract.o
  "_rb_path2class", referenced from:
      _Init_extract in extract.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

@katei says this error affects with `-undefined dynamic_lookup` flags.

2. Build error with bigdecimal

With `--enabled-shared` resolved the first error. But I got the another build failure.

```
compiling bigdecimal.c
In file included from bigdecimal.c:13:
In file included from ./bigdecimal.h:14:
./missing.h:127:1: error: static declaration of 'rb_rational_num' follows non-static declaration
rb_rational_num(VALUE rat)
^
../.././include/ruby/internal/intern/rational.h:128:7: note: previous declaration is here
VALUE rb_rational_num(VALUE rat);
      ^
In file included from bigdecimal.c:13:
In file included from ./bigdecimal.h:14:
(snip)
```

It's affected with `static inline` declaration in missing.h of bigdecimal.

3. test failure with mjit

I could build with `--with-out-ext=+,bigdecimal --enable-share` option. But I also got the test failure with mjit.

```
[215/402] TestMJIT#test_lambda_longjmp = 0.19 s
192) Failure:
TestMJIT#test_lambda_longjmp [/Users/hsbt/Documents/github.com/ruby/ruby/test/ruby/test_mjit.rb:1045]:
Expected 1 times of JIT success, but succeeded 0 times.

script:
"""

fib = lambda do |x|
  return x if x == 0 || x == 1
  fib.call(x-1) + fib.call(x-2)
end
print fib.call(5)

"""


stderr:
"""
Undefined symbols for architecture arm64:
  "_mjit_call_p", referenced from:
      __mjit0 in _ruby_mjit_p39885u0-643ab5.o
      _vm_sendish in _ruby_mjit_p39885u0-643ab5.o
```

I already shared this to @k0kubun .

macOS 13 beta is still development status. I will track this until the official release date.






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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [ruby-core:110272] [Ruby master Bug#18912] Build failure with Xcode 14 and macOS 13 (Ventura) Beta
  2022-07-14  5:40 [ruby-core:109201] [Ruby master Bug#18912] Build failure with macOS 13 (Ventura) Beta hsbt (Hiroshi SHIBATA)
                   ` (16 preceding siblings ...)
  2022-10-01  9:12 ` [ruby-core:110158] " nagachika (Tomoyuki Chikanaga)
@ 2022-10-12  9:21 ` hsbt (Hiroshi SHIBATA)
  2022-11-12  4:24 ` [ruby-core:110721] " mrkn (Kenta Murata)
  18 siblings, 0 replies; 20+ messages in thread
From: hsbt (Hiroshi SHIBATA) @ 2022-10-12  9:21 UTC (permalink / raw)
  To: ruby-core

Issue #18912 has been updated by hsbt (Hiroshi SHIBATA).

Backport changed from 2.7: REQUIRED, 3.0: REQUIRED, 3.1: DONE to 2.7: DONE, 3.0: DONE, 3.1: DONE

https://github.com/ruby/ruby/pull/6297 and https://github.com/ruby/ruby/pull/6298 have been merged.

----------------------------------------
Bug #18912: Build failure with Xcode 14 and macOS 13 (Ventura) Beta
https://bugs.ruby-lang.org/issues/18912#change-99558

* Author: hsbt (Hiroshi SHIBATA)
* Status: Closed
* Priority: Normal
* Assignee: hsbt (Hiroshi SHIBATA)
* Backport: 2.7: DONE, 3.0: DONE, 3.1: DONE
----------------------------------------
Today, I tried to build ruby master with macOS 13 (Ventura) Beta. It breaks the build status caused by Xcode 14 beta changes.

TL;DR: We should add `--without=+,bigdecimal --enable-shared` to the `configure` option.

1. Build failed without `--enable-shared`.

I build ruby master without `--enable-shared` option. I got the following error.

```
(snip)
linking shared-object -test-/arith_seq/extract.bundle
Undefined symbols for architecture arm64:
  "_rb_arithmetic_sequence_extract", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_ary_new_capa", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_ary_store", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_define_singleton_method", referenced from:
      _Init_extract in extract.o
  "_rb_path2class", referenced from:
      _Init_extract in extract.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

@katei says this error affects with `-undefined dynamic_lookup` flags.

2. Build error with bigdecimal

With `--enabled-shared` resolved the first error. But I got the another build failure.

```
compiling bigdecimal.c
In file included from bigdecimal.c:13:
In file included from ./bigdecimal.h:14:
./missing.h:127:1: error: static declaration of 'rb_rational_num' follows non-static declaration
rb_rational_num(VALUE rat)
^
../.././include/ruby/internal/intern/rational.h:128:7: note: previous declaration is here
VALUE rb_rational_num(VALUE rat);
      ^
In file included from bigdecimal.c:13:
In file included from ./bigdecimal.h:14:
(snip)
```

It's affected with `static inline` declaration in missing.h of bigdecimal.

3. test failure with mjit

I could build with `--with-out-ext=+,bigdecimal --enable-share` option. But I also got the test failure with mjit.

```
[215/402] TestMJIT#test_lambda_longjmp = 0.19 s
192) Failure:
TestMJIT#test_lambda_longjmp [/Users/hsbt/Documents/github.com/ruby/ruby/test/ruby/test_mjit.rb:1045]:
Expected 1 times of JIT success, but succeeded 0 times.

script:
"""

fib = lambda do |x|
  return x if x == 0 || x == 1
  fib.call(x-1) + fib.call(x-2)
end
print fib.call(5)

"""


stderr:
"""
Undefined symbols for architecture arm64:
  "_mjit_call_p", referenced from:
      __mjit0 in _ruby_mjit_p39885u0-643ab5.o
      _vm_sendish in _ruby_mjit_p39885u0-643ab5.o
```

I already shared this to @k0kubun .

macOS 13 beta is still development status. I will track this until the official release date.






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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [ruby-core:110721] [Ruby master Bug#18912] Build failure with Xcode 14 and macOS 13 (Ventura) Beta
  2022-07-14  5:40 [ruby-core:109201] [Ruby master Bug#18912] Build failure with macOS 13 (Ventura) Beta hsbt (Hiroshi SHIBATA)
                   ` (17 preceding siblings ...)
  2022-10-12  9:21 ` [ruby-core:110272] " hsbt (Hiroshi SHIBATA)
@ 2022-11-12  4:24 ` mrkn (Kenta Murata)
  18 siblings, 0 replies; 20+ messages in thread
From: mrkn (Kenta Murata) @ 2022-11-12  4:24 UTC (permalink / raw)
  To: ruby-core

Issue #18912 has been updated by mrkn (Kenta Murata).


I tried to investigate bigdecimal's build problem on my MacBook Air.  But, unfortunately, I couldn't.  I used Xcode 14.0 on Ventura.  I first tried with the following configure options: `--enable-shared --with-openssl-dir=$(brew --prefix openssl@1.1) --with-libyaml-dir=$(brew --prefix libyaml)`.  Then I tried just `rbenv install 3.1.2`.  In both cases, these build succeeded.

Could you please give me `mkmf.log` in ext/bigdecimal directory?

----------------------------------------
Bug #18912: Build failure with Xcode 14 and macOS 13 (Ventura) Beta
https://bugs.ruby-lang.org/issues/18912#change-100059

* Author: hsbt (Hiroshi SHIBATA)
* Status: Closed
* Priority: Normal
* Assignee: hsbt (Hiroshi SHIBATA)
* Backport: 2.7: DONE, 3.0: DONE, 3.1: DONE
----------------------------------------
TL;DR: We fixed this issue at Ruby 2.7-3.1 and master branch. But the stable versions are not released yet.

* Option 1: We strongly recommend to not upgrade Xcode 14 and its toolchains for macOS 12(Monterey) users. If you already update Xcode 14, you remove them with `sudo rm -rf /Library/Developer/CommandLineTools` and install Xcode 13.x or toolchains from https://developer.apple.com/download/all
* Option 2: macOS 13 (Ventura) couldn't install Xcode13. We should add `--without=+,bigdecimal --enable-shared` to the `configure` option.

----

Today, I tried to build ruby master with macOS 13 (Ventura) Beta. It breaks the build status caused by Xcode 14 beta changes.

1. Build failed without `--enable-shared`.

I build ruby master without `--enable-shared` option. I got the following error.

```
(snip)
linking shared-object -test-/arith_seq/extract.bundle
Undefined symbols for architecture arm64:
  "_rb_arithmetic_sequence_extract", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_ary_new_capa", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_ary_store", referenced from:
      _arith_seq_s_extract in extract.o
  "_rb_define_singleton_method", referenced from:
      _Init_extract in extract.o
  "_rb_path2class", referenced from:
      _Init_extract in extract.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

@katei says this error affects with `-undefined dynamic_lookup` flags.

2. Build error with bigdecimal

With `--enabled-shared` resolved the first error. But I got the another build failure.

```
compiling bigdecimal.c
In file included from bigdecimal.c:13:
In file included from ./bigdecimal.h:14:
./missing.h:127:1: error: static declaration of 'rb_rational_num' follows non-static declaration
rb_rational_num(VALUE rat)
^
../.././include/ruby/internal/intern/rational.h:128:7: note: previous declaration is here
VALUE rb_rational_num(VALUE rat);
      ^
In file included from bigdecimal.c:13:
In file included from ./bigdecimal.h:14:
(snip)
```

It's affected with `static inline` declaration in missing.h of bigdecimal.

3. test failure with mjit

I could build with `--with-out-ext=+,bigdecimal --enable-share` option. But I also got the test failure with mjit.

```
[215/402] TestMJIT#test_lambda_longjmp = 0.19 s
192) Failure:
TestMJIT#test_lambda_longjmp [/Users/hsbt/Documents/github.com/ruby/ruby/test/ruby/test_mjit.rb:1045]:
Expected 1 times of JIT success, but succeeded 0 times.

script:
"""

fib = lambda do |x|
  return x if x == 0 || x == 1
  fib.call(x-1) + fib.call(x-2)
end
print fib.call(5)

"""


stderr:
"""
Undefined symbols for architecture arm64:
  "_mjit_call_p", referenced from:
      __mjit0 in _ruby_mjit_p39885u0-643ab5.o
      _vm_sendish in _ruby_mjit_p39885u0-643ab5.o
```

I already shared this to @k0kubun .

macOS 13 beta is still development status. I will track this until the official release date.






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

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2022-11-12  4:24 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-14  5:40 [ruby-core:109201] [Ruby master Bug#18912] Build failure with macOS 13 (Ventura) Beta hsbt (Hiroshi SHIBATA)
2022-07-19 15:44 ` [ruby-core:109248] " alanwu (Alan Wu)
2022-07-28  8:32 ` [ruby-core:109350] " hsbt (Hiroshi SHIBATA)
2022-07-28  9:04 ` [ruby-core:109351] " katei (Yuta Saito)
2022-07-28  9:43 ` [ruby-core:109352] " hsbt (Hiroshi SHIBATA)
2022-07-28 12:01 ` [ruby-core:109355] " alanwu (Alan Wu)
2022-08-01  4:24 ` [ruby-core:109398] " hsbt (Hiroshi SHIBATA)
2022-08-01  6:23 ` [ruby-core:109399] " hsbt (Hiroshi SHIBATA)
2022-08-05  3:40 ` [ruby-core:109424] " hsbt (Hiroshi SHIBATA)
2022-08-23 10:09 ` [ruby-core:109640] " hsbt (Hiroshi SHIBATA)
2022-09-17  7:47 ` [ruby-core:109936] [Ruby master Bug#18912] Build failure with Xcode 14 and " hsbt (Hiroshi SHIBATA)
2022-09-17 11:29 ` [ruby-core:109939] " katei (Yuta Saito)
2022-09-18  2:47 ` [ruby-core:109943] " nobu (Nobuyoshi Nakada)
2022-09-19  3:32 ` [ruby-core:109954] " nobu (Nobuyoshi Nakada)
2022-09-23 18:53 ` [ruby-core:110051] " katei (Yuta Saito)
2022-09-26  2:40 ` [ruby-core:110076] " hsbt (Hiroshi SHIBATA)
2022-09-26  8:16 ` [ruby-core:110082] " hsbt (Hiroshi SHIBATA)
2022-10-01  9:12 ` [ruby-core:110158] " nagachika (Tomoyuki Chikanaga)
2022-10-12  9:21 ` [ruby-core:110272] " hsbt (Hiroshi SHIBATA)
2022-11-12  4:24 ` [ruby-core:110721] " mrkn (Kenta Murata)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).