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

nix busybox shell: fix config and enable expected features #34628

Merged
merged 2 commits into from Feb 5, 2018

Conversation

dtzWill
Copy link
Member

@dtzWill dtzWill commented Feb 5, 2018

Fixes known build failures stemming from /bin/sh not
having expected features.

Most of these are enabling POSIX features, but not all.

Resulting busybox grows from 120K -> 140K which seems reasonable.

  • 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.

@edolstra edolstra merged commit b1273f2 into NixOS:staging Feb 5, 2018
@dtzWill
Copy link
Member Author

dtzWill commented Feb 5, 2018

@dezgeg (and anyone else): this shell has resolved all of the build failures (and annoying extra newlines in "configure" output haha) that I've seen. Please LMK if you find any others! Hopefully this matter is resolved 👍.

dtzWill added a commit to dtzWill/nix that referenced this pull request Feb 5, 2018
@dtzWill dtzWill deleted the fix/nix-busybox-shell-features branch February 5, 2018 16:31
@edolstra
Copy link
Member

edolstra commented Feb 6, 2018

@dtzWill The busybox shell build now fails with:

/build/busybox-1.28.0/scripts/generate_BUFSIZ.sh: line 56: syntax error: you disabled math support for $((arith)) syntax
make: *** [Makefile:857: include/config/MARKER] Error 2
make: *** Waiting for unfinished jobs....

@dezgeg
Copy link
Contributor

dezgeg commented Feb 6, 2018

So you need to build it with an old Nix which lacks the busybox thing completely then? :P

@dtzWill
Copy link
Member Author

dtzWill commented Feb 6, 2018

Yes, that's not the fault of this PR but rather the underlying problem this fixes.

(And the awkwardness of even getting back to a good state once you start using the limited busybox shell is part of why I was so eager to see this fixed)

@grahamc grahamc mentioned this pull request Feb 10, 2018
8 tasks
@dezgeg
Copy link
Contributor

dezgeg commented Feb 13, 2018

Got this:

../include/install-sh -o 1000 -g 100 -m 755 -d /nix/store/fpk1kslcfrn653rh0aqas7dx843ikm0g-attr-2.4.47-bin/bin
../include/install-sh: line 152: getopts: not found
cp: invalid option -- 'o'
Try 'cp --help' for more information.
make[1]: *** [Makefile:32: install] Error 1
make[1]: Leaving directory '/build/attr-2.4.47/attr'
make: *** [Makefile:101: attr-install] Error 2
builder for '/nix/store/1dbzbv563zgb1x21r9gwry5d95236qf2-attr-2.4.47.drv' failed with exit code 2
cannot build derivation '/nix/store/rb05g9y44y13f7vnsnffs8r34xsamhqv-acl-2.2.52.drv': 1 dependencies couldn't be built

@dtzWill
Copy link
Member Author

dtzWill commented Feb 13, 2018

@dezgeg details?

Sounds like you're running into the sort of problem that motivated this, see the start of a table I made about failures encountered in packages: NixOS/nix#1832 (comment)

Good news is some amount of latest-all-the-things should fix things for you.

@dezgeg
Copy link
Contributor

dezgeg commented Feb 13, 2018

Ah, I see it's already in that table. This was on the community aarch64 box and I was under the impression that Nix already got updated once but apparently still not new enough. It's running nix-env (Nix) 2.0pre5889_c287d731.

@dtzWill
Copy link
Member Author

dtzWill commented Feb 13, 2018

That's new enough but I think NixOS needs to be equally new....

Anyway, I can confirm the busybox on the aarch64 community builder isn't fixed yet:

$ nix-store -q --references $(which nix)|grep busy
/nix/store/mrbj338a1j2y712mgkyis9v4gpcd5qk7-busybox-1.28.0

[dtz@nixos:~]$ nix log /nix/store/mrbj338a1j2y712mgkyis9v4gpcd5qk7-busybox-1.28.0|grep GETOPT
[0.0 MiB DL]
getopt (5.6 kb) (GETOPT) [Y/n/?] (NEW) n
  getopts builtin (ASH_GETOPTS) [Y/n] (NEW) n
getopt (5.6 kb) (GETOPT) [N/y/?] n
  getopts builtin (ASH_GETOPTS) [N/y] n
getopt (5.6 kb) (GETOPT) [N/y/?] n
  getopts builtin (ASH_GETOPTS) [N/y] n

[dtz@nixos:~]$ 

vs locally (fixed):

$ nix log $(nix-store -q --references $(which nix)|grep busy)|grep GETOPT
getopt (5.6 kb) (GETOPT) [Y/n/?] (NEW) n
  getopts builtin (ASH_GETOPTS) [Y/n] (NEW) n
getopt (5.6 kb) (GETOPT) [N/y/?] n
  getopts builtin (ASH_GETOPTS) [N/y] n
parseconfig: removing CONFIG_ASH_GETOPTS
parseconfig: setting CONFIG_ASH_GETOPTS=y
getopt (5.6 kb) (GETOPT) [N/y/?] n
  getopts builtin (ASH_GETOPTS) [Y/n] y

(these commands are a bit brittle but hopefully you get the idea :))

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

Successfully merging this pull request may close these issues.

None yet

3 participants