Closed flokli closed 4 years ago
Oh, interesting. That means /bin/sh
is being used somewhere in systemd's build system and calls 'ar' as a builtin command (probably via meson
).
One could say it's a bug in systemd's .nix
package definition. It should call ar by absolute path and not rely on a builtin alias.
I wonder if installing nix
using nix
would be enough to pull in bash as a sandbox or we already persist it into nix-daemon
.
But sys-apps/nix
should strive to provide /bin/bash
as a /bin/sh
if possible.
/bin/sh
should point to a minimal sh
, not bash.
On NixOS, it's pointing to that one here: https://github.com/NixOS/nixpkgs/blob/master/pkgs/os-specific/linux/busybox/sandbox-shell.nix . It's configured to be used here: https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/package-management/nix/default.nix#L89
Can't you build a similar one via portage and configure nix to this one?
You can change default config in /etc/portage/savedconfig/sys-apps/busybox-*
and rebuild sys-apps/busybox
. We can have a separate ebuild just for nix.
@trofi I'm not really a gentoo user anymore, but wanted to report that bug with the Gentoo ebuild regardless.
I think a separate ebuild for the nix busybox sounds like the right way to go forward ([busybox-]sandbox-shell
is how it's called in nixpkgs and nix).
Thanks for all the hints!
https://github.com/trofi/nix-guix-gentoo/commit/508ab8379faeb7e4c772eae99250758b6c263578 fixes at least systemd build for me.
When using
nix
provided via this overlay,/bin/sh
is pointed to gentoo's/bin/busybox
, instead of a nix-built busybox:Nix installed via https://nixos.org/nix/ :
Nix installed via this overlay:
This seems to cause build processes to pick the
busybox
-providedar
instead ofbinutil
'sar
(which does support thes
option)nix-build -A systemd
from a nixpkgs checkout:cc @heijligen