Change:
I'm currently working on bringing up my cross-compilation environment. The latest issue is that fails to build when cross-compiling with: Note the name of the source archive: . The target suffix means that 's setup hooks fails to fire: It's not obvious to me how best to solve this. There are several options: generalize the setup hook (and others) to catch names with such suffixes the original filename to files fetch with and teach the unpacker hooks to use this instead of the derivation name teach the splicer not to add a suffix to source archives else
Pinging
and I discussed this via IRC, The conclusion is that we will simply avoid adding a host suffix for fixed-output derivations without host runtime dependencies (e.g. like source tarballs).
For the record, I work around this in bgamari/nixpkgs
Just was hit by this myself, is this still the preferred workaround?
I've never hit this personally, but should finish up. Feel free to give it a shot!

Discussion:
, ... } @ attrs: <del> # TODO(@Ericson2314): Make this more modular, and not O(n^2). </del> let <ins> fixedOutputDrv = attrs ? outputHash; noNonNativeDeps = builtins.length (depsBuildTarget ++ depsBuildTargetPropagated ++ depsHostHost ++ depsHostHostPropagated ++ buildInputs ++ propagatedBuildInputs ++ depsTargetTarget ++ depsTargetTargetPropagated) == 0; runtimeSensativeIfFixedOutput = fixedOutputDrv -> !noNonNativeDeps; </ins> supportedHardeningFlags = [ "fortify" "stackprotector" "pie" "pic" "strictoverflow" "format" "relro" "bindnow" ]; defaultHardeningFlags = lib.remove "pie" supportedHardeningFlags; enabledHardeningOptions =

# A hack to make `nix-env -qa` and `nix search` ignore broken packages. # TODO(@oxij): remove this assert when something like NixOS/nix#1771 gets merged into nix. name = assert validity.handled; name + lib.optionalString <del> (stdenv.hostPlatform != stdenv.buildPlatform) </del> <ins> # Fixed-output derivations like source tarballs shouldn't get a host # suffix. But we have some weird ones with run-time deps that are # just used for their side-affects. Those might as well since the # hash can't be the same. See #32986. (stdenv.hostPlatform != stdenv.buildPlatform && runtimeSensativeIfFixedOutput) </ins> ("-" + stdenv.hostPlatform.config); builder = attrs.realBuilder or stdenv.shell;

then defaultBuildHostScope else assert pkgs.hostPlatform == pkgs.buildPlatform; defaultHostTargetScope; defaultHostHostScope = {}; # unimplemented <del> # TODO(@Ericson2314): we shouldn't preclude run-time fetching by removing # these attributes. We should have a more general solution for selecting # whether `nativeDrv` or `crossDrv` is the default in `defaultScope`. pkgsWithoutFetchers = lib.filterAttrs (n: _: !lib.hasPrefix "fetch" n) pkgs; targetPkgsWithoutFetchers = lib.filterAttrs (n: _: !lib.hasPrefix "fetch" n) pkgs.targetPackages; defaultHostTargetScope = pkgsWithoutFetchers // pkgs.xorg; defaultTargetTargetScope = targetPkgsWithoutFetchers // targetPkgsWithoutFetchers.xorg or {}; </del> <ins> defaultHostTargetScope = pkgs // pkgs.xorg; defaultTargetTargetScope = pkgs.targetPackages // pkgs.targetPackages.xorg or {}; </ins> splicer = pkgsBuildBuild: pkgsBuildHost: pkgsBuildTarget: pkgsHostHost: pkgsHostTarget: