-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 develop --command nix build
fails for some derivations in nixos/nix
docker image
#8355
Comments
How? What breaks? Do you have logs? |
Yes, they're in the readme of the repo linked in the first sentence. I'll reproduce the logs for the incorrect behavior here:
I'll inline the {
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-unstable";
};
outputs = {
self,
nixpkgs,
}:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in
{
packages.${system}.default = pkgs.runCommandLocal "wat" {} ''
touch $out
echo wat > $out
'';
devShells.${system}.default = pkgs.mkShell {};
};
} |
Something about the docker container seems to break how --- a/flake.nix
+++ b/flake.nix
@@ -17,6 +17,8 @@
echo wat > $out
'';
- devShells.${system}.default = pkgs.mkShell {};
+ devShells.${system}.default = pkgs.mkShell {
+ shellHook = "unset TMPDIR";
+ };
};
} |
Huh, yeah, I can confirm that makes it work in all cases. Very strange. |
I have the same issue : it works on my machine but fails in the CI or on my machine inside a container https://gitlab.com/pinage404/nix-sandboxes/-/jobs/4634026045#L1000 even adding https://gitlab.com/pinage404/nix-sandboxes/-/jobs/4663181133#L1007 |
nix develop --command nix build
fails for some derivations in nixos/nix:2.15.0
docker imagenix develop --command nix build
fails for some derivations in nixos/nix
docker image
Just dropping by to say this problem persists in 2.19.2 (hence the title change). |
Issue is still in |
Still an issue in nix 2.23.1. In an alpine image with installed nix. |
I get this error too: I do in an alpine container (root) after entering the devShell with
Then the following can be observed with
This might look to me as a newbie the different |
I have the most minimal reproduction I could come up with here using
nixos/nix:2.15.0
.Basically, the bug is that running
nix develop --command nix build
breaks, but only in the docker image. On my actual machine, this works fine. Additionally, runningnix build
withoutnix develop --command
works fine both on my actual machine and in the container. This is all explained/demonstrated in the linked repository.It's unknown to me whether this is reproducible with non-flakes equivalents, I didn't try.
I've also just noticed that changing
packages.${system}.default
to:does not reproduce the issue.
However, given that this behavior only arises depending on where (i.e. in or out of a docker container) nix is being invoked, I think this issue belongs here rather than nixpkgs.
Priorities
Add 👍 to issues you find important.
The text was updated successfully, but these errors were encountered: