Fix dependency offset for propagated gcc

main
oxalica 3 years ago
parent b0d0959bbb
commit c7ed82b231
No known key found for this signature in database
GPG Key ID: CED392DE0C483D00
  1. 16
      examples/cross-aarch64/shell.nix
  2. 7
      rust-overlay.nix

@ -1,18 +1,22 @@
with import <nixpkgs> {
(import <nixpkgs> {
crossSystem = "aarch64-linux";
overlays = [ (import ../..) ];
};
}).callPackage (
{ mkShell, rust-bin, pkg-config, openssl, pkgsBuildBuild }:
mkShell {
nativeBuildInputs = [
# Manual `buildPackages` is required here. See: https://github.com/NixOS/nixpkgs/issues/49526
# build = host = x86_64, target = aarch64
buildPackages.rust-bin.stable.latest.minimal
buildPackages.pkg-config
# build = host = target = x86_64, just to avoid re-build.
rust-bin.stable.latest.minimal
pkg-config
# build = host = target = x86_64
# qemu itself is multi-platform and `target` doesn't matter for it.
# Use build system's to avoid rebuild.
pkgsBuildBuild.qemu
];
buildInputs = [
# build = x86_64, host = target = aarch64
openssl
];
}
}) {}

@ -326,10 +326,9 @@ let
# FIXME: If these propagated dependencies go components, darwin build will fail with "`-liconv` not found".
# 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 ] ++
# Ourselves have offset -1. In order to make these offset -1 dependencies of downstream derivation,
# they are offset 0 propagated.
propagatedBuildInputs = [ self.gcc self.buildPackages.gcc ] ++
self.lib.optional (self.stdenv.targetPlatform.isDarwin) self.targetPackages.libiconv;
meta.platforms = self.lib.platforms.all;

Loading…
Cancel
Save