-
Notifications
You must be signed in to change notification settings - Fork 243
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
Problems with zlib in a haskell project #312
Comments
Thanks for the bug report @commandodev ! Can you try building with Also, do you have a minimal repro that can be used to test with (and later add to the examples directory that we can add a test against). |
I've created the bare minimum servant project with Just deploying now and will see if the same happens (I'll also try |
Confirmed that that one fails out of the box, as well as with |
Thanks for the test repo. It looks like there is a lot of discussion around zlib with Nix here commercialhaskell/stack#2975. I'm going to try a few of the suggestions and will report back. |
Yeah funny enough, I've just tried adding a nix section to my stack file and overriding the build command. Let's see. zlib, haskell/stack and nix has been a pain the rear forever! |
I was able to get it to build successfully with this config. I'm not exactly what did it though 😆 Going to narrow it down. As a side note, building takes a bit of time. Do you know a good directory that we can cache to speed up builds? Keeping in mind that the directory will not show up in the final image |
I suspect that it's the addition of zlibg-dev into apt pkgs that's done it here. This means that stack isn't really using nix for its packages properly, this has also been a pain basically forever 🤣. That being said, a win is a win! |
What's the distinction between |
APPEND_LIBRARY_PATH = \"${{lib.makeLibraryPath [ {libraries} ] }}\";
myLibraries = writeText \"libraries\" ''
export LD_LIBRARY_PATH=\"${{APPEND_LIBRARY_PATH}}:$LD_LIBRARY_PATH\"
''; |
Confirming that adding AFIAR (and it's been a while since I was using nix in anger) the library thing is more for packing software up than using existing packages... It would probs be better to stick with packages if possible (I also didn't have _LIBS in by build that worked) |
Awesome! Do you think that this is common enough to always install with the Haskell provider? |
Yes I would say so |
@coffee-cup - happy to test out any speed improvements you want to try. I guess I could set |
I can make this change then 😄
Ya for sure! |
OK, giving that a try. One last thing - my original build is working now, but my overrridden command is having some problems:
Any idea? |
Hmmm, not sure adding |
Adding |
What executable is not available? |
It will only make a difference on subsequent builds. In the logs you should see that the
Yes anything can be added. The cache dir in this case will be |
Hmmm Something not quite right. |
The cache directory is only available for that specific phase (install/bundle). If that directory is needed for both phases then make sure to set both cache env vars. If that directory is needed for runtime that we can't the nixpacks caching mechanism since. However, often there is a subdirectory (e.g. /root/.stack/cache) that can be cached. |
I've closed the issue since the original bug is fixed. However, if you figure out the best directories to cache please lmk (or make a PR). Still interested in improving the Haskell build times 😄 |
Is there an existing issue for this?
Describe the bug
I'm trying to deploy a fairly straightforward haskell (servant project).
I've specified
zlib
andzlib.dev
in--pkgs
but I'm still running into:To reproduce
I would guess this should reproduce with most haskell project (zlib is a common pain).
I will try to repro and fix in vanilla nix locally.
Expected behavior
I would have expected the
stack build
to succeed.Environment
Local:
Ubuntu
Railway project ID is
042095d5-6077-432c-ac60-351f0dffc072/service/267f19e6-9a03-428f-ab79-2f2beace373f
The text was updated successfully, but these errors were encountered: