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

@malbarbo malbarbo commented Nov 28, 2019

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")

This comment has been minimized.

@nh2

nh2 Nov 28, 2019
Contributor

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

This comment has been minimized.

@malbarbo

malbarbo Dec 5, 2019
Author Contributor

I added a comment.

@malbarbo malbarbo force-pushed the malbarbo:e2fsprogs-shared branch from 2140473 to f6ea330 Dec 5, 2019
@nh2
nh2 approved these changes Dec 6, 2019
@nh2
Copy link
Contributor

@nh2 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
14 checks passed
14 checks passed
Evaluation Performance Report Evaluator Performance Report
Details
e2fsprogs on aarch64-linux Success
Details
e2fsprogs on x86_64-linux Success
Details
grahamcofborg-eval ^.^!
Details
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
grahamcofborg-eval-darwin nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A darwin-tested
Details
grahamcofborg-eval-nixos nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release-combined.nix -A tested
Details
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release.nix -A manual
Details
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release.nix -A options
Details
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A manual
Details
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A tarball
Details
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A unstable
Details
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details
nh2 added 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 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;

This comment has been minimized.

@nh2

nh2 Jan 30, 2020
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.