gnugrep: fix cross-compilation (buildInputs -> nativeBuildInputs)#8433
gnugrep: fix cross-compilation (buildInputs -> nativeBuildInputs)#8433bjornfor wants to merge 1 commit intoNixOS:stagingfrom
Conversation
Now I can finally build bootstrap-tools-cross: $ nix-build pkgs/stdenv/linux/make-bootstrap-tools-cross.nix -A armv7l /nix/store/59zrljz7hrjfliychv62r386y3yrfrah-build /nix/store/4701h00w1rynd0n8s1ax490ygl8v75z5-busybox-1.23.2-armv7l-unknown-linux-gnueabi /nix/store/37bsa3sk07lp714gryny9z8q0pj6bfha-coreutils-8.23-armv7l-unknown-linux-gnueabi /nix/store/wy9xvcfd6mwlzskpc0wf0zv6wm88haaz-curl-7.42.1-armv7l-unk Instead of this (current) build error: $ nix-build pkgs/stdenv/linux/make-bootstrap-tools-cross.nix -A armv7l ... checking whether we are cross compiling... yes checking for suffix of object files... o checking whether we are using the GNU C compiler... no configure: error: in `/tmp/nix-build-gnugrep-2.21-armv7l-unknown-linux-gnueabi.drv-4/grep-2.21': configure: error: C compiler cannot create executables See `config.log' for more details config.log shows that it failed due to host glibc being used instead of target glibc.
|
I guess it's just that nobody's tried to recompile the bootstrap tools before. Normally there's no need to do it, since the prebuilt tarball of the tools is used: https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/linux/bootstrap/armv7l.nix BTW, @wkennington has a PR to refactor the cross-build scripts, it has some other fixes to the bootstrap tools builder as well: #8081 |
|
@dezgeg: Thanks for the info. Btw, this confuses me, dezgeg@6d0f474 because we have buildInputs, nativeBuildInputs AND derivation + derivation.crossDrv. So when specifying what kind of a dependency something is (host or target), there is seemingly multiple ways to do it. |
|
Still, the bootstrap tools would have to had to be built at some point :-) |
|
I think this has to do with the grep update maybe? I've built them not that On Sat, Jun 20, 2015, 06:50 Bjørn Forsman notifications@github.com wrote:
|
|
Wait this pr doesn't make sense, pcre is something grep links against so it On Sat, Jun 20, 2015, 10:54 William Kennington william@wkennington.com
|
|
Fixed by d4f176f |
|
@wkennington: Thanks. I knew there was something odd with my change. |
|
@wkennington: Ugh, it still fails in latest staging branch. But now for completely different reasons: |
Now I can finally build bootstrap-tools-cross:
$ nix-build pkgs/stdenv/linux/make-bootstrap-tools-cross.nix -A armv7l
/nix/store/59zrljz7hrjfliychv62r386y3yrfrah-build
/nix/store/4701h00w1rynd0n8s1ax490ygl8v75z5-busybox-1.23.2-armv7l-unknown-linux-gnueabi
/nix/store/37bsa3sk07lp714gryny9z8q0pj6bfha-coreutils-8.23-armv7l-unknown-linux-gnueabi
/nix/store/wy9xvcfd6mwlzskpc0wf0zv6wm88haaz-curl-7.42.1-armv7l-unk
Instead of this (current) build error:
$ nix-build pkgs/stdenv/linux/make-bootstrap-tools-cross.nix -A armv7l
...
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... no
configure: error: in
/tmp/nix-build-gnugrep-2.21-armv7l-unknown-linux-gnueabi.drv-4/grep-2.21': configure: error: C compiler cannot create executables Seeconfig.log' for more detailsconfig.log shows that it failed due to host glibc being used instead of target
glibc.
Questions:
Well that sounds to me like the opposite of what's really happening; cross-compiling gnugrep fails because host glibc is picked up from buildInputs. To fix it I had to change it to nativeBuildInputs. Confused :-/ Well, it could be a special case since it's the cross-compiler that fails... I don't know.
[1] https://nixos.org/wiki/CrossCompiling