-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
Open
Labels
2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.mdhttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md
Description
Issue description
nativeBuildInputs puts binaries of the wrong architecture on the PATH. That is, binaries cannot be executed on the build architecture.
Note, I am somewhat afraid I could just have misunderstood everything about cross compilation in nixpkgs.
Steps to reproduce
consider this file:
with import <nixpkgs> {
crossSystem = { config = "aarch64-unknown-linux-gnu"; };
};
stdenv.mkDerivation {
name = "foo";
nativeBuildInputs = [ pkgconfig ];
strictDeps = true;
buildCommand = ''
echo PATH=$PATH
echo nbi=$nativeBuildInputs
pkg-config --version
touch $out
'';
}When building it I get
these derivations will be built:
/nix/store/layqrjhacamrnpf4fy8k7ww05kzyy8j5-foo-aarch64-unknown-linux-gnu.drv
building '/nix/store/layqrjhacamrnpf4fy8k7ww05kzyy8j5-foo-aarch64-unknown-linux-gnu.drv'...
PATH=/nix/store/mwsk6nin4rxsbghfhqxzk9lcsk09nbbl-pkg-config-0.29.2-aarch64-unknown-linux-gnu/bin:/nix/store/bqp3d4yhpx6h60fv8jww5id0nkm44034-patchelf-0.9/bin:/nix/store/63j8mi5vjyxfc89rhjknwxaxqg3a2s
x2-paxctl-0.9/bin:/nix/store/xswqhzlmxyc1s21kqdiyb7hl62560gpm-aarch64-unknown-linux-gnu-stage-final-gcc-debug-wrapper-7.3.0/bin:/nix/store/dsn74vd7k0mqqmkc7plgdhbav2v9v515-aarch64-unknown-linux-gnu-s
tage-final-gcc-debug-7.3.0/bin:/nix/store/cpxkl6k01lh3wkaw2fv8xz8v60j43n4s-glibc-2.27-aarch64-unknown-linux-gnu-bin/bin:/nix/store/wm8va53fh5158ipi0ic9gir64hrvqv1z-coreutils-8.29/bin:/nix/store/gp0aj
2lxhrlkqf0g4f38dg5hqg45fnad-aarch64-unknown-linux-gnu-binutils-wrapper-2.30/bin:/nix/store/nncs4b6jsbfzx9c8i3p27qrj3z74fh9d-aarch64-unknown-linux-gnu-binutils-2.30/bin:/nix/store/cpxkl6k01lh3wkaw2fv8
xz8v60j43n4s-glibc-2.27-aarch64-unknown-linux-gnu-bin/bin:/nix/store/wm8va53fh5158ipi0ic9gir64hrvqv1z-coreutils-8.29/bin:/nix/store/wm8va53fh5158ipi0ic9gir64hrvqv1z-coreutils-8.29/bin:/nix/store/g5dl
pwd44kd75i71nwzii8w4bp4inxwk-findutils-4.6.0/bin:/nix/store/2wdj4rznh37jd44lxz9nn6ymnbqs9axp-diffutils-3.6/bin:/nix/store/ny5p32137wfyzdm485xfdck21w1gyl3g-gnused-4.5/bin:/nix/store/9f89z51na7w931aja8
lqlmhqny9h16cj-gnugrep-3.1/bin:/nix/store/zdadpaj5z8k9ifkgsc16yvfjn4wdv0r2-gawk-4.2.1/bin:/nix/store/lxbaya2mzjc3xzbcsykrcbvcf5vxvfia-gnutar-1.30/bin:/nix/store/ix13jm9a1jfkcg1fs3skagyz4s1w77r6-gzip-
1.9/bin:/nix/store/1iih7pgc7krhis13zaq8ajdcb2hd10d9-bzip2-1.0.6.0.1-bin/bin:/nix/store/ql3azyviwyc6w73h6prk1j2945skfapf-gnumake-4.2.1/bin:/nix/store/czx8vkrb9jdgjyz8qfksh10vrnqa723l-bash-4.4-p23/bin:
/nix/store/61m8xswm9xxwb3ddw1za2cxvcikgk656-patch-2.7.6/bin:/nix/store/26lgqf0ja6rx8dnz972a3f56vfxmmmv5-xz-5.2.4-bin/bin
nbi=/nix/store/mwsk6nin4rxsbghfhqxzk9lcsk09nbbl-pkg-config-0.29.2-aarch64-unknown-linux-gnu
/nix/store/jbkam81ja9pn2jz11qq433i619q56ihm-stdenv-linux/setup: line 1261: /nix/store/mwsk6nin4rxsbghfhqxzk9lcsk09nbbl-pkg-config-0.29.2-aarch64-unknown-linux-gnu/bin/pkg-config: cannot execute binar
y file: Exec format error
builder for '/nix/store/layqrjhacamrnpf4fy8k7ww05kzyy8j5-foo-aarch64-unknown-linux-gnu.drv' failed with exit code 126
error: build of '/nix/store/layqrjhacamrnpf4fy8k7ww05kzyy8j5-foo-aarch64-unknown-linux-gnu.drv' failed
But I expected pkg-config to come from the build architecture (here x86_64-linux), not the cross (native/host) one.
I get the same result if I put pkg-config in depsBuildBuild.
Technical details
Checked on current nixos-18.03, on 18.09 18.09.932.09195057114 (Jellyfish) and on unstable: 9f88282
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.mdhttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md