Crystal+Lucky+Nixpacks failing to build with openssl errors
Hi, I'm trying to deploy a simple Crystal app using the Lucky lib (which uses SSL) and the deploy is failing to build.
I've confirmed that the default Nixpack for Crystal already includes openssl and pkg-config, but the deploy is failing with the following:
My project has a
nixpacks.toml
file that includes the requirements for Lucky (relevant one is libssl-dev
):
I've ran out of options. The project runs fine locally. Any advice?30 Replies
Can you try installing these things via nix instead of apt?
openssl in particular requires some weird LD_PRELOAD/lib type stuff
I don't know which names each package translates to, although I see an openssl package in nixos.org. But I thought Nixpacks already handled openssl that way?
Configuration File | Nixpacks
App source + Nix packages + Docker = Image
I don't follow. How would it unless you tell it what packages to get from where?
Like ideally the provider for crystal should handle this
I tried to add
openssl
and pkg-config
to the apt config, and the logs said they were already installedBut, that's why we let people do these overrides, then we go take the overrides and insert them into the provider
Yea. Openssl is super annoying here. Needs to be installed via Nix
Can you remove the openssl from apt and put it into nixPkgs?
I'll try that
I suspect it'll change your error, and you'll need to move a couple more from apt into either nixLibs or nixPkgs
if THAT doesn't work, please try nixLibs
are Nix librs using the same names as apt?
No, nixPkgs
(Nixpacks is still v0 and we're working on a lot of this)
For niche languages, this ends up being more of a struggle
b/c
nixPkgs
point to nixos.org (it's the first time I've heard of it), and libssl-dev
isn't available there
so I'm removing libssl-dev from aptPkgs, and adding openssl to nixPkgs to test
just wanted to clear that up lolWorth clearing up it's definitely not as clear as we'd want it to be!
You can leave libssl-dev in aptPkgs
Just, start with openssl in nixpkgs cause that's your error right?
Then we can move onto the next one
gotcha
NG, same error ๐ฆ
nixpacks.toml:
Okay move it to nixLibs
Same error
after moving to nixLibs
openssl
disappeared from the header:
Can you paste the full logs?
full as in all the 733 lines?
hm the log got cut off for some reason, let me reupload
I can't copy the entire log
I think the log window is using a virtual scroller and doesn't keep text selected when I scroll past it
Uhh
You sure it's openssl?
And not libressl?
Like it looks like it's misisng LIBRESSL_VERSION_NUMBER
https://search.nixos.org/packages?channel=22.05&show=libressl&from=0&size=50&sort=relevance&type=packages&query=libressl
๐ there's indeed a libressl in nixos, gonna try it in nixPkgs
alongside openssl just to be safe
GitHub
OpenSSL Compilation Error ยท Issue #9773 ยท crystal-lang/crystal
I just started getting this error today. I believe it's from a OpenSSL system upgrade I made. I'm running on Arch Linux, using asdf and Crystal 0.35.1 cc: internal compiler error: S...
You may need some environment variables there, which may only be accessible/set-able via the providers since they'll know where they're located
what exactly do you mean "only accessible/set-able via providers"? can't I set those variables in the project via the dashboard?
This is a crystal bug btw
Oh shit, sorry didnโt see issue link
following that github issue, I added a:
to my nixpacks.toml file just to see the output in the build logs, and it just returns
-lcrypto
, without a path
according to the logs, the command ran after dependencies were installed
so I'm scratching my head here ๐ฆ this is somewhat out of my knowledge areaYa you'll probably need to create an issue on the repo with a repo to reproduce it + information (ideally link to this thread)
I'll try to get a replicable repo with the jumpstart version of Lucky.
which repo should I open the issue on? railwayapp/nixpacks?
Yeah, that repo please
in better news, I found a workaround deploying the app using a Dockerfile instead of Nixpacks
the Nixpacks way seemed easier tho (if it worked lol)