Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Can't use truffleruby 23.1.0 on MacOS with XCode 15 #3283

Closed
HoneyryderChuck opened this issue Oct 3, 2023 · 24 comments
Closed

Can't use truffleruby 23.1.0 on MacOS with XCode 15 #3283

HoneyryderChuck opened this issue Oct 3, 2023 · 24 comments
Assignees
Labels

Comments

@HoneyryderChuck
Copy link
Contributor

HoneyryderChuck commented Oct 3, 2023

I've installed truffleruby 23.1.0 using homebrew. All went well, until I use openssl:

> ruby -e "require 'openssl'"


<internal:core> core/kernel.rb:260:in `require': you may need to install the system OpenSSL library libssl - see https://github.com/oracle/truffleruby/blob/master/doc/user/installing-libssl.md (dlopen(/user/.rubies/truffleruby-23.1.0/lib/mri/openssl.bundle, 0x0002): Library not loaded: @rpath/libgraalvm-llvm.1.dylib (RuntimeError)
  Referenced from: <D3AD165B-0AC8-3019-836C-9D3781CEDAA8> /user/.rubies/truffleruby-23.1.0/lib/mri/openssl.bundle
  Reason: tried: '/usr/local/opt/openssl@3/lib/libgraalvm-llvm.1.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/opt/openssl@3/lib/libgraalvm-llvm.1.dylib' (no such file), '/usr/local/opt/openssl@3/lib/libgraalvm-llvm.1.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/opt/openssl@3/lib/libgraalvm-llvm.1.dylib' (no such file), '/usr/local/lib/libgraalvm-llvm.1.dylib' (no such file), '/usr/lib/libgraalvm-llvm.1.dylib' (no such file, not in dyld cache))
        from /user/.rubies/truffleruby-23.1.0/lib/mri/openssl.rb:13:in `<top (required)>'
        from <internal:core> core/kernel.rb:260:in `require'
        from -e:1:in `<main>'

It seems that truffleruby 23 requires the installation of the graalvm, where previous ones didn't? If so, shouldn't it be declared as a dependency in the formula, and installed accordingly? Or is this smth else? (I've used OPENSSL_PREFIX against locally installed openssl@3 and @1.1).

@eregon
Copy link
Member

eregon commented Oct 3, 2023

I am not aware of any truffleruby Homebrew formula, could you point me to it?
i.e. there is no truffleruby.rb at https://github.com/Homebrew/homebrew-core/tree/master/Formula/t

It sounds like whatever tool installed truffleruby did not run the post install hook but that's necessary.
Although the error message is weird, it sounds like it's trying to load openssl.bundle natively and not with Sulong or so.

libgraalvm-llvm.1.dylib is provided in the truffleruby standalone, there is no need to install GraalVM.

The README has details for various supported ways to install TruffleRuby.

@HoneyryderChuck
Copy link
Contributor Author

I see, so you're saying this may be a ruby-install issue? Will cross-post.

@eregon
Copy link
Member

eregon commented Oct 3, 2023

Ah you used ruby-install, I thought from the description you used Homebrew directly to install truffleruby.
ruby-install should work, we'll try to reproduce.

@eregon
Copy link
Member

eregon commented Oct 3, 2023

I cannot reproduce this on Linux.
@andrykonchin Could you try to repro this on darwin-amd64 with ruby-install truffleruby -r ~/tmp? (using ruby-install 0.9.2 or master)

@eregon
Copy link
Member

eregon commented Oct 3, 2023

@HoneyryderChuck To help us investigate, could you:

rm -rf /user/.rubies/truffleruby-23.1.0
ruby-install truffleruby

And post the full output here?

@andrykonchin
Copy link
Member

andrykonchin commented Oct 4, 2023

I cannot reproduce the issue on macOS (i9):

$ ruby-install -V
ruby-install: 0.9.2

$ ruby-install truffleruby -r ~/tmp
>>> Updating truffleruby versions ...
>>> Installing truffleruby 23.1.0 into /Users/andrykonchin/tmp/truffleruby-23.1.0 ...
>>> Installing dependencies for truffleruby 23.1.0 ...
Warning: openssl@1.1 1.1.1v is already installed and up-to-date.
To reinstall 1.1.1v, run:
  brew reinstall openssl@1.1
Warning: libyaml 0.2.5 is already installed and up-to-date.
To reinstall 0.2.5, run:
  brew reinstall libyaml
>>> Downloading https://github.com/oracle/truffleruby/releases/download/graal-23.1.0/truffleruby-23.1.0-macos-amd64.tar.gz into /Users/andrykonchin/src ...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  215M  100  215M    0     0  8929k      0  0:00:24  0:00:24 --:--:-- 9265k
>>> Verifying truffleruby-23.1.0-macos-amd64.tar.gz ...
>>> Extracting truffleruby-23.1.0-macos-amd64.tar.gz to /Users/andrykonchin/src/truffleruby-23.1.0-macos-amd64 ...
>>> Installing truffleruby 23.1.0 ...
>>> Running truffleruby post-install hook ...
Recompiling the OpenSSL C extension (against the installed libssl)
checking for rb_io_maybe_wait(0, Qnil, Qnil, Qnil) in ruby/io.h... yes
checking for t_open() in -lnsl... no
checking for socket() in -lsocket... no
checking for openssl/ssl.h... yes
checking for CRYPTO_malloc() in -lcrypto... yes
checking for SSL_new() in -lssl... yes
checking for LIBRESSL_VERSION_NUMBER in openssl/opensslv.h... no
checking for OpenSSL version >= 1.0.2... yes
checking for RAND_egd() in openssl/rand.h... no
checking for ENGINE_load_dynamic() in openssl/engine.h... yes
checking for ENGINE_load_4758cca() in openssl/engine.h... no
checking for ENGINE_load_aep() in openssl/engine.h... no
checking for ENGINE_load_atalla() in openssl/engine.h... no
checking for ENGINE_load_chil() in openssl/engine.h... no
checking for ENGINE_load_cswift() in openssl/engine.h... no
checking for ENGINE_load_nuron() in openssl/engine.h... no
checking for ENGINE_load_sureware() in openssl/engine.h... no
checking for ENGINE_load_ubsec() in openssl/engine.h... no
checking for ENGINE_load_padlock() in openssl/engine.h... no
checking for ENGINE_load_capi() in openssl/engine.h... no
checking for ENGINE_load_gmp() in openssl/engine.h... no
checking for ENGINE_load_gost() in openssl/engine.h... no
checking for ENGINE_load_cryptodev() in openssl/engine.h... yes
checking for SSL.ctx in openssl/ssl.h... no
checking for EVP_MD_CTX_new() in openssl/evp.h... yes
checking for EVP_MD_CTX_free(NULL) in openssl/evp.h... yes
checking for EVP_MD_CTX_pkey_ctx(NULL) in openssl/evp.h... yes
checking for X509_STORE_get_ex_data(NULL, 0) in openssl/x509.h... yes
checking for X509_STORE_set_ex_data(NULL, 0, NULL) in openssl/x509.h... yes
checking for X509_STORE_get_ex_new_index(0, NULL, NULL, NULL, NULL) in openssl/x509.h... yes
checking for X509_CRL_get0_signature(NULL, NULL, NULL) in openssl/x509.h... yes
checking for X509_REQ_get0_signature(NULL, NULL, NULL) in openssl/x509.h... yes
checking for X509_REVOKED_get0_serialNumber(NULL) in openssl/x509.h... yes
checking for X509_REVOKED_get0_revocationDate(NULL) in openssl/x509.h... yes
checking for X509_get0_tbs_sigalg(NULL) in openssl/x509.h... yes
checking for X509_STORE_CTX_get0_untrusted(NULL) in openssl/x509.h... yes
checking for X509_STORE_CTX_get0_cert(NULL) in openssl/x509.h... yes
checking for X509_STORE_CTX_get0_chain(NULL) in openssl/x509.h... yes
checking for OCSP_SINGLERESP_get0_id(NULL) in openssl/ocsp.h... yes
checking for SSL_CTX_get_ciphers(NULL) in openssl/ssl.h... yes
checking for X509_up_ref(NULL) in openssl/x509.h... yes
checking for X509_CRL_up_ref(NULL) in openssl/x509.h... yes
checking for X509_STORE_up_ref(NULL) in openssl/x509.h... yes
checking for SSL_SESSION_up_ref(NULL) in openssl/ssl.h... yes
checking for EVP_PKEY_up_ref(NULL) in openssl/evp.h... yes
checking for SSL_CTX_set_min_proto_version(NULL, 0) in openssl/ssl.h... yes
checking for SSL_CTX_get_security_level(NULL) in openssl/ssl.h... yes
checking for X509_get0_notBefore(NULL) in openssl/x509.h... yes
checking for SSL_SESSION_get_protocol_version(NULL) in openssl/ssl.h... yes
checking for TS_STATUS_INFO_get0_status(NULL) in openssl/ts.h... yes
checking for TS_STATUS_INFO_get0_text(NULL) in openssl/ts.h... yes
checking for TS_STATUS_INFO_get0_failure_info(NULL) in openssl/ts.h... yes
checking for TS_VERIFY_CTS_set_certs(NULL, NULL) in openssl/ts.h... yes
checking for TS_VERIFY_CTX_set_store(NULL, NULL) in openssl/ts.h... yes
checking for TS_VERIFY_CTX_add_flags(NULL, 0) in openssl/ts.h... yes
checking for TS_RESP_CTX_set_time_cb(NULL, NULL, NULL) in openssl/ts.h... yes
checking for EVP_PBE_scrypt("", 0, (unsigned char *)"", 0, 0, 0, 0, 0, NULL, 0) in openssl/evp.h... yes
checking for SSL_CTX_set_post_handshake_auth(NULL, 0) in openssl/ssl.h... yes
checking for EVP_PKEY_check(NULL) in openssl/evp.h... yes
checking for EVP_PKEY_new_raw_private_key(0, NULL, (unsigned char *)"", 0) in openssl/evp.h... yes
checking for SSL_CTX_set_ciphersuites(NULL, "") in openssl/ssl.h... yes
checking for SSL_set0_tmp_dh_pkey(NULL, NULL) in openssl/ssl.h... no
checking for ERR_get_error_all(NULL, NULL, NULL, NULL, NULL) in openssl/err.h... no
checking for TS_VERIFY_CTX_set_certs(NULL, NULL) in openssl/ts.h... no
checking for SSL_CTX_load_verify_file(NULL, "") in openssl/ssl.h... no
checking for BN_check_prime(NULL, NULL, NULL) in openssl/bn.h... no
checking for EVP_MD_CTX_get0_md(NULL) in openssl/evp.h... no
checking for EVP_MD_CTX_get_pkey_ctx(NULL) in openssl/evp.h... no
checking for EVP_PKEY_eq(NULL, NULL) in openssl/evp.h... no
checking for EVP_PKEY_dup(NULL) in openssl/evp.h... no
creating extconf.h
creating Makefile
compiling openssl_missing.c
compiling ossl_asn1.c
compiling ossl_bio.c
compiling ossl_bn.c
compiling ossl_config.c
compiling ossl_cipher.c
compiling ossl.c
compiling ossl_kdf.c
compiling ossl_digest.c
compiling ossl_engine.c
compiling ossl_hmac.c
compiling ossl_pkcs12.c
compiling ossl_pkey.c
compiling ossl_ns_spki.c
compiling ossl_pkcs7.c
compiling ossl_ocsp.c
compiling ossl_pkey_dh.c
compiling ossl_pkey_dsa.c
compiling ossl_pkey_ec.c
compiling ossl_pkey_rsa.c
compiling ossl_rand.c
compiling ossl_ssl.c
compiling ossl_ssl_session.c
compiling ossl_ts.c
compiling ossl_x509.c
compiling ossl_x509attr.c
compiling ossl_x509cert.c
compiling ossl_x509crl.c
compiling ossl_x509ext.c
compiling ossl_x509name.c
compiling ossl_x509req.c
compiling ossl_x509revoked.c
compiling ossl_x509store.c
linking shared-object openssl.bundle

Recompiling the Psych C extension (against the installed libyaml)
checking for yaml.h... yes
checking for yaml_get_version() in -lyaml... yes
creating Makefile
compiling psych.c
compiling psych_emitter.c
compiling psych_parser.c
compiling psych_to_ruby.c
compiling psych_yaml_tree.c
linking shared-object psych.bundle

TruffleRuby was successfully installed in /Users/andrykonchin/tmp/truffleruby-23.1.0
>>> Successfully installed truffleruby 23.1.0 into /Users/andrykonchin/tmp/truffleruby-23.1.0

and then

$ bin/ruby -v -e "require 'openssl'; puts 'Hello'"
truffleruby 23.1.0, like ruby 3.2.2, Oracle GraalVM Native [x86_64-darwin]
Hello

@HoneyryderChuck
Copy link
Contributor Author

I've tried this again:

➜  ~ ruby-install -V
ruby-install: 0.9.2
➜  ~ ruby-install truffleruby -r ~/tmp
>>> Updating truffleruby versions ...
>>> Installing truffleruby 23.1.0 into /user/tmp/truffleruby-23.1.0 ...
>>> Installing dependencies for truffleruby 23.1.0 ...
Running `brew update --auto-update`...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> New Formulae
bozohttpd                         dezoomify-rs                      python-gdbm@3.12                  python-setuptools                 python-tk@3.12                    python@3.12

You have 50 outdated formulae installed.

Warning: openssl@1.1 1.1.1w is already installed and up-to-date.
To reinstall 1.1.1w, run:
  brew reinstall openssl@1.1
Warning: libyaml 0.2.5 is already installed and up-to-date.
To reinstall 0.2.5, run:
  brew reinstall libyaml
>>> Downloading https://github.com/oracle/truffleruby/releases/download/graal-23.1.0/truffleruby-23.1.0-macos-amd64.tar.gz into /user/src ...
>>> Verifying truffleruby-23.1.0-macos-amd64.tar.gz ...
>>> Extracting truffleruby-23.1.0-macos-amd64.tar.gz to /user/src/truffleruby-23.1.0-macos-amd64 ...
>>> Installing truffleruby 23.1.0 ...
>>> Running truffleruby post-install hook ...
Recompiling the OpenSSL C extension (against the installed libssl)
checking for rb_io_maybe_wait(0, Qnil, Qnil, Qnil) in ruby/io.h... yes
checking for t_open() in -lnsl... no
checking for socket() in -lsocket... no
checking for openssl/ssl.h... yes
checking for CRYPTO_malloc() in -lcrypto... yes
checking for SSL_new() in -lssl... yes
checking for LIBRESSL_VERSION_NUMBER in openssl/opensslv.h... no
checking for OpenSSL version >= 1.0.2... yes
checking for RAND_egd() in openssl/rand.h... no
checking for ENGINE_load_dynamic() in openssl/engine.h... yes
checking for ENGINE_load_4758cca() in openssl/engine.h... no
checking for ENGINE_load_aep() in openssl/engine.h... no
checking for ENGINE_load_atalla() in openssl/engine.h... no
checking for ENGINE_load_chil() in openssl/engine.h... no
checking for ENGINE_load_cswift() in openssl/engine.h... no
checking for ENGINE_load_nuron() in openssl/engine.h... no
checking for ENGINE_load_sureware() in openssl/engine.h... no
checking for ENGINE_load_ubsec() in openssl/engine.h... no
checking for ENGINE_load_padlock() in openssl/engine.h... no
checking for ENGINE_load_capi() in openssl/engine.h... no
checking for ENGINE_load_gmp() in openssl/engine.h... no
checking for ENGINE_load_gost() in openssl/engine.h... no
checking for ENGINE_load_cryptodev() in openssl/engine.h... yes
checking for SSL.ctx in openssl/ssl.h... no
checking for EVP_MD_CTX_new() in openssl/evp.h... yes
checking for EVP_MD_CTX_free(NULL) in openssl/evp.h... yes
checking for EVP_MD_CTX_pkey_ctx(NULL) in openssl/evp.h... yes
checking for X509_STORE_get_ex_data(NULL, 0) in openssl/x509.h... yes
checking for X509_STORE_set_ex_data(NULL, 0, NULL) in openssl/x509.h... yes
checking for X509_STORE_get_ex_new_index(0, NULL, NULL, NULL, NULL) in openssl/x509.h... yes
checking for X509_CRL_get0_signature(NULL, NULL, NULL) in openssl/x509.h... yes
checking for X509_REQ_get0_signature(NULL, NULL, NULL) in openssl/x509.h... yes
checking for X509_REVOKED_get0_serialNumber(NULL) in openssl/x509.h... yes
checking for X509_REVOKED_get0_revocationDate(NULL) in openssl/x509.h... yes
checking for X509_get0_tbs_sigalg(NULL) in openssl/x509.h... yes
checking for X509_STORE_CTX_get0_untrusted(NULL) in openssl/x509.h... yes
checking for X509_STORE_CTX_get0_cert(NULL) in openssl/x509.h... yes
checking for X509_STORE_CTX_get0_chain(NULL) in openssl/x509.h... yes
checking for OCSP_SINGLERESP_get0_id(NULL) in openssl/ocsp.h... yes
checking for SSL_CTX_get_ciphers(NULL) in openssl/ssl.h... yes
checking for X509_up_ref(NULL) in openssl/x509.h... yes
checking for X509_CRL_up_ref(NULL) in openssl/x509.h... yes
checking for X509_STORE_up_ref(NULL) in openssl/x509.h... yes
checking for SSL_SESSION_up_ref(NULL) in openssl/ssl.h... yes
checking for EVP_PKEY_up_ref(NULL) in openssl/evp.h... yes
checking for SSL_CTX_set_min_proto_version(NULL, 0) in openssl/ssl.h... yes
checking for SSL_CTX_get_security_level(NULL) in openssl/ssl.h... yes
checking for X509_get0_notBefore(NULL) in openssl/x509.h... yes
checking for SSL_SESSION_get_protocol_version(NULL) in openssl/ssl.h... yes
checking for TS_STATUS_INFO_get0_status(NULL) in openssl/ts.h... yes
checking for TS_STATUS_INFO_get0_text(NULL) in openssl/ts.h... yes
checking for TS_STATUS_INFO_get0_failure_info(NULL) in openssl/ts.h... yes
checking for TS_VERIFY_CTS_set_certs(NULL, NULL) in openssl/ts.h... yes
checking for TS_VERIFY_CTX_set_store(NULL, NULL) in openssl/ts.h... yes
checking for TS_VERIFY_CTX_add_flags(NULL, 0) in openssl/ts.h... yes
checking for TS_RESP_CTX_set_time_cb(NULL, NULL, NULL) in openssl/ts.h... yes
checking for EVP_PBE_scrypt("", 0, (unsigned char *)"", 0, 0, 0, 0, 0, NULL, 0) in openssl/evp.h... yes
checking for SSL_CTX_set_post_handshake_auth(NULL, 0) in openssl/ssl.h... yes
checking for EVP_PKEY_check(NULL) in openssl/evp.h... yes
checking for EVP_PKEY_new_raw_private_key(0, NULL, (unsigned char *)"", 0) in openssl/evp.h... yes
checking for SSL_CTX_set_ciphersuites(NULL, "") in openssl/ssl.h... yes
checking for SSL_set0_tmp_dh_pkey(NULL, NULL) in openssl/ssl.h... no
checking for ERR_get_error_all(NULL, NULL, NULL, NULL, NULL) in openssl/err.h... no
checking for TS_VERIFY_CTX_set_certs(NULL, NULL) in openssl/ts.h... no
checking for SSL_CTX_load_verify_file(NULL, "") in openssl/ssl.h... no
checking for BN_check_prime(NULL, NULL, NULL) in openssl/bn.h... no
checking for EVP_MD_CTX_get0_md(NULL) in openssl/evp.h... no
checking for EVP_MD_CTX_get_pkey_ctx(NULL) in openssl/evp.h... no
checking for EVP_PKEY_eq(NULL, NULL) in openssl/evp.h... no
checking for EVP_PKEY_dup(NULL) in openssl/evp.h... no
creating extconf.h
creating Makefile
compiling openssl_missing.c
compiling ossl.c
compiling ossl_asn1.c
compiling ossl_bio.c
compiling ossl_bn.c
compiling ossl_cipher.c
compiling ossl_config.c
compiling ossl_digest.c
compiling ossl_engine.c
compiling ossl_hmac.c
compiling ossl_kdf.c
compiling ossl_ns_spki.c
compiling ossl_ocsp.c
compiling ossl_pkcs12.c
compiling ossl_pkcs7.c
compiling ossl_pkey.c
compiling ossl_pkey_dh.c
compiling ossl_pkey_dsa.c
compiling ossl_pkey_ec.c
compiling ossl_pkey_rsa.c
compiling ossl_rand.c
compiling ossl_ssl.c
compiling ossl_ssl_session.c
compiling ossl_ts.c
compiling ossl_x509.c
compiling ossl_x509attr.c
compiling ossl_x509cert.c
compiling ossl_x509crl.c
compiling ossl_x509ext.c
compiling ossl_x509name.c
compiling ossl_x509req.c
compiling ossl_x509revoked.c
compiling ossl_x509store.c
linking shared-object openssl.bundle
-macosx_version_min has been renamed to -macos_version_min
ld: warning: -multiply_defined is obsolete
-macosx_version_min has been renamed to -macos_version_min
ld: warning: -multiply_defined is obsolete
-macosx_version_min has been renamed to -macos_version_min
ld: warning: -multiply_defined is obsolete
-macosx_version_min has been renamed to -macos_version_min
ld: warning: -multiply_defined is obsolete

Recompiling the Psych C extension (against the installed libyaml)
checking for yaml.h... yes
checking for yaml_get_version() in -lyaml... yes
creating Makefile
compiling psych.c
compiling psych_emitter.c
compiling psych_parser.c
compiling psych_to_ruby.c
compiling psych_yaml_tree.c
linking shared-object psych.bundle
-macosx_version_min has been renamed to -macos_version_min
ld: warning: -multiply_defined is obsolete
-macosx_version_min has been renamed to -macos_version_min
ld: warning: -multiply_defined is obsolete
-macosx_version_min has been renamed to -macos_version_min
ld: warning: -multiply_defined is obsolete
-macosx_version_min has been renamed to -macos_version_min
ld: warning: -multiply_defined is obsolete

TruffleRuby was successfully installed in /user/tmp/truffleruby-23.1.0
>>> Successfully installed truffleruby 23.1.0 into /user/tmp/truffleruby-23.1.0
➜  ~ /user/tmp/truffleruby-23.1.0/bin/ruby -v
truffleruby 23.1.0, like ruby 3.2.2, Oracle GraalVM Native [x86_64-darwin]
➜  ~ /user/tmp/truffleruby-23.1.0/bin/ruby -v -e "require 'openssl'; puts 'Hello'"
truffleruby 23.1.0, like ruby 3.2.2, Oracle GraalVM Native [x86_64-darwin]
<internal:core> core/kernel.rb:260:in `require': you may need to install the system OpenSSL library libssl - see https://github.com/oracle/truffleruby/blob/master/doc/user/installing-libssl.md (dlopen(/user/tmp/truffleruby-23.1.0/lib/mri/openssl.bundle, 0x0002): Library not loaded: @rpath/libgraalvm-llvm.1.dylib (RuntimeError)
  Referenced from: <435AA929-B588-3E9B-9E9B-F2C5F858EC29> /user/tmp/truffleruby-23.1.0/lib/mri/openssl.bundle
  Reason: tried: '/usr/local/opt/openssl@1.1/lib/libgraalvm-llvm.1.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/opt/openssl@1.1/lib/libgraalvm-llvm.1.dylib' (no such file), '/usr/local/opt/openssl@1.1/lib/libgraalvm-llvm.1.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/opt/openssl@1.1/lib/libgraalvm-llvm.1.dylib' (no such file), '/usr/local/lib/libgraalvm-llvm.1.dylib' (no such file), '/usr/lib/libgraalvm-llvm.1.dylib' (no such file, not in dyld cache))
	from /user/tmp/truffleruby-23.1.0/lib/mri/openssl.rb:13:in `<top (required)>'
	from <internal:core> core/kernel.rb:260:in `require'
	from -e:1:in `<main>'
➜  ~

one thing to note about my environment is that I have many installations of openssl via homebrew, besides the outdated system one

brew list | grep openssl
openssl@1.1
openssl@3

where openssl@3 is set via brew --prefix .Not sure if the truffleruby installation script is bypassing this(?).

@eregon
Copy link
Member

eregon commented Oct 4, 2023

Could you write here your macOS version and XCode version? It seems like those differ from @andrykonchin and our CI and might be the cause of this issue.
Notably those warnings sound like the GraalVM LLVM Toolchain and the macOS system linker are far apart:

-macosx_version_min has been renamed to -macos_version_min
ld: warning: -multiply_defined is obsolete
-macosx_version_min has been renamed to -macos_version_min
ld: warning: -multiply_defined is obsolete
-macosx_version_min has been renamed to -macos_version_min
ld: warning: -multiply_defined is obsolete
-macosx_version_min has been renamed to -macos_version_min
ld: warning: -multiply_defined is obsolete

@rschatz @lewurm maybe you have seen this before?

(Apple is unfortunately known for making incompatible changes in their C toolchain almost every macOS major release)

➜  ~ /user/tmp/truffleruby-23.1.0/bin/ruby -v -e "require 'openssl'; puts 'Hello'"
truffleruby 23.1.0, like ruby 3.2.2, Oracle GraalVM Native [x86_64-darwin]
<internal:core> core/kernel.rb:260:in `require': you may need to install the system OpenSSL library libssl - see https://github.com/oracle/truffleruby/blob/master/doc/user/installing-libssl.md (dlopen(/user/tmp/truffleruby-23.1.0/lib/mri/openssl.bundle, 0x0002): Library not loaded: @rpath/libgraalvm-llvm.1.dylib (RuntimeError)
  Referenced from: <435AA929-B588-3E9B-9E9B-F2C5F858EC29> /user/tmp/truffleruby-23.1.0/lib/mri/openssl.bundle
  Reason: tried: '/usr/local/opt/openssl@1.1/lib/libgraalvm-llvm.1.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/opt/openssl@1.1/lib/libgraalvm-llvm.1.dylib' (no such file), '/usr/local/opt/openssl@1.1/lib/libgraalvm-llvm.1.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/opt/openssl@1.1/lib/libgraalvm-llvm.1.dylib' (no such file), '/usr/local/lib/libgraalvm-llvm.1.dylib' (no such file), '/usr/lib/libgraalvm-llvm.1.dylib' (no such file, not in dyld cache))
	from /user/tmp/truffleruby-23.1.0/lib/mri/openssl.rb:13:in `<top (required)>'
	from <internal:core> core/kernel.rb:260:in `require'
	from -e:1:in `<main>'

This sounds like openssl.bundle is loaded natively and not on Sulong, I wonder if Sulong doesn't detect that .bundle as having a valid header or so, or if the bitcode is actually missing in openssl.bundle (ideally Sulong would error in such a case rather than load natively but IIRC that's not the current behavior, maybe this could be solved via different mime-types for user one and for dependencies).
@rschatz Could you advise some command lines to figure that out?

where openssl@3 is set via brew --prefix .Not sure if the truffleruby installation script is bypassing this(?).

TruffleRuby will pick one of them, that should just work.
It currently prefers 1.1: https://github.com/oracle/truffleruby/blob/master/lib/truffle/truffle/openssl-prefix.rb

@rschatz
Copy link
Member

rschatz commented Oct 5, 2023

@rschatz Could you advise some command lines to figure that out?

mx extract-bitcode <path-to-so-file> should produce a .so.bc file next to the .so file containing the bitcode, if the bitcode is there. It's using exactly the same code as Sulong uses to extract the bitcode, so if this works, the bitcode is there and can be found by Sulong. If it doesn't work, the bitcode is at least not in the place where Sulong is looking for it.

@eregon
Copy link
Member

eregon commented Oct 5, 2023

@HoneyryderChuck Could you try that?
Here are the full instructions:

mkdir truffleruby-ws
cd truffleruby-ws
git clone https://github.com/graalvm/mx.git
git clone https://github.com/oracle/graal.git
cd graal
../mx/mx extract-bitcode /user/tmp/truffleruby-23.1.0/lib/mri/openssl.bundle

Could you also copy the output of: otool -l /user/tmp/truffleruby-23.1.0/lib/mri/openssl.bundle?

@eregon
Copy link
Member

eregon commented Oct 5, 2023

@lewurm had a similar-looking error, with XCode 15 which ships a new linker and that apparently makes https://github.com/oracle/graal/blob/3fe9ebac47c4b850068770c5e7afe419ba426a39/sulong/projects/com.oracle.truffle.llvm.parser/src/com/oracle/truffle/llvm/parser/macho/MachOFile.java#L118 fail to find the bitcode.

@lewurm
Copy link
Member

lewurm commented Oct 5, 2023

as a workaround using an older Xcode should do the job.

@HoneyryderChuck
Copy link
Contributor Author

Could you write here your macOS version and XCode version?

Ventura 13.5.2, XCode 15

Could you also copy the output of: otool -l /user/tmp/truffleruby-23.1.0/lib/mri/openssl.bundle?

"no primary suite found for extract-bitcode"

as a workaround using an older Xcode should do the job.

Isn't there a workaround for XCode 15, where I can do smth manually instead? Unfortunately downgrading xcode is not feasible or an option. I'll have to wait for a fix otherwise.

@eregon
Copy link
Member

eregon commented Oct 6, 2023

"no primary suite found for extract-bitcode"

Ah, I forgot cd sulong or truffleruby after cd graal so it should be like:

mkdir truffleruby-ws
cd truffleruby-ws
git clone https://github.com/oracle/truffleruby.git
cd truffleruby
bin/jt build
bin/jt mx build
bin/jt mx extract-bitcode /user/tmp/truffleruby-23.1.0/lib/mri/openssl.bundle

