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

Various cross-compilation fixes #51154

Merged
merged 3 commits into from Dec 12, 2018
Merged

Various cross-compilation fixes #51154

merged 3 commits into from Dec 12, 2018

Conversation

Mic92
Copy link
Member

@Mic92 Mic92 commented Nov 28, 2018

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@Mic92 Mic92 added the 6.topic: cross-compilation Building packages on a different sort platform than than they will be run on label Nov 28, 2018
@@ -62,6 +62,9 @@ in stdenv.mkDerivation rec {
doCheck = true;

postInstall = glib.flattenInclude + ''
substituteInPlace $dev/bin/freetype-config \
--replace ${buildPackages.pkgconfig} ${pkgconfig}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this correct? I would think you would want buildPackages pkgconfig in this case.

Copy link
Member Author

@Mic92 Mic92 Nov 28, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so freetype-config is build for the host machine and buildPackages.pkgconfig has the wrong architecture. We also have a check for that to warn about those cases.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dealing with -config style applications is a different challenge we have to face. This would need some kind of buildPackage that points to the host packages.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I would straight up

rm "$dev/bin"
cp -r "${buildPackages.freetype.dev}/bin" "$dev/"

and file an issue upstream with the maintainer so we can easily build *-config as a separate derivation and sidestep the issue entirely.

*-config style stuff sucks for the same reason compilers insisting on building their own standard libraries sucks. Packages' installations should be for only one platform (/ not cross bootstrapping stages).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wait, I forgot that the *-config binaries are hard-coded with that necessary data often, so my cp -r won't work. Ugh!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we also discuss this here: #51176

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@GrahamcOfBorg
Copy link

Unexpected error: command failed with exit code 1 on aarch64-linux (full log)

Attempted: freetype, libpfm, wayland

Partial log (click to expand)

cannot build derivation '/nix/store/krqp3zpym4l4dyzi874mfqfnxghgh9rb-openssl-1.0.2q.drv': 3 dependencies couldn't be built
cannot build derivation '/nix/store/018wc0ckbi6qi8yrx2g67chb67hkx809-expect-5.45.4.drv': 4 dependencies couldn't be built
cannot build derivation '/nix/store/ql5cn68lhj4wqfy61rnifzmarbp2bnb3-freetype-2.9.drv': 8 dependencies couldn't be built
cannot build derivation '/nix/store/k11nfl656vacnzrd7768114b8rf8kril-readline-6.3p08.drv': 3 dependencies couldn't be built
cannot build derivation '/nix/store/zf3pw47barhsmd8rpcd8rslzr7cb2gic-dejagnu-1.6.1.drv': 4 dependencies couldn't be built
cannot build derivation '/nix/store/yhnbnlijqfa48p4x3c8x60jg2m0l3phw-libffi-3.2.1.drv': 3 dependencies couldn't be built
cannot build derivation '/nix/store/8h8iinyvbcmsvgqkw1mwbvm094pafgqh-python-2.7.15.drv': 11 dependencies couldn't be built
cannot build derivation '/nix/store/9aagphgv9n09hjcxgix7d04wgrpafzka-libxml2-2.9.8.drv': 4 dependencies couldn't be built
cannot build derivation '/nix/store/fs56h4isaapmdmd60kghfmcm12bgxvx9-wayland-1.16.0.drv': 6 dependencies couldn't be built
error: build of '/nix/store/3ck7z0f50s2qk2x6wdq44c53nxqqzyd5-libpfm-4.10.1.drv', '/nix/store/fs56h4isaapmdmd60kghfmcm12bgxvx9-wayland-1.16.0.drv', '/nix/store/ql5cn68lhj4wqfy61rnifzmarbp2bnb3-freetype-2.9.drv' failed

@GrahamcOfBorg
Copy link

Timed out, unknown build status on x86_64-darwin (full log)

Attempted: freetype

The following builds were skipped because they don't evaluate on x86_64-darwin: libpfm, wayland

Partial log (click to expand)

cannot build derivation '/nix/store/cngz79qpv37bl1fi4f5fpg7wf9a2l955-clang-wrapper-5.0.2.drv': 3 dependencies couldn't be built
cannot build derivation '/nix/store/7cbal229wlzi8pfyndc320kchh52c02g-stdenv-darwin.drv': 6 dependencies couldn't be built
cannot build derivation '/nix/store/r83dsz5i1pwllp4ns5nz6jivy05g1hrl-hook.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/a2sgalj8yyf92ylklmp8kkxfps28ki81-stdenv-darwin.drv': 7 dependencies couldn't be built
cannot build derivation '/nix/store/6cypr7n7z5f69rgddzqrqv2wyirxq1pq-hook.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/72vxm3n7ii4p0rw304wrv7jd57fc5ylv-libpng-apng-1.6.35.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/5c8j3d7j9svaiy5jjszs8z3ml454lx91-pkg-config-0.29.2.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/s0b83fpwnmqcc647g089ww79vb87ij9w-which-2.21.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/m00f6lq5szci2sy0z7d87hpv14j0zjhl-freetype-2.9.drv': 6 dependencies couldn't be built
error: build of '/nix/store/m00f6lq5szci2sy0z7d87hpv14j0zjhl-freetype-2.9.drv' failed

@GrahamcOfBorg
Copy link

Timed out, unknown build status on x86_64-linux (full log)

Attempted: freetype, libpfm, wayland

Partial log (click to expand)

cannot build derivation '/nix/store/bhk6vzw9f73ss6q7f8fj87indlqq44p6-openssl-1.0.2q.drv': 3 dependencies couldn't be built
cannot build derivation '/nix/store/4c2s058z9az4gqm6qpmgv7004ljrhpws-expect-5.45.4.drv': 4 dependencies couldn't be built
cannot build derivation '/nix/store/hwk5r2wkq3m1zyp6q5xqfgp9nh7jickm-freetype-2.9.drv': 8 dependencies couldn't be built
cannot build derivation '/nix/store/q56cz2vdpk2ixbnsq5a071ccaxgi28js-readline-6.3p08.drv': 3 dependencies couldn't be built
cannot build derivation '/nix/store/xjdvzp1l5rka2gh55mwf078yr1l9vxwv-dejagnu-1.6.1.drv': 4 dependencies couldn't be built
cannot build derivation '/nix/store/vjzvg856fw71ij0r0g8hqn512za74vag-python-2.7.15.drv': 10 dependencies couldn't be built
cannot build derivation '/nix/store/fci7i864jx1gcq27fj90j9jwp7x0dd2h-libffi-3.2.1.drv': 3 dependencies couldn't be built
cannot build derivation '/nix/store/d0l2zahr99nczia73bn8kaf934yljvw2-libxml2-2.9.8.drv': 4 dependencies couldn't be built
cannot build derivation '/nix/store/9jvgk4q91rp881y8zvvp0l1zr2ys4nz1-wayland-1.16.0.drv': 6 dependencies couldn't be built
error: build of '/nix/store/7jkfrffmj7l43zacn0xlngl8jsbcf164-libpfm-4.10.1.drv', '/nix/store/9jvgk4q91rp881y8zvvp0l1zr2ys4nz1-wayland-1.16.0.drv', '/nix/store/hwk5r2wkq3m1zyp6q5xqfgp9nh7jickm-freetype-2.9.drv' failed

@Mic92 Mic92 merged commit d66c960 into NixOS:staging Dec 12, 2018
@Mic92 Mic92 deleted the cross-fixes branch December 12, 2018 00:56
@Mic92 Mic92 mentioned this pull request Dec 21, 2018
10 tasks
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 sort platform than than they will be run on 10.rebuild-darwin: 501+ 10.rebuild-linux: 501+
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants