From: "thomthom (Thomas Thomassen)" Date: 2022-11-04T09:58:04+00:00 Subject: [ruby-core:110605] [Ruby master Bug#18876] OpenSSL fails to autoload in --with-static-linked-ext builds Issue #18876 has been updated by thomthom (Thomas Thomassen). alanwu (Alan Wu) wrote in #note-11: > @thomthom > The issue was specific to `--with-static-linked-ext` builds, which you > might not be using because it's not a popular way to build Ruby. We don't build a normal Ruby, we embed the interpreter into our application for plugin capabilities. Our configure args: ``` '--prefix=/Users/user/.conan/data/ruby/3.1.2/sketchup/stable/build/bd95825b99dcb274d0e577fbdc953653a9ea0fb9' '--with-openssl-dir=/Users/user/.conan/data/openssl/1.1.1q/sketchup/stable/package/93ae0b0e7eebe0611c04d3e0d9bbf49fbce92332' '--with-libyaml-dir=/Users/user/.conan/data/libyaml/0.2.5/sketchup/stable/package/a56a950abed2e10dbdc26845400f0a034d97c454' '--disable-install-doc' '--disable-install-rdoc' '--enable-shared' '--enable-load-relative' '--with-static-linked-ext' '--without-debug' '--without-gdbm' '--without-gettext' '--without-irb' '--without-mkmf' '--without-rdoc' '--without-readline' '--without-tk' '--bindir=${prefix}/bin' '--sbindir=${prefix}/bin' '--libexecdir=${prefix}/bin' '--libdir=${prefix}/lib' '--includedir=${prefix}/include' '--oldincludedir=${prefix}/include' '--datarootdir=${prefix}/share' 'cflags=-mmacosx-version-min=10.14 -fdeclspec' 'cxxflags=-mmacosx-version-min=10.14 -fdeclspec' 'LDFLAGS=-mmacosx-version-min=10.14 -fdeclspec' ``` So is `--with-static-linked-ext` causing a bug with `autoload`? Or is it a configuration issue? `require 'openssl' works. I also added some logging to `openssl.rb` to trace when it was loaded. While `defined? OpenSSL::SSL` doesn't trigger the autoload, if I manually type `OpenSSL` from the terminal the `autoload` does work. Which then leaves me baffled to why `HAVE_SSL = defined? OpenSSL::SSL` isn't behaving as expected. ---------------------------------------- Bug #18876: OpenSSL fails to autoload in --with-static-linked-ext builds https://bugs.ruby-lang.org/issues/18876#change-99937 * Author: Gloomy_meng (Gloomy Meng) * Status: Closed * Priority: Normal * ruby -v: 3.1.1 * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN ---------------------------------------- i try use ruby + gem in my macos app with .a framework, i need install ruby in a custom location. so i make & make install openssl with this configure: ``` shell /usr/bin/perl Configure --prefix="......./local/dependencies" no-shared zlib darwin64-x86_64-cc ``` then make & make install ruby with this configure: ``` shell /bin/sh configure --prefix /Users/xxxxx/xxxx/local/bundle --with-openssl-dir="/Users/xxxxx/xxxx/local/dependencies" --enable-load-relative --with-static-linked-ext --disable-install-doc --with-out-ext="xxxxxx" ``` ------ because i need to isolated environment, so i make `bundle-env` file for run shell. and i uploaded bundle-env file ------ and update gem by local ``` shell destroot/bundle/bin/bundle-env gem install downloads/rubygems-update-3.3.15.gem --no-document --env-shebang ``` at last, run install alway got exception: ``` shell destroot/bundle/bin/bundle-env gem install xxxxxxx --version="xxxxxx" --no-document --env-shebang ERROR: While executing gem ... (Gem::Exception) OpenSSL is not available. Install OpenSSL and rebuild Ruby (preferred) or use non-HTTPS sources ``` at the same env, i tried some command, and i got the right version what i make install ``` shell destroot/bundle/bin/bundle-env ruby --version // ruby 3.1.1p18 (2022-02-18 revision 53f5fc4236) [x86_64-darwin21] destroot/bundle/bin/bundle-env gem --version // 3.3.15 destroot/bundle/bin/bundle-env ruby -ropenssl -e 'puts OpenSSL::OPENSSL_VERSION' // OpenSSL 1.1.1i 8 Dec 2020 ``` ------ i found and uploaded `ext/openssl/mkmf.log` and ---Files-------------------------------- bundle-env (852 Bytes) mkmf.log (215 KB) -- https://bugs.ruby-lang.org/ Unsubscribe: