crystal-lang / crystal

The Crystal Programming Language
https://crystal-lang.org
Apache License 2.0
19.47k stars 1.62k forks source link

Ubuntu snap install for 1.2.2 broken #11433

Open wolfgang371 opened 3 years ago

wolfgang371 commented 3 years ago

Yesterday I got the automatic update to 1.2.2. Before that compiling worked just fine, with the update I get this:

_main.o: In Funktion »->«:
/snap/crystal/963/share/crystal/src/openssl/bio.cr:68: Warnung: undefinierter Verweis auf »BIO_set_shutdown«
/snap/crystal/963/share/crystal/src/openssl/bio.cr:68: Warnung: undefinierter Verweis auf »BIO_set_init«
O-penS-S-L-5858B-I-O-.o: In Funktion »get_data«:
/snap/crystal/963/share/crystal/src/openssl/bio.cr:6: Warnung: undefinierter Verweis auf »BIO_get_data«
O-penS-S-L-5858B-I-O-.o: In Funktion »set_data«:
/snap/crystal/963/share/crystal/src/openssl/bio.cr:14: Warnung: undefinierter Verweis auf »BIO_set_data«
collect2: error: ld returned 1 exit status
Error: execution of command failed with code: 1: `cc "${@}" -o /home/[...]/sth  -rdynamic -L/snap/crystal/963/bin/../lib/crystal -lz `command -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'` -lsqlite3 -lpcre -lm -lgc -lpthread -levent -lrt -ldl`

Reinstalling didn't help.

Also on crystal snap the old versions are not available, so I couldn't rollback.

I then installed crystal via apt (https://crystal-lang.org/install/on_ubuntu/ and https://software.opensuse.org/download.html?project=devel%3Alanguages%3Acrystal&package=crystal) and now it's working again for me.

I use Ubuntu 18.04.

As an aside, both versions still use the old LLVM 10.0.0 (see #11342).

beta-ziliani commented 3 years ago

Sorry for the issue. In the meantime I rolled back the stable version to 1.2.1 until it's fixed. In the future we need to test better the result and/or give more time before promoting a release to stable.

straight-shoota commented 3 years ago

Looks like in snap it's linking against a really old version of OpenSSL (< 1.1.0). Ubuntu 18.04 provides OpensSSL 1.1.1, so question would be where that old one is coming from.

11374 contributes to this error, because it removed libssl version checks in the program code and relies on the LibSSL bindings being correct for any version. Apparently, bindings for some BIO_* functions are defined even when linking against OpenSSL versions that don't have them.

I doubt that's worth fixing, though. The OpenSSL 1.0 has been out of upstream support for 2 years now, and even distribution packagers' maintenance is falling out. I'm not aware of any major distribution system keeping 1.0 releases actively maintained. So we do not need to support OpenSSL < 1.1.0 and should probably just drop it entirely.

It's still unclear why crystal in the snap package would end up linking against an old OpenSSL version. It might actually be a local configuration issue. Can somebody confirm this issue with the snap install?