Isn't there a workaround for XCode 15, where I can do smth manually instead? Unfortunately downgrading xcode is not feasible or an option. I'll have to wait for a fix otherwise.

We're looking into it, there are other likely related issues with XCode 15 reproduced by others, we'll need to fix this on Sulong master anyway.

@HoneyryderChuck
Copy link
Contributor Author

Ah, I forgot cd sulong or truffleruby after cd graal

When I call mx:

$JAVA_HOME does not seem to point to a JVMCI-enabled JDK (`/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java -version` does not contain 'jvmci')

Do I need to have a special JVM installed? FWIW I have 3 versions, the more recent being java 18 (I tried with all of them, same result)

@eregon
Copy link
Member

eregon commented Oct 6, 2023

Ah jt should probably suggest to unset JAVA_HOME, that's the fix for that (it will download the correct labsjdk for you).

If this is too much trouble though feel free to just wait for the fix, as this point we have identified there are issues with XCode 15 and we can most likely reproduce this issue too after fixing some stuff before.

@eregon eregon changed the title Can't use truffleruby 23.1.0 on MacOS Can't use truffleruby 23.1.0 on MacOS with XCode 15 Oct 13, 2023
@eregon eregon added the macos label Oct 13, 2023
@konung
Copy link

konung commented Nov 2, 2023

Hello

I'm running into the same issue with version 23.1.1 . It seems to install fine initially.

I can for instance run irb, or ruby -v, but as soon as I try to do anything with openssl - like bundle install I run into an error:

bundle install                                                             
Could not load OpenSSL.
You must recompile Ruby with OpenSSL support.

I've tried using asdf , then using ruby-install as well ( installing it into my .asdf dir just to keep it consistent)

ruby-install -i /Users/konung/.asdf/installs/ruby/truffleruby-graalvm-23.1.1 truffleruby-graalvm 23.1.1

Also tried to point it to my openssl installations( both 1.1 & 3) - all install fine and work until I have to use a gem with openssl dependency - like bundler.

RUBY_CONFIGURE_OPTS=--with-openssl-dir=$(brew --prefix openssl@1.1) asdf install ruby truffleruby-23.1.1
RUBY_CONFIGURE_OPTS=--with-openssl-dir=$(brew --prefix openssl@3) asdf install ruby truffleruby-23.1.1
RUBY_CONFIGURE_OPTS=--with-openssl-dir=$(brew --prefix openssl@1.1) asdf install ruby truffleruby+graalvm-23.1.1
RUBY_CONFIGURE_OPTS=--with-openssl-dir=$(brew --prefix openssl@3) asdf install ruby truffleruby+graalvm-23.1.1

I'm on
macOS
Sonoma 14.0
xcode 15.0.1
M2 chip

Thank you

@dentarg
Copy link

dentarg commented Nov 3, 2023

I just installed truffleruby-23.1.1 using ruby-build:

My wrapper rbuild around ruby-build
$ cat =rbuild
#!/bin/sh

set -e
set -u

