-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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: Properly clean up static/shared distinction #66490
Conversation
@GrahamcOfBorg build zlib |
b6e2ad4
to
bd66819
Compare
The comments look good, but I'm a little bit surprised this needs to be a mass rebuild. I didn't think dontDisableStatic would be needed at all,
Changing the order seems reasonable though, at least to make things more clear. Not sure why it has that behavior, but my understanding was that zlib just always assumed you wanted static libraries. |
@matthewbauer Can you elaborate a bit on that? I thought that's passed in general, is there an exception for zlib somehwere that I could refer to?
I wasn't sure if there's anyone who wants the I didn't find many uses of it; what's the best way to find them all?
As far as I can tell, |
bd66819
to
5647474
Compare
Ah I see: nixpkgs/pkgs/stdenv/generic/setup.sh Lines 993 to 998 in 6490f9c
This greps for
I've pushed a fix that should avoid mass rebuilds, with extra commentary for rationale. |
@GrahamcOfBorg eval @GrahamcOfBorg build zlib |
This improves what commit e999def zlib: clean up static/shared distincion described as "kind of a mess" and "confusing". And indeed it was confusing. Now, the concept whether or not the .a file is moved to a split output is controlled by a clean variable. The defaults remain unchanged. The new approach also finally cleanly allows building statically but NOT using a split output, like all other autoconf-based projects in nixpkgs do (using the `dontDisableStatic` setting). That is important for overlays that want to enable static libs for all packages in one go, without having to hand-patch idiosynchrasies like zlib had until now. Until now, if you wanted the .a in the main output, the only way was to go via `static=false, shared=true` -- which made no sense, because you had to say `static=false` even though you want a static lib. That is fixed now.
5647474
to
3d87db9
Compare
madler/zlib#394 may it someday be better upstream. |
I have filed a separate issue for this task at #66658. |
Our submodule now includes the fix from NixOS/nixpkgs#66490 which makes this unnecessary.
Our submodule now includes the fix from NixOS/nixpkgs#66490 which makes this unnecessary.
Our submodule now includes the fix from NixOS/nixpkgs#66490 which makes this unnecessary.
Our submodule now includes the fix from NixOS/nixpkgs#66490 which makes this unnecessary.
Our submodule now includes the fix from NixOS/nixpkgs#66490 which makes this unnecessary.
Includes #66486 (a simple comments change) which is for
master
, while this is forstaging
.Motivation for this change
The previous logic was "grown" and has become pretty crazy to understand.
This improves what commit e999def (zlib: clean up static/shared distincion) described as "kind of a mess" and "confusing". And indeed it was confusing.
Now, the concept whether or not the .a file is moved to a split output is controlled by a clean variable.
The defaults remain unchanged.
The new approach also finally cleanly allows building statically but NOT using a split output, like all other autoconf-based projects in nixpkgs do (using the
dontDisableStatic
setting).That is important for overlays that want to enable static libs for all packages in one go, without having to hand-patch idiosynchrasies like zlib had until now.
Until now, if you wanted the .a in the main output, the only way was to go via
static=false, shared=true
-- which made no sense, because you had to saystatic=false
even though you want a static lib. That is fixed now.Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)shared
,static
andsplitStaticOutput
, checking that the files in the outputs are as expected.Notify maintainers
cc @matthewbauer