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

busybox: bump copybuf, disable utmp/wtmp when not supported (musl) #34207

Merged
merged 2 commits into from Feb 10, 2018

Conversation

dtzWill
Copy link
Member

@dtzWill dtzWill commented Jan 23, 2018

64 is the value debian uses.
utmp/wtmp are used by who and last, and are currently misleading or broken
when building busybox with musl. Disabling is cleaner (and smaller).

  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • 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 nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@@ -24,6 +24,10 @@ let
}
'';

libcConfig = lib.optionalString (useMusl || stdenv.cc.libc == "musl") ''
Copy link
Member

Choose a reason for hiding this comment

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

Can do useMusl ? stdenv.hostPlatform.libc == "musl" in the arguments and assert stdenv.hostPlatform.libc == "musl" -> useMusl; down below?

Copy link
Member

Choose a reason for hiding this comment

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

Oh and that needs to be stdenv.hostPlatform.libc. stdenv.cc.libc is the actual derivation.

Copy link
Member Author

Choose a reason for hiding this comment

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

d'oh! Changed is last minute--locally I have stdenv.isMusl O:) which is slated to at least become hostPlatform.isMusl (and similar) but I haven't done so yet O:).

Will fix, thank you!

(FWIW some form of isMusl and isGlibc would prevent this sort of mistake, since it would fail to evaluate if typo or whatnot O:))

But that's not what this PR is about!

@dtzWill
Copy link
Member Author

dtzWill commented Jan 24, 2018

Fixed, sorry about that. Noticed too that this only matters when building bootstrapTools using useMusl but not using enableMinimal, which I don't think is currently used in nixpkgs. Might as well do things right, though! :)

@Ericson2314
Copy link
Member

Ericson2314 commented Jan 24, 2018

Probably best for someone else to review too for the not cross/stdenv-related bits? But looks good to me. Eventually, when we've committed all your musl-cross stuff, I soon as well just get rid of useMusl and rely on that, but this is the right first step. Thanks!

@grahamc
Copy link
Member

grahamc commented Jan 24, 2018

@GrahamcOfBorg build busybox

Copy link

@GrahamcOfBorg GrahamcOfBorg left a comment

Choose a reason for hiding this comment

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

Failure for system: x86_64-darwin

Package ‘busybox-1.28.0’ in /Users/graham/nix-borg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-zoidberg/pkgs/os-specific/linux/busybox/default.nix:100 is not supported on ‘x86_64-darwin’, refusing to evaluate.

a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowBroken = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowBroken = true; }
to ~/.config/nixpkgs/config.nix.

Copy link

@GrahamcOfBorg GrahamcOfBorg left a comment

Choose a reason for hiding this comment

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

Success for system: x86_64-linux


post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/wjb94grmm51f4yz697bjg6xm2nlr50fg-busybox-1.28.0
shrinking /nix/store/wjb94grmm51f4yz697bjg6xm2nlr50fg-busybox-1.28.0/bin/busybox
strip is /nix/store/vi79f177brsaqgiarjldil74cbryy3hn-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/wjb94grmm51f4yz697bjg6xm2nlr50fg-busybox-1.28.0/bin  /nix/store/wjb94grmm51f4yz697bjg6xm2nlr50fg-busybox-1.28.0/sbin 
patching script interpreter paths in /nix/store/wjb94grmm51f4yz697bjg6xm2nlr50fg-busybox-1.28.0
checking for references to /tmp/nix-build-busybox-1.28.0.drv-0 in /nix/store/wjb94grmm51f4yz697bjg6xm2nlr50fg-busybox-1.28.0...
moving /nix/store/wjb94grmm51f4yz697bjg6xm2nlr50fg-busybox-1.28.0/sbin/* to /nix/store/wjb94grmm51f4yz697bjg6xm2nlr50fg-busybox-1.28.0/bin
/nix/store/wjb94grmm51f4yz697bjg6xm2nlr50fg-busybox-1.28.0

@dtzWill
Copy link
Member Author

dtzWill commented Jan 24, 2018

@Ericson2314 yeah it's not very cross-related IMO :).

Mostly saw the copybuf thing and figured I'd make sure we weren't getting unnecessarily poor performance in scenarios where the tools were used.

Not a huge priority either, even on musl--it still builds it just creates bad tools :).

Copy link

@GrahamcOfBorg GrahamcOfBorg left a comment

Choose a reason for hiding this comment

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

Success for system: aarch64-linux

/nix/store/phcvaw2p525izw6g0iqp36lr2p9p868p-busybox-1.28.0

@Ericson2314
Copy link
Member

Anyone else gonna review this? Or should I just merge?

@dtzWill
Copy link
Member Author

dtzWill commented Feb 1, 2018

(rebased and fixed typo in setting copybuf value (!))

@Mic92
Copy link
Member

Mic92 commented Feb 10, 2018

@GrahamcOfBorg build busybox

@GrahamcOfBorg
Copy link

Failure on x86_64-darwin (full log)

Partial log (click to expand)

Package ‘busybox-1.28.0’ in /Users/graham/nix-borg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-ndnd/pkgs/os-specific/linux/busybox/default.nix:100 is not supported on ‘x86_64-darwin’, refusing to evaluate.

a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowBroken = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowBroken = true; }
to ~/.config/nixpkgs/config.nix.

@GrahamcOfBorg
Copy link

Failure on aarch64-linux (full log)

Partial log (click to expand)

make: *** [Makefile:857: include/config/MARKER] Error 2
make: *** Waiting for unfinished jobs....
  GEN     include/usage_compressed.h
  GEN     include/applet_tables.h include/NUM_APPLETS.h
  GEN     include/applet_tables.h include/NUM_APPLETS.h
  HOSTCC  applets/usage_pod
  CC      applets/applets.o
  LD      applets/built-in.o
builder for '/nix/store/cp273ax3g7kalqlpij6i85glfjg982ns-busybox-1.28.0.drv' failed with exit code 2
error: build of '/nix/store/cp273ax3g7kalqlpij6i85glfjg982ns-busybox-1.28.0.drv' failed

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Partial log (click to expand)


post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/pmyl82gqggp1d63x9nxjds7117p27v62-busybox-1.28.0
shrinking /nix/store/pmyl82gqggp1d63x9nxjds7117p27v62-busybox-1.28.0/bin/busybox
strip is /nix/store/5qj61lcvzlap87rf6blvf8p577d482bv-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/pmyl82gqggp1d63x9nxjds7117p27v62-busybox-1.28.0/bin  /nix/store/pmyl82gqggp1d63x9nxjds7117p27v62-busybox-1.28.0/sbin 
patching script interpreter paths in /nix/store/pmyl82gqggp1d63x9nxjds7117p27v62-busybox-1.28.0
checking for references to /tmp/nix-build-busybox-1.28.0.drv-0 in /nix/store/pmyl82gqggp1d63x9nxjds7117p27v62-busybox-1.28.0...
moving /nix/store/pmyl82gqggp1d63x9nxjds7117p27v62-busybox-1.28.0/sbin/* to /nix/store/pmyl82gqggp1d63x9nxjds7117p27v62-busybox-1.28.0/bin
/nix/store/pmyl82gqggp1d63x9nxjds7117p27v62-busybox-1.28.0

@Mic92 Mic92 merged commit c69686e into NixOS:staging Feb 10, 2018
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

5 participants