-
Notifications
You must be signed in to change notification settings - Fork 237
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
Add support for static nix-tools #2157
Conversation
nix-tools/static/outputs.nix
Outdated
static-gmp = (final.gmp.override { withStatic = true; }).overrideDerivation (old: { | ||
configureFlags = old.configureFlags ++ [ "--enable-static" "--disable-shared" ]; | ||
}); | ||
static-libblst = (final.libblst.override { enableShared = false; }).overrideDerivation (old: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[diff] reported by reviewdog 🐶
static-libblst = (final.libblst.override { enableShared = false; }).overrideDerivation (old: { | |
static-libblst = (final.libblst.override { enableShared = false; }).overrideDerivation (_old: { |
}; | ||
|
||
|
||
zippedToolsNoIfdFor = fragment-name: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should document this in detail, why we need this, and what the issue with keeping IFDs is, and why using recursive-nix helps us here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general this looks good. I'm not that much a fan of splitting flake files into multiple files 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure why the overlays for the crypto libs are included here but the rest looks good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to include the GitHub actions as well?
nix-tools/static/project.nix
Outdated
|
||
apply-hnix-patches = { | ||
packages.hnix.patches = [ | ||
(builtins.toFile "plutus-core.patch" '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?????????
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea why this is named the way it's named. I guess I will just rename it.
nix-tools/static/outputs.nix
Outdated
|
||
|
||
static-libraries-overlay = final: _prev: { | ||
static-libsodium-vrf = final.libsodium-vrf.overrideDerivation (old: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't used by nix-tools
???
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's used here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean... where you added a series of probably unnecessary static library dependencies? We can't just randomly copy this stuff around, it has to depend on what libraries the package actually uses!
This PR seems to have a lot of stuff in it related to building static Cardano packages which shouldn't be at all necessary for building |
cea5dc8
to
a7f944d
Compare
I see, I can try removing all of these (except static-gmp --- I suppose we need that one) and see what happens. If it builds, then we don't need |
19dbbc3
to
5c67a95
Compare
c1a50f2
to
600297b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file seems to only have formatting changes. If we want to do formatting, let's do this differently, but not throw into Pull Requests.
f5d0be2
to
7c0cb47
Compare
7c0cb47
to
4e0943a
Compare
# Conflicts: # lib/cabal-project-parser.nix
Use static versions of
nix-tools
. Because these form the foundation of IFDs in haskell.nix, having them as download-unpack-and-run available should speed up evaluation and IFDs significantly. Previously we dynamically built them on-demand, but that meant that not only the dependency closures were larger (including potentially build tools, ...) but also when ever there was a change to haskell.nix that invalidated the nix-tools build plan, they were re-built on demand.By decoupling both, we should be able to cut the worst-case scenario to download time + unpack time + runtime of the nix-tools.