-
-
Notifications
You must be signed in to change notification settings - Fork 14k
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
mesa fails to (cross-)compile #88961
Comments
Looks like |
Doing something like this makes it build, but is likely the wrong way to approach the problem? diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix
index 7eb18dd31c1..d4556fc2637 100644
--- a/pkgs/development/libraries/mesa/default.nix
+++ b/pkgs/development/libraries/mesa/default.nix
@@ -1,4 +1,5 @@
{ stdenv, lib, fetchurl, fetchpatch
+, pkgsBuildTarget
, pkgconfig, intltool, ninja, meson
, file, flex, bison, expat, libdrm, xorg, wayland, wayland-protocols, openssl
, llvmPackages, libffi, libomxil-bellagio, libva-minimal
@@ -116,8 +117,13 @@ stdenv.mkDerivation {
pkgconfig meson ninja
intltool bison flex file
python3Packages.python python3Packages.Mako
+ wayland
];
+ preUnpack = ''
+ export PKG_CONFIG_PATH_FOR_BUILD="${pkgsBuildTarget.wayland}/lib/pkgconfig"
+ '';
+
propagatedBuildInputs = with xorg; [
libXdamage libXxf86vm
] ++ optional stdenv.isLinux libdrm |
I think #87705 will fix this partly. We will still need wayland in nativeBuildInputs. |
Yeah, looks like the solution in #87705 is indeed partial, because What really is going on there is way over my head, so I’ll leave this to somebody who understands it better. |
@matthewbauer but |
CC @dcbaker, do you test cross builds upstream? |
Fixing cross-builds for complex packages like mesa might turn out to be hard, especially in our default feature-ful config. My motivation for aarch64 there isn't high, as we have natively compiled version from Hydra and even https://github.com/nix-community/aarch64-build-box |
I’m not sure if its the fact that I'm cross-compiling (and so hashes change for whatever reason) or the fact that I accidentally changed some dependency of mesa, but I’m not able to get it and other dependencies to be pulled from hydra at all (including mesa). Arguably I can still obtain a aarch64 server to do a native build, but that sounds both a subpar experience (to building locally) and a compromise. |
Cross-compiled builds always get different hashes than native builds. EDIT: the thing is that getting the server (or using a local VM) might be way cheaper than fixing such complex builds and keeping them fixed (human work). |
Well assuming any |
wayland-scanner is cross-compiled by meson (https://github.com/wayland-project/wayland/blob/6d4497371014cacbf0dc4ed9983fd6617ec25c9a/src/meson.build#L38-L45, so I don't think we can treat it like xxx-config (even if that is more correct). wayland itself, even, needs the native wayland-scanner to cross compile ( nixpkgs/pkgs/development/libraries/wayland/default.nix Lines 38 to 39 in 7e571eb
|
@Ericson2314, yes we do an x86 -> arm build. Here's the CI results for current master: |
@dcbaker Thanks!! |
Oh don't get me started on wayland scanner, lol. I tried to fix that mess but upstream thinks fixing it makes their build too complicated and wont take patches. So yes, I think you need to build and package wayland scanner separate if you need to cross compile wayland. |
Ugh, the classic struggle with cross. Well, I'd be happy to go comment on any issue / PR / mailing list thread you made if it might tip the scales. |
I marked this as stale due to inactivity. → More info |
FWIW, I was able to cross-compile Mesa with #106804. |
Describe the bug
Cross-compilation of mesa fails with the following error at configure stage
Though there appear to be other non-fatal, but otherwise concerning issues (especially surrounding LLVM) in the configuration process.
To Reproduce
Steps to reproduce the behavior:
nix build -L -f '<nixpkgs>' pkgsCross.aarch64-multiplatform.mesa
Expected behavior
Build should succeed
Notify maintainers
@vcunat
Metadata
"x86_64-linux"
Linux 5.6.13, NixOS, 20.09pre225898.7319061eef4 (Nightingale)
yes
yes
nix-env (Nix) 2.3.4
"nixos-20.09pre225898.7319061eef4"
""
/nix/var/nix/profiles/per-user/root/channels/nixos
Maintainer information:
The text was updated successfully, but these errors were encountered: