-
Notifications
You must be signed in to change notification settings - Fork 0
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
Compilation failure: main.o undef refs in crystal openssl lib_ssl.cr #1
Comments
Is this a crystal problem? |
It’s either a crystal problem or a commander problem. I don’t see anything relating to any gpm library files in the stacktrace. try compiling with an older version of crystal or try updating openssl |
the build is working on 0.26.1 with openssl v1.0.2g so it’s probably an openssl version problem |
I checked my openssl version, it is 1.1.0g. I tried also using openssl1.0.2n using the crystal flag --link-flags "-L/usr/lib/openssl-1.0". No dice. I downgraded crystal to 0.24.1 (which is the version where the openssl v1.1 bug fix was merged with this different result: Gpm::Cli.run(ARGV) in src/gpm/cli.cr:9: instantiating 'Commander::Command:Class#new()'
in src/gpm/cli.cr:9: instantiating 'Commander::Command:Class#new()'
in src/gpm/cli.cr:42: instantiating 'Commander::Commands#add()'
in src/gpm/cli.cr:42: instantiating 'Commander::Commands#add()'
in src/gpm/cli.cr:48: instantiating 'Gpm::Commands::Uninstall:Class#uninstall(String)'
in src/gpm/commands/uninstall.cr:9: instantiating 'Array(JSON::Type)#each()'
in /usr/share/crystal/src/indexable.cr:148: instantiating 'each_index()'
in /usr/share/crystal/src/indexable.cr:148: instantiating 'each_index()'
in src/gpm/commands/uninstall.cr:9: instantiating 'Array(JSON::Type)#each()'
in src/gpm/commands/uninstall.cr:11: undefined method 'as_s' for Array(JSON::Type) (compile-time type is (Array(JSON::Type) | Bool | Float64 | Hash(String, JSON::Type) | Int64 | String | Nil))
================================================================================ Array(JSON::Type) trace: src/gpm/commands/uninstall.cr:9
|
Info on commander version: |
Somewhere between 0.24 and 0.26, they changed something with the JSON class. I'm going to test it on a fresh Linux VM and get back you in a few |
I can't reproduce. Could you try using the oneliner install (and switch eveyrthing to its most recent versions)? |
No dice. Any other ideas? I compiled and installed openssl 1.1.0h so I could exactly match yours (only 1.1.0g was available on my ubuntu apt).
|
This is a really weird issue. From what you’ve told me our environments are exactly the same, but you’re getting an error. I’ve compiled on mac, linux, and WSL and no failures. Have you been installing the |
I have been installing the openssl package. I fubar'd my ubuntu so I reinstalled Ubuntu 18, then installed the matching set of libssl, libssl-dev, and openssl to your version: Identical result. For completeness, here is the sequence of things that were installed from the fresh ubuntu install (in addition to the packages above): ``~$ curl -fsSL https://git.io/get-gpm | sudo bash ~$ curl -fsSL https://git.io/get-gpm | sudo bash :~$ sudo apt install zlib1g-dev |
That seems like a different error unrelated to OpenSSL. How did it go after installing libz? Reason:
|
The final result was the same as the earlier post, starting with |
All good. Have you looked at crystal-lang/crystal#4680? It seems that issue mentions your problem. |
Eureka! That's the key. pkgconf is required.
|
Wow, all that for just pkgconf. You may want to report that bug to crystal and tell them it's a dependency and should be installed with the crystal installation. |
Description of the issue:
Compile failure related to lib_ssl.cr when building src/gpm/main.cr
Expected behavior:
make install completes
Steps to reproduce:
sudo make install
Output of
crystal env
:CRYSTAL_CACHE_DIR="/home/forgen/.cache/crystal"
CRYSTAL_PATH="/usr/bin/../share/crystal/src:lib"
CRYSTAL_VERSION="0.26.1"
OS Information:
Ubuntu 18.04.1 LTS
Linux aspire-e5-575 4.15.0-34-generic #37-Ubuntu SMP Mon Aug 27 15:21:48 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Additional Information:
/usr/bin/shards
Fetching https://github.com/mrrooijen/commander.git
Using commander (0.3.3)
/usr/bin/crystal build --release -o bin/gpm src/gpm/main.cr
_main.o: In function
__crystal_main': /usr/share/crystal/src/openssl/lib_ssl.cr:213: undefined reference to
SSL_library_init'/usr/share/crystal/src/openssl/lib_ssl.cr:213: undefined reference to
SSL_load_error_strings' /usr/share/crystal/src/openssl/lib_ssl.cr:213: undefined reference to
OPENSSL_add_all_algorithms_noconf'/usr/share/crystal/src/openssl/lib_ssl.cr:213: undefined reference to
ERR_load_crypto_strings' _main.o: In function
default_method':/usr/share/crystal/src/openssl/ssl/context.cr:6: undefined reference to
SSLv23_method' _main.o: In function
matches_subject_alternative_name':/usr/share/crystal/src/openssl/ssl/hostname_validation.cr:34: undefined reference to
sk_num' /usr/share/crystal/src/openssl/ssl/hostname_validation.cr:35: undefined reference to
sk_value'_main.o: In function
->': /usr/share/crystal/src/openssl/ssl/hostname_validation.cr:(.text+0x5e986): undefined reference to
sk_pop_free'_main.o: In function
matches_subject_alternative_name': /usr/share/crystal/src/openssl/ssl/hostname_validation.cr:66: undefined reference to
sk_pop_free'_main.o: In function
validate_hostname': /usr/share/crystal/src/openssl/ssl/hostname_validation.cr:(.text+0x5ea77): undefined reference to
sk_pop_free'_main.o: In function
matches_subject_alternative_name': /usr/share/crystal/src/openssl/ssl/hostname_validation.cr:66: undefined reference to
sk_pop_free'_main.o: In function
->': /usr/share/crystal/src/openssl/ssl/hostname_validation.cr:67: undefined reference to
sk_free'/usr/share/crystal/src/openssl/ssl/hostname_validation.cr:67: undefined reference to
sk_free' /usr/share/crystal/src/openssl/ssl/hostname_validation.cr:67: undefined reference to
sk_free'/usr/share/crystal/src/openssl/ssl/hostname_validation.cr:67: undefined reference to
sk_free' /usr/share/crystal/src/openssl/ssl/hostname_validation.cr:67: undefined reference to
sk_free'_main.o:/usr/share/crystal/src/openssl/ssl/hostname_validation.cr:67: more undefined references to
sk_free' follow collect2: error: ld returned 1 exit status Error: execution of command failed with code: 1:
cc "${@}" -o '/home/forgen/temp/gpm/bin/gpm' -rdynamic -lzcommand -v pkg-config > /dev/null && pkg-config --libs --silence-errors libssl || printf %s '-lssl -lcrypto'
command -v pkg-config > /dev/null && pkg-config --libs --silence-errors libcrypto || printf %s '-lcrypto'
-lpcre -lm -lgc -lpthread /usr/share/crystal/src/ext/libcrystal.a -levent -lrt -ldl -L/usr/lib -L/usr/local/lib`Makefile:7: recipe for target 'build' failed
make: *** [build] Error 1
The text was updated successfully, but these errors were encountered: