-
Notifications
You must be signed in to change notification settings - Fork 107
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
zlib doesn't build with nix-build -A exe --no-out-link #1068
Comments
zlib links against a C library (zlib). I don’t think it is possible to use zlib with ghcjs. |
Are you sure? I have found a few references to zlib being used with GHCJS online, and it seems like there are some special build instructions for building it: https://github.com/haskell/zlib/blob/master/zlib.cabal#L70C1-L74C55 |
I tried sidestepping this issue by using the HTTP package instead, but that package fails because the host system
|
Ah, interesting. Then maybe the issue is simply that the used nix derivation is for the default platform and thus still has a c-zlib dependency. Maybe you can fix that with an override |
When I put that inside
I get the following error:
|
Funny enough, it's failing when compiling for the backend. I get the same error when running |
Running |
Well, I think you need to make this override conditional on the compiler being ghcjs. Something like |
The override needs to be something like |
I see, thank you, I made a typo in the original file, I'm building it with |
I didn't know you could do that, I will give it a shot, thanks! |
Using
building with
|
Well maybe the same issue now? network doesn't sound like something which should be in the dependency closure of a js app? |
Yes, maybe I will have to split my project into two parts, one for frontend and another for backend. It seems like when specifying the frontend part as a library within the same cabal file, running |
It seems like |
I stopped the dependencies from being built by simply using Cabal conditional statements:
It seems a bit hacky compared to having two library definitions, but it's the only thing I have gotten to work. Thanks so much for all the help @maralorn! Should I close this? |
Thanks @maralorn! |
Hello!
I recently introduced a library that depends on
zlib
to my website. Runningob run
works fine, but compiling it withnix-build -A exe --no-out-link
results in the following error:I think it's related to GHCJS or some sort of cross compilation.
I haven't found a solution yet.
I found some relevant issues, for instance: https://stackoverflow.com/questions/66005898/haskell-ghcjs-with-diagrams-gives-error-no-c-compiler-provided-for-this-platfor
The text was updated successfully, but these errors were encountered: