Open thufschmitt opened 3 years ago
It also fails on some not naughty strings with practical use-cases: I need to pass an environment variable containing windowsy path as part of a cross-compilation setup. The following fails:
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
rec {
devShell = nixpkgs.legacyPackages.${system}.mkShell (rec {
CARGO_TARGET_X86_64_PC_WINDOWS_MSVC_RUSTFLAGS = "-C link-arg=/pdbsourcepath:X:\\source -C link-arg=/pdbaltpath:X:\\output\\%_PDB%";
});
}
);
}
with this error:
error: shell environment '/nix/store/ahf9fdjjy696fy611ia894ifhppnx1ic-nix-shell-env' has unexpected line 'CARGO_TARGET_X86_64_PC_WINDOWS_MSVC_RUSTFLAGS='-C link-arg=/'
nix --version
output: nix (Nix) 2.4pre20210601_5985b8b
@roblabla I think this should have been fixed by https://github.com/NixOS/nix/pull/4997. Can you double-check?
With stdenv: add isMachO helper function merged, naughty strings now find their way into nixpkgs, and breaks nearly every nix develop
invocation.
@NickCao With nix master?
reproduced on master.
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/ff748a82a5fff004c952f32eacd64604a6f4036f";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = import nixpkgs { inherit system; };
in
{
devShell = pkgs.mkShell {
nativeBuildInputs = with pkgs;[ hello ];
};
}
);
}
nix run github:NixOS/nix/1ec4efa6c82fb6d90887c21aa7c7c6f3c644dd65 print-dev-env
With stdenv: add isMachO helper function merged, naughty strings now find their way into nixpkgs, and breaks nearly every
nix develop
invocation.
This is due to our use of declare -F
to retrieve the loaded functions in get-env.sh
.
I opened an issue at https://github.com/NixOS/nix/issues/5262 with further context, but unsure if that should be closed in favor of this one.
I marked this as stale due to inactivity. → More info
Describe the bug
Some special strings cause an error in
nix print-dev-env
(andnix develop
). #4983 does fix some of these, but trying to test this against https://github.com/minimaxir/big-list-of-naughty-strings quickly raises the same error.Steps To Reproduce
Run
nix develop
on the following flake:Expected behavior
Should work™
nix-env --version
output