Giter Site home page Giter Site logo

Comments (6)

junaruga avatar junaruga commented on June 3, 2024

You don't have to describe your negative emotions here with a "sigh". Please be patient and kind. Did you install the OpenSSL 3.0.11 headers (devel) package such as /usr/include/openssl/*.h files?

from openssl.

junaruga avatar junaruga commented on June 3, 2024

Note that we are testing the openssl gem with OpenSSL 3.0.x on Ubuntu

- openssl-3.0.10

We are also testing the openssl gem bundled in Ruby (ruby/ruby) on our Ruby project's CI on FreeBSD

https://rubyci.org/

FreeBSD 13.1 x64
FreeBSD 12.4 x64

from openssl.

rhenium avatar rhenium commented on June 3, 2024

In make.out.txt:

[...]
ossl.c:322:21: warning: implicit declaration of function 'ERR_get_error_all' is invalid in C99 [-Wimplicit-function-declaration]
        while ((e = ERR_get_error_all(&file, &line, &func, &data, &flags))) {
                    ^
1 warning generated.
[...]

This isn't quite right. ERR_get_error_all() is declared in OpenSSL 3.0's openssl/err.h. ossl.c does include that file, so this warning should never happen.

ERR_get_error_all() is a new function in OpenSSL 3.0. My best guess is that header files from OpenSSL <= 1.1 sneaked into the search paths somehow.

What options did you pass to the configure script? Also please provide ext/openssl/mkmf.log and ext/openssl/Makefile which are generated while running make (after it prints configuring openssl).

from openssl.

 avatar commented on June 3, 2024

You don't have to describe your negative emotions here with a "sigh".

I've been at this for two days... I've done hundreds of builds with differing variations. I've even transplanted the ext/openssl files from your master branch into the directory created when I extracted the tar.gz file I got from ruby-lang.org. I'm incredibly frustrated...

Did you install the OpenSSL 3.0.11 headers (devel) package such as /usr/include/openssl/*.h files?

On FreeBSD there is no openssl-devel...like on Debian/Ubuntu. There is only the openssl port (which installs libraries and headers)...this goes for all the versions available: 1.1.1, 3.0, 3.1, 3.2alpha, etc. I've tried building/installing the openssl (3.0) port too (instead of relying on pkg...which works fine -- no warnings). I verified the headers are installed using either pkg or building openssl from the port. Here's the openssl version in the headers:

opensslv.h:# define OPENSSL_VERSION_MAJOR 3
opensslv.h:# define OPENSSL_VERSION_MINOR 0
opensslv.h:# define OPENSSL_VERSION_PATCH 11
...
opensslv.h:# define OPENSSL_VERSION_STR "3.0.11"
opensslv.h:# define OPENSSL_FULL_VERSION_STR "3.0.11"
opensslv.h:# define OPENSSL_VERSION_TEXT "OpenSSL 3.0.11 19 Sep 2023"

What options did you pass to the configure script?

No options...just cd ~/ruby-3.2.2; ./configure. The output is attached as configure.out.txt.

Thanks very much for your response. Attached are the two files you requested (I added the .txt extension so github wouldn't complain).

configure.out.txt
mkmf.log.txt
Makefile.txt

from openssl.

 avatar commented on June 3, 2024

I found it! There's a set of openssl 1.1.1 headers installed in /usr/include and a set of openssl 1.1.1 libraries installed in /lib and /usr/lib. These directories are searched before /usr/local/lib by the C/C++ compiler (clang) and the linker (ld).

These openssl 1.1.1 headers/libraries were put there when the system was installed...so I can't get rid of them (they're used by things like sudo and pkg...and probably the FreeBSD crypto drivers). FreeBSD 14.0 (real soon now) is supposed to upgrade all this to openssl 3.X.

I solved my immediate problem by running configure --with-openssl --with-openssl-dir=/usr/local. This causes the location of openssl 3.0 to be set explicitly. This is confirmed by

stevewi@dave:~/ruby-3.2.2 $ ldd .ext/x86_64-freebsd13.2/openssl.so
.ext/x86_64-freebsd13.2/openssl.so:
libssl.so.12 => /usr/local/lib/libssl.so.12 (0x13cdcc26000) <-- openssl 3.0 shared library
libcrypto.so.12 => /usr/local/lib/libcrypto.so.12 (0x13cddfad000) <-- openssl 3.0 shared library
libm.so.5 => /lib/libm.so.5 (0x13cdd5f9000)
libthr.so.3 => /lib/libthr.so.3 (0x13cdf901000)
libc.so.7 => /lib/libc.so.7 (0x13cda2ba000)

after the build is complete.

stevewi@dave:~/ruby-3.2.2 $ ldd /usr/local/lib/ruby/gems/3.2.0/gems/openssl-3.2.0/lib/openssl.so
/usr/local/lib/ruby/gems/3.2.0/gems/openssl-3.2.0/lib/openssl.so:
libssl.so.12 => /usr/local/lib/libssl.so.12 (0x13cdcc26000) <-- openssl 3.0 shared library
libcrypto.so.12 => /usr/local/lib/libcrypto.so.12 (0x13cddfad000) <-- openssl 3.0 shared library
libm.so.5 => /lib/libm.so.5 (0x13cdd5f9000)
libthr.so.3 => /lib/libthr.so.3 (0x13cdf901000)
libc.so.7 => /lib/libc.so.7 (0x13cda2ba000)

after the new build is installed confirms this as well.

This was the clue:

ERR_get_error_all() is a new function in OpenSSL 3.0. My best guess is that header files from OpenSSL <= 1.1 sneaked into the search paths somehow.

Thanks for your help.

from openssl.

 avatar commented on June 3, 2024

This issue is now resolved.

from openssl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.