mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-10-01 09:30:20 +02:00
Merge pull request #33589 from dtzWill/fix/fixed-output-cross-name
make-derivation: Don't add host-suffix to fixed-output derivations names
This commit is contained in:
commit
cf72af3d99
|
@ -77,8 +77,13 @@ rec {
|
||||||
|
|
||||||
, ... } @ attrs:
|
, ... } @ attrs:
|
||||||
|
|
||||||
# TODO(@Ericson2314): Make this more modular, and not O(n^2).
|
|
||||||
let
|
let
|
||||||
|
fixedOutputDrv = attrs ? outputHash;
|
||||||
|
noNonNativeDeps = builtins.length (depsBuildTarget ++ depsBuildTargetPropagated
|
||||||
|
++ depsHostHost ++ depsHostHostPropagated
|
||||||
|
++ buildInputs ++ propagatedBuildInputs
|
||||||
|
++ depsTargetTarget ++ depsTargetTargetPropagated) == 0;
|
||||||
|
runtimeSensativeIfFixedOutput = fixedOutputDrv -> !noNonNativeDeps;
|
||||||
supportedHardeningFlags = [ "fortify" "stackprotector" "pie" "pic" "strictoverflow" "format" "relro" "bindnow" ];
|
supportedHardeningFlags = [ "fortify" "stackprotector" "pie" "pic" "strictoverflow" "format" "relro" "bindnow" ];
|
||||||
defaultHardeningFlags = lib.remove "pie" supportedHardeningFlags;
|
defaultHardeningFlags = lib.remove "pie" supportedHardeningFlags;
|
||||||
enabledHardeningOptions =
|
enabledHardeningOptions =
|
||||||
|
@ -168,7 +173,11 @@ rec {
|
||||||
# A hack to make `nix-env -qa` and `nix search` ignore broken packages.
|
# 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.
|
# TODO(@oxij): remove this assert when something like NixOS/nix#1771 gets merged into nix.
|
||||||
name = assert validity.handled; name + lib.optionalString
|
name = assert validity.handled; name + lib.optionalString
|
||||||
(stdenv.hostPlatform != stdenv.buildPlatform)
|
# 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)
|
||||||
("-" + stdenv.hostPlatform.config);
|
("-" + stdenv.hostPlatform.config);
|
||||||
|
|
||||||
builder = attrs.realBuilder or stdenv.shell;
|
builder = attrs.realBuilder or stdenv.shell;
|
||||||
|
|
|
@ -31,13 +31,8 @@ let
|
||||||
then defaultBuildHostScope
|
then defaultBuildHostScope
|
||||||
else assert pkgs.hostPlatform == pkgs.buildPlatform; defaultHostTargetScope;
|
else assert pkgs.hostPlatform == pkgs.buildPlatform; defaultHostTargetScope;
|
||||||
defaultHostHostScope = {}; # unimplemented
|
defaultHostHostScope = {}; # unimplemented
|
||||||
# TODO(@Ericson2314): we shouldn't preclude run-time fetching by removing
|
defaultHostTargetScope = pkgs // pkgs.xorg;
|
||||||
# these attributes. We should have a more general solution for selecting
|
defaultTargetTargetScope = pkgs.targetPackages // pkgs.targetPackages.xorg or {};
|
||||||
# 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 {};
|
|
||||||
|
|
||||||
splicer = pkgsBuildBuild: pkgsBuildHost: pkgsBuildTarget:
|
splicer = pkgsBuildBuild: pkgsBuildHost: pkgsBuildTarget:
|
||||||
pkgsHostHost: pkgsHostTarget:
|
pkgsHostHost: pkgsHostTarget:
|
||||||
|
|
Loading…
Reference in a new issue