-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
nixos-install: clear executable cache after entering chroot #355269
nixos-install: clear executable cache after entering chroot #355269
Conversation
Clear the cache for executable locations after entering the chroot. The cached locations are no longer valid there. This resolves problems with nixos-install failing to find binaries from coreutils as witnessed in NixOS#241356.
PS: if you try to reproduce that executable caching behavior of bash, you need to run it in non-interactive mode (i.e. |
@xaverdh first time I'm testing such a PR, how can I declare my nixpkgs as pointing to yours ? I'm using flakes if that helps. |
You can build the nix build github:NixOS/nixpkgs/refs/pull/355269/head#nixos-install and then run |
Confirmed working on my use case, I don't get the "X not in PATH" error with this MR and I get it on regular nixpkgs |
cc @Mic92 |
Using overlays = [
# <https://github.com/NixOS/nixpkgs/pull/355269>
(final: super: {
nixos-install = super.nixos-install.overrideAttrs (old: {
patches = old.patches or [ ] ++ [ ../patches/nixos-install-no-coreutils-caching.patch ];
});
})
]; with the most recent I took the patch from https://github.com/NixOS/nixpkgs/pull/355269.patch I may have done something wrong, but I'm unsure what if so |
can you see the patch getting applied (in the build output)? |
|
I run into the issue, the patch didn't fix it for me. Command:
Output:
I see the same error without the patch, only on line 8. I'm on arch linux. I run into it when I tried to setup a new system using |
The original bug fix was for coreutils. Not finding mount might be a different bug. |
@ tom-kuca can you try adding . /etc/profile right after (or instead of) |
@xaverdh It works, the script finishes successfuly. |
here you go: #365403 |
Clear the cache for executable locations after entering the chroot. The cached locations are no longer valid there.
This
hopefullyindeed resolves problems with nixos-install failing to find binaries from coreutils as witnessed in #241356 fixing it.Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.