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
gts: Fix cross compilation #96906
gts: Fix cross compilation #96906
Conversation
@GrahamcOfBorg build gts |
@GrahamcOfBorg eval |
sha256 = "07mqx09jxh8cv9753y2d2jsv7wp8vjmrd7zcfpbrddz3wc9kx705"; | ||
}; | ||
|
||
# glib needs to be in nativeBuildInputs in order for AM_PATH_GLIB_2_0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is suspicious, I would expect the macros to be picked up just like pkg-config files are.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The macro itself is not the issue, it's the AC_TRY_RUN that is used by AM_PATH_GLIB_2_0 internally which will fail if not run in native context.
} | ||
|
||
bootstrap = stdenv.mkDerivation (drv { pname = "${name}-bootstrap"; } // stdenv.lib.optionalAttrs (cross) { | ||
configureFlags = [ "CC=${buildPackages.stdenv.cc}/bin/cc" ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would not it perhaps be possible to just change the compiler for building the predicates_init
in the Makefile.am
? I am not very familiar with automake myself but this looks overly complicated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushed a simplified approach.
gts generate binaries during the build process that are used during the build process. When building cross-platform, these binaries are not executable as they are built with for the target platform instead of the host platform. The boostrap build introduced here will first build gts natively and then cross-platform, using the native binaries in the cross-build.
@GrahamcOfBorg build gts |
Motivation for this change
gts generate binaries during the build process that are used during the
build process. When building cross-platform, these binaries are not
executable as they are built with for the target platform instead of the
host platform. The boostrap build introduced here will first build gts
natively and then cross-platform, using the native binaries in the
cross-build.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)