summary refs log tree commit diff
path: root/pkgs/stdenv
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2022-04-06 00:02:41 +0000
committerGitHub <noreply@github.com>2022-04-06 00:02:41 +0000
commit3dc8bd98b93633fe1baa00fa6e05cbe7eca577d5 (patch)
treeff92a096aebd9a5092def057ec7e6b889fc623c0 /pkgs/stdenv
parente2166cd22bf43d56483d27589b5d630be818fc3a (diff)
parente321dcea0de984e086311273c502fa466642d833 (diff)
downloadnixpkgs-3dc8bd98b93633fe1baa00fa6e05cbe7eca577d5.tar
nixpkgs-3dc8bd98b93633fe1baa00fa6e05cbe7eca577d5.tar.gz
nixpkgs-3dc8bd98b93633fe1baa00fa6e05cbe7eca577d5.tar.bz2
nixpkgs-3dc8bd98b93633fe1baa00fa6e05cbe7eca577d5.tar.lz
nixpkgs-3dc8bd98b93633fe1baa00fa6e05cbe7eca577d5.tar.xz
nixpkgs-3dc8bd98b93633fe1baa00fa6e05cbe7eca577d5.tar.zst
nixpkgs-3dc8bd98b93633fe1baa00fa6e05cbe7eca577d5.zip
Merge staging-next into staging
Diffstat (limited to 'pkgs/stdenv')
-rw-r--r--pkgs/stdenv/generic/make-derivation.nix9
1 files changed, 6 insertions, 3 deletions
diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix
index 2465449867c..8749e8b7555 100644
--- a/pkgs/stdenv/generic/make-derivation.nix
+++ b/pkgs/stdenv/generic/make-derivation.nix
@@ -219,9 +219,11 @@ else let
           # it again.
           staticMarker = lib.optionalString stdenv.hostPlatform.isStatic "-static";
         in
+        lib.strings.sanitizeDerivationName (
           if attrs ? name
           then attrs.name + hostSuffix
-          else "${attrs.pname}${staticMarker}${hostSuffix}-${attrs.version}";
+          else "${attrs.pname}${staticMarker}${hostSuffix}-${attrs.version}"
+        );
     }) // {
       builder = attrs.realBuilder or stdenv.shell;
       args = attrs.args or ["-e" (attrs.builder or ./default-builder.sh)];
@@ -340,8 +342,9 @@ else let
   # passed to the builder and is not a dependency.  But since we
   # include it in the result, it *is* available to nix-env for queries.
   meta = {
-      # `name` above includes cross-compilation cruft (and is under assert),
-      # lets have a clean always accessible version here.
+      # `name` above includes cross-compilation cruft,
+      # is under assert, and is sanitized.
+      # Let's have a clean always accessible version here.
       name = attrs.name or "${attrs.pname}-${attrs.version}";
 
       # If the packager hasn't specified `outputsToInstall`, choose a default,