if [ $# -eq 0 ];
then
    echo "Usage: $0 <ruby version>"
    exit 0
fi

command -v ruby-build >/dev/null 2>&1 || echo "No ruby-build, please install it: brew install ruby-build"

RUBY_TO_INSTALL=$1
RUBY_BUILD_PREFIX="${RUBIES_DIR}/${RUBY_TO_INSTALL}"

mkdir -p $RUBIES_DIR

echo "Installing ${RUBY_TO_INSTALL} to ${RUBY_BUILD_PREFIX}"

ruby-build $RUBY_TO_INSTALL $RUBY_BUILD_PREFIX
Logs from rbuild truffleruby-23.1.1
$ rbuild truffleruby-23.1.1
Installing truffleruby-23.1.1 to /Users/dentarg/.rubies/truffleruby-23.1.1
To follow progress, use 'tail -f /var/folders/8k/xxxw_5jj08d1xb8ml7fzycp80000gn/T/ruby-build.20231103111616.40450.log' or pass --verbose
Downloading truffleruby-23.1.1-macos-amd64.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/6a6b70554f9659bebcbc535f757985480b3437e0e9dbbc1b8572cb0cb5f3337f
Installing truffleruby-23.1.1...
Recompiling the OpenSSL C extension (against the installed libssl)
checking for rb_io_maybe_wait(0, Qnil, Qnil, Qnil) in ruby/io.h... yes
checking for t_open() in -lnsl... no
checking for socket() in -lsocket... no
checking for openssl/ssl.h... yes
checking for CRYPTO_malloc() in -lcrypto... yes
checking for SSL_new() in -lssl... yes
checking for LIBRESSL_VERSION_NUMBER in openssl/opensslv.h... no
checking for OpenSSL version >= 1.0.2... yes
checking for RAND_egd() in openssl/rand.h... no
checking for ENGINE_load_dynamic() in openssl/engine.h... yes
checking for ENGINE_load_4758cca() in openssl/engine.h... no
checking for ENGINE_load_aep() in openssl/engine.h... no
checking for ENGINE_load_atalla() in openssl/engine.h... no
checking for ENGINE_load_chil() in openssl/engine.h... no
checking for ENGINE_load_cswift() in openssl/engine.h... no
checking for ENGINE_load_nuron() in openssl/engine.h... no
checking for ENGINE_load_sureware() in openssl/engine.h... no
checking for ENGINE_load_ubsec() in openssl/engine.h... no
checking for ENGINE_load_padlock() in openssl/engine.h... no
checking for ENGINE_load_capi() in openssl/engine.h... no
checking for ENGINE_load_gmp() in openssl/engine.h... no
checking for ENGINE_load_gost() in openssl/engine.h... no
checking for ENGINE_load_cryptodev() in openssl/engine.h... yes
checking for SSL.ctx in openssl/ssl.h... no
checking for EVP_MD_CTX_new() in openssl/evp.h... yes
checking for EVP_MD_CTX_free(NULL) in openssl/evp.h... yes
checking for EVP_MD_CTX_pkey_ctx(NULL) in openssl/evp.h... yes
checking for X509_STORE_get_ex_data(NULL, 0) in openssl/x509.h... yes
checking for X509_STORE_set_ex_data(NULL, 0, NULL) in openssl/x509.h... yes
checking for X509_STORE_get_ex_new_index(0, NULL, NULL, NULL, NULL) in openssl/x509.h... yes
checking for X509_CRL_get0_signature(NULL, NULL, NULL) in openssl/x509.h... yes
checking for X509_REQ_get0_signature(NULL, NULL, NULL) in openssl/x509.h... yes
checking for X509_REVOKED_get0_serialNumber(NULL) in openssl/x509.h... yes
checking for X509_REVOKED_get0_revocationDate(NULL) in openssl/x509.h... yes
checking for X509_get0_tbs_sigalg(NULL) in openssl/x509.h... yes
checking for X509_STORE_CTX_get0_untrusted(NULL) in openssl/x509.h... yes
checking for X509_STORE_CTX_get0_cert(NULL) in openssl/x509.h... yes
checking for X509_STORE_CTX_get0_chain(NULL) in openssl/x509.h... yes
checking for OCSP_SINGLERESP_get0_id(NULL) in openssl/ocsp.h... yes
checking for SSL_CTX_get_ciphers(NULL) in openssl/ssl.h... yes
checking for X509_up_ref(NULL) in openssl/x509.h... yes
checking for X509_CRL_up_ref(NULL) in openssl/x509.h... yes
checking for X509_STORE_up_ref(NULL) in openssl/x509.h... yes
checking for SSL_SESSION_up_ref(NULL) in openssl/ssl.h... yes
checking for EVP_PKEY_up_ref(NULL) in openssl/evp.h... yes
checking for SSL_CTX_set_min_proto_version(NULL, 0) in openssl/ssl.h... yes
checking for SSL_CTX_get_security_level(NULL) in openssl/ssl.h... yes
checking for X509_get0_notBefore(NULL) in openssl/x509.h... yes
checking for SSL_SESSION_get_protocol_version(NULL) in openssl/ssl.h... yes
checking for TS_STATUS_INFO_get0_status(NULL) in openssl/ts.h... yes
checking for TS_STATUS_INFO_get0_text(NULL) in openssl/ts.h... yes
checking for TS_STATUS_INFO_get0_failure_info(NULL) in openssl/ts.h... yes
checking for TS_VERIFY_CTS_set_certs(NULL, NULL) in openssl/ts.h... yes
checking for TS_VERIFY_CTX_set_store(NULL, NULL) in openssl/ts.h... yes
checking for TS_VERIFY_CTX_add_flags(NULL, 0) in openssl/ts.h... yes
checking for TS_RESP_CTX_set_time_cb(NULL, NULL, NULL) in openssl/ts.h... yes
checking for EVP_PBE_scrypt("", 0, (unsigned char *)"", 0, 0, 0, 0, 0, NULL, 0) in openssl/evp.h... yes
checking for SSL_CTX_set_post_handshake_auth(NULL, 0) in openssl/ssl.h... yes
checking for EVP_PKEY_check(NULL) in openssl/evp.h... yes
checking for EVP_PKEY_new_raw_private_key(0, NULL, (unsigned char *)"", 0) in openssl/evp.h... yes
checking for SSL_CTX_set_ciphersuites(NULL, "") in openssl/ssl.h... yes
checking for SSL_set0_tmp_dh_pkey(NULL, NULL) in openssl/ssl.h... no
checking for ERR_get_error_all(NULL, NULL, NULL, NULL, NULL) in openssl/err.h... no
checking for TS_VERIFY_CTX_set_certs(NULL, NULL) in openssl/ts.h... no
checking for SSL_CTX_load_verify_file(NULL, "") in openssl/ssl.h... no
checking for BN_check_prime(NULL, NULL, NULL) in openssl/bn.h... no
checking for EVP_MD_CTX_get0_md(NULL) in openssl/evp.h... no
checking for EVP_MD_CTX_get_pkey_ctx(NULL) in openssl/evp.h... no
checking for EVP_PKEY_eq(NULL, NULL) in openssl/evp.h... no
checking for EVP_PKEY_dup(NULL) in openssl/evp.h... no
creating extconf.h
creating Makefile
compiling openssl_missing.c
compiling ossl.c
compiling ossl_asn1.c
compiling ossl_bio.c
compiling ossl_bn.c
compiling ossl_cipher.c
compiling ossl_config.c
compiling ossl_digest.c
compiling ossl_engine.c
compiling ossl_hmac.c
compiling ossl_kdf.c
compiling ossl_ns_spki.c
compiling ossl_ocsp.c
compiling ossl_pkcs12.c
compiling ossl_pkcs7.c
compiling ossl_pkey.c
compiling ossl_pkey_dh.c
compiling ossl_pkey_dsa.c
compiling ossl_pkey_ec.c
compiling ossl_pkey_rsa.c
compiling ossl_rand.c
compiling ossl_ssl.c
compiling ossl_ssl_session.c
compiling ossl_ts.c
compiling ossl_x509.c
compiling ossl_x509attr.c
compiling ossl_x509cert.c
compiling ossl_x509crl.c
compiling ossl_x509ext.c
compiling ossl_x509name.c
compiling ossl_x509req.c
compiling ossl_x509revoked.c
compiling ossl_x509store.c
linking shared-object openssl.bundle
-macosx_version_min has been renamed to -macos_version_min
ld: warning: -multiply_defined is obsolete
-macosx_version_min has been renamed to -macos_version_min
ld: warning: -multiply_defined is obsolete
-macosx_version_min has been renamed to -macos_version_min
ld: warning: -multiply_defined is obsolete
-macosx_version_min has been renamed to -macos_version_min
ld: warning: -multiply_defined is obsolete

Recompiling the Psych C extension (against the installed libyaml)
checking for yaml.h... yes
checking for yaml_get_version() in -lyaml... yes
creating Makefile
compiling psych.c
compiling psych_emitter.c
compiling psych_parser.c
compiling psych_to_ruby.c
compiling psych_yaml_tree.c
linking shared-object psych.bundle
-macosx_version_min has been renamed to -macos_version_min
ld: warning: -multiply_defined is obsolete
-macosx_version_min has been renamed to -macos_version_min
ld: warning: -multiply_defined is obsolete
-macosx_version_min has been renamed to -macos_version_min
ld: warning: -multiply_defined is obsolete
-macosx_version_min has been renamed to -macos_version_min
ld: warning: -multiply_defined is obsolete

TruffleRuby was successfully installed in /Users/dentarg/.rubies/truffleruby-23.1.1
Installed truffleruby-23.1.1 to /Users/dentarg/.rubies/truffleruby-23.1.1
$ ruby -v
truffleruby 23.1.1, like ruby 3.2.2, Oracle GraalVM Native [x86_64-darwin]

$ xcodebuild -version
Xcode 15.0.1
Build version 15A507

$ which gem
/Users/dentarg/.rubies/truffleruby-23.1.1/bin/gem

$ which bundle
/Users/dentarg/.rubies/truffleruby-23.1.1/bin/bundle

$ gem -v
<internal:core> core/kernel.rb:234:in `gem_original_require': dlopen(/Users/dentarg/.rubies/truffleruby-23.1.1/lib/mri/psych.bundle, 0x0002): Library not loaded: @rpath/libgraalvm-llvm.1.dylib (RuntimeError)
  Referenced from: <E1D7F9C3-8A66-32AC-9B2C-92D70EB53820> /Users/dentarg/.rubies/truffleruby-23.1.1/lib/mri/psych.bundle
  Reason: tried: '/usr/local/opt/libyaml/lib/libgraalvm-llvm.1.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/opt/libyaml/lib/libgraalvm-llvm.1.dylib' (no such file), '/usr/local/opt/libyaml/lib/libgraalvm-llvm.1.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/opt/libyaml/lib/libgraalvm-llvm.1.dylib' (no such file), '/usr/local/lib/libgraalvm-llvm.1.dylib' (no such file), '/usr/lib/libgraalvm-llvm.1.dylib' (no such file, not in dyld cache)
    from <internal:/Users/dentarg/.rubies/truffleruby-23.1.1/lib/mri/rubygems/core_ext/kernel_require.rb>:85:in `require'
    from /Users/dentarg/.rubies/truffleruby-23.1.1/lib/mri/psych.rb:13:in `<top (required)>'
    from <internal:core> core/kernel.rb:234:in `gem_original_require'
    from <internal:/Users/dentarg/.rubies/truffleruby-23.1.1/lib/mri/rubygems/core_ext/kernel_require.rb>:85:in `require'
    from /Users/dentarg/.rubies/truffleruby-23.1.1/lib/mri/rubygems.rb:608:in `load_yaml'
    from /Users/dentarg/.rubies/truffleruby-23.1.1/lib/mri/rubygems/config_file.rb:351:in `load_file'
    from /Users/dentarg/.rubies/truffleruby-23.1.1/lib/mri/rubygems/config_file.rb:194:in `initialize'
    from /Users/dentarg/.rubies/truffleruby-23.1.1/lib/mri/rubygems/gem_runner.rb:71:in `do_configuration'
    from /Users/dentarg/.rubies/truffleruby-23.1.1/lib/mri/rubygems/gem_runner.rb:33:in `run'
    from /Users/dentarg/.rubies/truffleruby-23.1.1/bin/gem:29:in `<main>'


# trying to bundle anything
$ bundle
Could not load OpenSSL.
You must recompile Ruby with OpenSSL support.
otool -l /Users/dentarg/.rubies/truffleruby-23.1.1/lib/mri/psych.bundle
$ otool -l /Users/dentarg/.rubies/truffleruby-23.1.1/lib/mri/psych.bundle
/Users/dentarg/.rubies/truffleruby-23.1.1/lib/mri/psych.bundle:
Load command 0
      cmd LC_SEGMENT_64
  cmdsize 552
  segname __TEXT
   vmaddr 0x0000000000000000
   vmsize 0x0000000000008000
  fileoff 0
 filesize 32768
  maxprot 0x00000005
 initprot 0x00000005
   nsects 6
    flags 0x0
Section
  sectname __text
   segname __TEXT
      addr 0x0000000000004010
      size 0x000000000000358d
    offset 16400
     align 2^4 (16)
    reloff 0
    nreloc 0
     flags 0x80000400
 reserved1 0
 reserved2 0
Section
  sectname __stubs
   segname __TEXT
      addr 0x000000000000759d
      size 0x0000000000000258
    offset 30109
     align 2^0 (1)
    reloff 0
    nreloc 0
     flags 0x80000408
 reserved1 0 (index into indirect symbol table)
 reserved2 6 (size of stubs)
Section
  sectname __stub_helper
   segname __TEXT
      addr 0x00000000000077f5
      size 0x00000000000003f8
    offset 30709
     align 2^0 (1)
    reloff 0
    nreloc 0
     flags 0x80000400
 reserved1 0
 reserved2 0
Section
  sectname __const
   segname __TEXT
      addr 0x0000000000007bf0
      size 0x0000000000000020
    offset 31728
     align 2^4 (16)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __cstring
   segname __TEXT
      addr 0x0000000000007c10
      size 0x00000000000002e4
    offset 31760
     align 2^0 (1)
    reloff 0
    nreloc 0
     flags 0x00000002
 reserved1 0
 reserved2 0
Section
  sectname __unwind_info
   segname __TEXT
      addr 0x0000000000007ef4
      size 0x0000000000000100
    offset 32500
     align 2^2 (4)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Load command 1
      cmd LC_SEGMENT_64
  cmdsize 232
  segname __DATA_CONST
   vmaddr 0x0000000000008000
   vmsize 0x0000000000004000
  fileoff 32768
 filesize 16384
  maxprot 0x00000003
 initprot 0x00000003
   nsects 2
    flags 0x10
Section
  sectname __got
   segname __DATA_CONST
      addr 0x0000000000008000
      size 0x0000000000000060
    offset 32768
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x00000006
 reserved1 100 (index into indirect symbol table)
 reserved2 0
Section
  sectname __const
   segname __DATA_CONST
      addr 0x0000000000008060
      size 0x0000000000000090
    offset 32864
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Load command 2
      cmd LC_SEGMENT_64
  cmdsize 392
  segname __DATA
   vmaddr 0x000000000000c000
   vmsize 0x0000000000004000
  fileoff 49152
 filesize 16384
  maxprot 0x00000003
 initprot 0x00000003
   nsects 4
    flags 0x0
Section
  sectname __la_symbol_ptr
   segname __DATA
      addr 0x000000000000c000
      size 0x0000000000000320
    offset 49152
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x00000007
 reserved1 112 (index into indirect symbol table)
 reserved2 0
Section
  sectname __data
   segname __DATA
      addr 0x000000000000c320
      size 0x0000000000000008
    offset 49952
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x00000000
 reserved1 0
 reserved2 0
Section
  sectname __common
   segname __DATA
      addr 0x000000000000c328
      size 0x0000000000000028
    offset 0
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x00000001
 reserved1 0
 reserved2 0
Section
  sectname __bss
   segname __DATA
      addr 0x000000000000c350
      size 0x00000000000000d8
    offset 0
     align 2^3 (8)
    reloff 0
    nreloc 0
     flags 0x00000001
 reserved1 0
 reserved2 0
Load command 3
      cmd LC_SEGMENT_64
  cmdsize 72
  segname __LINKEDIT
   vmaddr 0x0000000000010000
   vmsize 0x0000000000004000
  fileoff 65536
 filesize 14528
  maxprot 0x00000001
 initprot 0x00000001
   nsects 0
    flags 0x0
Load command 4
            cmd LC_DYLD_INFO_ONLY
        cmdsize 48
     rebase_off 65536
    rebase_size 16
       bind_off 65552
      bind_size 224
  weak_bind_off 0
 weak_bind_size 0
  lazy_bind_off 65776
 lazy_bind_size 2704
     export_off 68480
    export_size 224
Load command 5
     cmd LC_SYMTAB
 cmdsize 24
  symoff 68784
   nsyms 419
  stroff 76336
 strsize 3728
Load command 6
            cmd LC_DYSYMTAB
        cmdsize 80
      ilocalsym 0
      nlocalsym 296
     iextdefsym 296
     nextdefsym 11
      iundefsym 307
      nundefsym 112
         tocoff 0
           ntoc 0
      modtaboff 0
        nmodtab 0
   extrefsymoff 0
    nextrefsyms 0
 indirectsymoff 75488
  nindirectsyms 212
      extreloff 0
        nextrel 0
      locreloff 0
        nlocrel 0
Load command 7
     cmd LC_UUID
 cmdsize 24
    uuid E1D7F9C3-8A66-32AC-9B2C-92D70EB53820
Load command 8
      cmd LC_BUILD_VERSION
  cmdsize 32
 platform 1
    minos 13.0
      sdk 13.0
   ntools 1
     tool 3
  version 1015.7
Load command 9
      cmd LC_SOURCE_VERSION
  cmdsize 16
  version 0.0
Load command 10
          cmd LC_LOAD_DYLIB
      cmdsize 56
         name @rpath/libgraalvm-llvm.1.dylib (offset 24)
   time stamp 2 Thu Jan  1 01:00:02 1970
      current version 1.0.0
compatibility version 0.0.0
Load command 11
          cmd LC_LOAD_DYLIB
      cmdsize 72
         name /usr/local/opt/libyaml/lib/libyaml-0.2.dylib (offset 24)
   time stamp 2 Thu Jan  1 01:00:02 1970
      current version 3.9.0
compatibility version 3.0.0
Load command 12
          cmd LC_LOAD_DYLIB
      cmdsize 56
         name /usr/lib/libSystem.B.dylib (offset 24)
   time stamp 2 Thu Jan  1 01:00:02 1970
      current version 1336.0.0
compatibility version 1.0.0
Load command 13
          cmd LC_RPATH
      cmdsize 40
         path /usr/local/opt/libyaml/lib (offset 12)
Load command 14
      cmd LC_FUNCTION_STARTS
  cmdsize 16
  dataoff 68704
 datasize 80
Load command 15
      cmd LC_DATA_IN_CODE
  cmdsize 16
  dataoff 68784
 datasize 0

@eregon
Copy link
Member

eregon commented Nov 7, 2023

This is fixed since #3308 in dev builds, which you can install e.g. with ruby-build truffleruby-dev prefix-to-install-to/rbenv install truffleruby-dev (see the README for more ways).

We plan to backport this to 23.1.2 (January).

The issue is caused by a new linker in XCode 15 which no longer keeps the bitcode when linking even when instructed to do so. So we moved to the ld64.lld linker from LLVM instead of using the system linker.

@konung
Copy link

konung commented Nov 7, 2023

Thank you

asdf install ruby truffleruby-dev

Worked like a charm

@bolandross
Copy link

This is fixed since #3308 in dev builds, which you can install e.g. with ruby-build truffleruby-dev prefix-to-install-to/rbenv install truffleruby-dev (see the README for more ways).

We plan to backport this to 23.1.2 (January).

The issue is caused by a new linker in XCode 15 which no longer keeps the bitcode when linking even when instructed to do so. So we moved to the ld64.lld linker from LLVM instead of using the system linker.

This is wonderful news. Is it possible to get the same fix for truffleruby+graalvm?

@eregon
Copy link
Member

eregon commented Nov 13, 2023

Is it possible to get the same fix for truffleruby+graalvm?

It will be there as soon as there is a new build at https://github.com/graalvm/graalvm-ce-dev-builds/releases.
Unfortunately there weren't builds recently, I pinged people to look at it.

Maybe I should setup something like https://github.com/ruby/truffleruby-dev-builder for truffleruby+graalvm too, nowadays it would be simpler but still some work.

@eregon
Copy link
Member

eregon commented Nov 15, 2023

@bolandross There is a new build at https://github.com/graalvm/graalvm-ce-dev-builds, which you can get via ruby-build truffleruby+graalvm-dev

@eregon
Copy link
Member

eregon commented Dec 4, 2023

This fix will be in the 23.1.2 release which will be available on January 23, 2024.

torrocus added a commit to torrocus/rvm that referenced this issue Apr 26, 2024
Sometimes CI tests in the macos environment fail.
The logs indicated a problem on the truffleruby side. [1]

I'm not 100% sure, but I think I was able to reproduce the problem
and eliminate it. I don't see any other option
than to upgrade the version of TruffleRuby.

The test case I changed:
> Test that the right version is installed

Instead of checking version 1.0.0-rc13, I check version 23.1.2.
The test behavior is the same because we care about the "right version".

[1]: oracle/truffleruby#3283
torrocus added a commit to torrocus/rvm that referenced this issue Apr 26, 2024
Sometimes CI tests in the macos environment fail.
The logs indicated a problem on the truffleruby side. [1]

I'm not 100% sure, but I think I was able to reproduce the problem
and eliminate it. I don't see any other option
than to upgrade the version of TruffleRuby.

The test case I changed:
> Test that the right version is installed

Instead of checking version 1.0.0-rc13, I check version 23.1.2.
The test behavior is the same because we care about the "right version".

[1]: oracle/truffleruby#3283
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants