Skip to content
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

closures of cross packages include build packages #53424

Closed
goertzenator opened this issue Jan 4, 2019 · 4 comments
Closed

closures of cross packages include build packages #53424

goertzenator opened this issue Jan 4, 2019 · 4 comments
Labels
6.topic: cross-compilation Building packages on a different platform than they will be used on

Comments

@goertzenator
Copy link
Contributor

Issue description

A closure for a cross compiled packages includes all the build packages:

$ nix build -f channel:nixos-unstable pkgsCross.raspberryPi.hello
$ nix-store -qR result
/nix/store/xdsjx0gba4id3yyqxv66bxnm2sqixkjj-glibc-2.27
/nix/store/xiypl4ghzm03dmss75kgzf2l4c8lz06g-attr-2.4.47
/nix/store/7q93f42w9snblrim7qqly9rkk57j9hhv-acl-2.2.52
/nix/store/0q4i5ll9gxs6giq7kqkniww934j9j8dk-coreutils-8.30
/nix/store/x6inizi5ahlyhqxxwv1rvn05a25icarq-gcc-7.3.0-lib
/nix/store/9yb6gizxpll4l6gf7md75kbii6b1dvjc-gmp-6.1.2
/nix/store/1pzd4h9ixc4z61zys4rf7jxhwzrcyzwj-gmp-6.1.2-dev
/nix/store/22lrlr8d1d0dymy29jfpgmksfx1p5kc6-glibc-2.27-bin
/nix/store/nsrwlly5ikwhppcslaazp547kh7q7j6s-zlib-1.2.11
/nix/store/c90akqjk2lk9r18wvxnkvd07j2nnl3f1-linux-headers-4.18.3
/nix/store/psqblh5bsgkbkhn4r648pgjw5rq4npkv-glibc-2.27-dev
/nix/store/p7j7qg5cri229ihf8nllwjhzgbvgx5d0-gcc-7.3.0
/nix/store/2nrwba2rahwka6pz6354xza1mnb1dd5v-armv6l-unknown-linux-gnueabihf-stage-static-gcc-debug-7.3.0-lib
/nix/store/a50sg2xm6vflzx5kma3sih39dq9wv7z6-zlib-1.2.11-dev
/nix/store/3hrh50f5gqxg2hi9aczmswwvx7k7m040-armv6l-unknown-linux-gnueabihf-binutils-2.30
/nix/store/5kqyp2ipi39r7j50ri2lh4ikkw3f6ypw-expand-response-params
/nix/store/can00lfiynqkbsdkkmgp6qg8p8w92cxa-bash-4.4-p23
/nix/store/9094wvfc40rgnszk8r31l6vvr1ahg9hb-armv6l-unknown-linux-gnueabihf-binutils-wrapper-2.30
/nix/store/vn8g3p4rn8xbqmwzfs5ic2pmzldaijss-mpfr-4.0.1
/nix/store/a8fx8f5cwr8n9rzms700pabr30w23amz-libmpc-1.1.0
/nix/store/bvn1405cf45bs3il2f4mncwjxnjgrpkw-isl-0.17.1
/nix/store/ij6ygcnk6qmymaa4p6f2d54dxygpl5hm-linux-headers-4.18.3
/nix/store/nsggkr1m85mqdifrbddb7pmvgs2jjp73-mpfr-4.0.1-dev
/nix/store/zk2g34m3bdya2v7vxaqapmb2v49ihqlc-armv6l-unknown-linux-gnueabihf-stage-static-gcc-debug-7.3.0
/nix/store/hs5nhrhy9i1g0mzjss9pyamxacsc46jz-glibc-2.27-armv6l-unknown-linux-gnueabihf
/nix/store/kviifpyj4n081avgh0rmns3rmmz8p2rd-hello-2.10-armv6l-unknown-linux-gnueabihf

Cross-compiled closures are useful for deploying to compact embedded systems, so bringing all this baggage is a show stopper. For reference, a non-cross compiled package has minimal dependencies:

$ nix build -f channel:nixos-unstable hello
$ nix-store -qR result
/nix/store/xdsjx0gba4id3yyqxv66bxnm2sqixkjj-glibc-2.27
/nix/store/85s7px3vlr8adrk200292y7rxpdnzs4j-hello-2.10

Technical details

Please run nix-shell -p nix-info --run "nix-info -m" and paste the
results.

 - system: `"x86_64-linux"`
 - host os: `Linux 4.14.87, NixOS, 18.09.1625.b352d47e42b (Jellyfish)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.1.3`
 - channels(root): `"nixos-18.09.1625.b352d47e42b, unstable-18.03pre130569.7a04c2ca296"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
@FRidh FRidh added the 6.topic: cross-compilation Building packages on a different platform than they will be used on label Jan 4, 2019
@FRidh
Copy link
Member

FRidh commented Jan 4, 2019

This is a known issue. This requires tracking what packages don't clean up their references. As there are potential a lot (cross-compiling hasn't gotten much attention yet) I don't see much point in keeping an issue open for it so I am closing it (for now).

@FRidh FRidh closed this as completed Jan 4, 2019
@goertzenator
Copy link
Contributor Author

Are there related issues that you could point me to so I can learn more? Is this a package by package tidy-up or central infrastructure to do this automatically?

@FRidh
Copy link
Member

FRidh commented Jan 4, 2019

Regarding Python I'll be looking at #53320. Aside from that, there have been a couple of people working on the infrastructure. That is now in place, though some improvements are needed, such as patchShebangs #33956.

But regarding the issue you've raised. It's matter of fixing expressions. They've never been written with cross-compilation in mind.

@danbst
Copy link
Contributor

danbst commented Jan 6, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: cross-compilation Building packages on a different platform than they will be used on
Projects
None yet
Development

No branches or pull requests

3 participants