-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
Provide middle-ground overlay between pkgsMusl and pkgsStatic #61575
Comments
So what's the deal with static libs and GHCi/TH? It used to work? CC @angerman |
Yeah I was hoping we could use |
Related: I asked on
@angerman said:
@cocreature said:
|
My main concern with building both dynamic and static is that build systems will get messed up when they see both. They might try to use the wrong one and do the wrong thing. It's better they fail than do the wrong thing here. It's very similar to why we don't build multi-target things as well. Nix means "nothing", not everything 😸 . |
@matthewbauer In what situation does that happen though? Most build systems have a flag that controls whether you want static or dynamic exes. If you link with
|
So from the GHC quotes this does sound quite fixable? |
Everything is fixable if you apply enough WD40 and/or duct tape. |
@Ericson2314 It is possible, but what I'm looking for is a way to get static Linux builds immediately using only as-standard-as-possible approaches without teaching GHC new things. The easiest way to get there is to have That is not to say there's no merit in also working on the other approaches, but because these things have users already right now, I'd like to move them to nixpkgs rather sooner than later, because maintaining all the C library overrides to add |
@nh2 I'm mainly just worried about arbitrary non-Haskell packages misbehaving when both are available. When I say it sounds easy to change GHC, I mean easy to write a patch and backport it to use in nixpkgs immediately. Based only my experience working on Cabal in the past, and working on GHC now, I'd say landing GHC patches is easier in general too, lest your experience with the Cabal patch makes it seem that any upstream change is invariably a chore. |
@Ericson2314 Do you have an example? What kind of scenario do you have in mind?
I don't doubt that we can do thinkgs quickly in both GHC and nixpkgs, but I'm unclear on what exactly we need to do on the GHC side to make it never look at In general, is there a drawback to what I propose (having one place / adapter / overlay that simply enables |
Thank you for your contributions. This has been automatically marked as stale because it has had no activity for 180 days. If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity. Here are suggestions that might help resolve this more quickly:
|
I'm still interested in doing this. |
By far the most common error I run into when using the current
Hopefully the new proposed |
I would like to see a better definition of what the in-between state means. As I see see it, there are two things going on:
In particular this is not a libraries vs executables distinction. Those two choices are almost orthogonal, except:
I am quite tempted to say for the first one that we should always produce .so and .a, putting .a in a separate output and making stdenv smart enough to make it not suck. Related I hope we can handle windows DLLs better, with their separate |
https://www.tweag.io/blog/2020-09-30-bazel-static-haskell/ This seems to be another valid solution that doesn't require a mixed static/shared overlay.
|
@rnhmjoj From the blog post:
@aherrmann @lunaris what GHC config did you use to make that work? |
https://github.com/lunaris/minirepo is a bit old now but should still work and shows pretty much all the tricks we pull to build GHC and a Stackage set in Bazel, including C-level library linking for common cases. Disclaimer: We are still on 8.6.5. I've tried and failed moving to 8.8., 8.10. and 8.12.* -- while I can get GHC to build, it segfaults when compiling our repository. These could be real GHC bugs, but I suspect have something to do with the fact our GHC is linked with Musl and/or the size of our repository. I'd be interested to here if others got it working with later GHC versions. |
@expipiplus1 have similar issue as well in my branch trying to update via nix statically compiled postgrest (haskell package). |
@lunaris I'm in the middle of figuring out the segfault (or at least: a segfault) currently: #118731 (comment) |
(Not sure how much of a special case |
nixpkgs upstreaming PR: NixOS#243161
nixpkgs upstreaming PR: NixOS#243161
nixpkgs upstreaming PR: NixOS#243161
nixpkgs upstreaming PR: NixOS#243161
nixpkgs upstreaming PR: NixOS#243161
nixpkgs upstreaming PR: NixOS#243161
Trying using #279413 results into:
|
Looks like #275304 |
Issue description
For my work on static-haskell-nix I need an overlay that has both
.so
files and.a
files.This is because I need
.a
s for linking Haskell exes statically, but.so
files for executing TemplateHaskell.Right now
pkgsStatic
not only adds.a
files, but also disables.so
files:makeStaticBinaries
andmakeStaticLibraries
set--disable-shared
static.nix
uses thosestatic.nix
disables shared Haskell libs that TH needsProposal
I think we should have the following stack of overlays:
pkgsMusl
is what it is now: All packages using musl libcpkgsStatic
should be the one that has.a
files added to all libraries (in addition to.so
files), and all binaries (including Haskell ones) linked statically where possiblepkgsStaticOnly
should be whatpkgsStatic
is now: Having only static libraries and binaries, getting rid of.so
files.CC @matthewbauer @Ericson2314 @dtzWill @nmattia
The text was updated successfully, but these errors were encountered: