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

Fix cross-compilation #41

Merged
merged 1 commit into from
May 18, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions rust-overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -299,14 +299,17 @@ let
# Need to do it manually.
mkdir -p "$out/nix-support"
echo "$propagatedBuildInputs" > "$out/nix-support/propagated-build-inputs"
if [[ -n "$depsTargetTargetPropagated" ]]; then
echo "$depsTargetTargetPropagated" > "$out/nix-support/propagated-target-target-deps"
if [[ -n "$propagatedNativeBuildInputs" ]]; then
echo "$propagatedNativeBuildInputs" > "$out/nix-support/propagated-native-build-inputs"
fi
'';

# FIXME: If these propagated dependencies go components, darwin build will fail with "`-liconv` not found".
propagatedBuildInputs = [ self.stdenv.cc ];
depsTargetTargetPropagated =

# use propagatedNativebuildinputs here because we want these dependencies to end up
# as buildPlatform dependencies on the derivation using the compiler even though
# they are targetPlatform dependencies from the compiler's perspective
propagatedNativeBuildInputs = [ self.stdenv.cc self.targetPackages.stdenv.cc ] ++
self.lib.optional (self.stdenv.targetPlatform.isDarwin) self.targetPackages.libiconv;

meta.platforms = self.lib.platforms.all;
Expand Down