Skip to content
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

e2fsprogs: allow static build #74485

Merged
merged 1 commit into from Dec 6, 2019
Merged

e2fsprogs: allow static build #74485

merged 1 commit into from Dec 6, 2019

Conversation

malbarbo
Copy link
Contributor

Motivation for this change

This enable building pkgsStatic.e2fsprogs.

The zlib changes is to avoid the error

disk-utils/fsck.cramfs.c:53:10: fatal error: zlib.h: No such file or directory

which makes sense because zlib.static does not include headers.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @edolstra (listed as e2fsprogs mantainer)
cc @nh2 @matthewbauer (involved in static build of zlib)

@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {

configureFlags =
if stdenv.isLinux then [
"--enable-elf-shlibs"
(if shared then "--enable-elf-shlibs" else "--disable-elf-shlibs")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you indicate with a comment whether e2fsprogs is one of the (few) problems where one can only build static XOR dynamic?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a comment.

@nh2
Copy link
Contributor

nh2 commented Dec 6, 2019

10.rebuild-linux: 0, 2 approvals and it looks good, merging.

@nh2 nh2 merged commit 3ccbce4 into NixOS:master Dec 6, 2019
nh2 pushed a commit to nh2/nixpkgs that referenced this pull request Dec 6, 2019
Backport of NixOS#74485. Fixes NixOS#71813.

(cherry picked from commit f6ea330)
@nh2
Copy link
Contributor

nh2 commented Dec 6, 2019

If we want a backport to 19.09, I've resolved the merge-conflicts here:

release-19.09...nh2:issue-71813-pr-74485-backport-19.09


# Don’t use new stdenv zlib because
# it doesn’t like the --disable-shared flag
stdenv = super.stdenv;
}).static;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just learned that this change accidentally also fixed more severe issues (nh2/static-haskell-nix#73):

nix-shell -p 'pkgsStatic.zlib.override {}' did not work until this commit, it errored:

error: attribute 'override' missing, at (string):1:94

FYI @malbarbo @dtzWill @matthewbauer

It appears that we must never use .static or other split outputs in things like static.nix because they are not overridable. (copied from nh2/static-haskell-nix#73 (comment))


Also interesting is that pkgsStatic.zlib has nonsensical attributes like cmakeFlags (even though it does not use cmake) from here in the make-derivation.nix case of lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform): https://github.com/nh2/nixpkgs/blob/11aa987ea5b5a593c9ca7a38b391804959f905e5/pkgs/stdenv/generic/make-derivation.nix#L245-L254

@malbarbo malbarbo deleted the e2fsprogs-shared branch June 18, 2021 17:58
@malbarbo malbarbo restored the e2fsprogs-shared branch June 18, 2021 19:33
@malbarbo malbarbo deleted the e2fsprogs-shared branch June 18, 2021 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants