summary refs log tree commit diff
path: root/pkgs/stdenv
diff options
context:
space:
mode:
authorRobert Hensing <roberth@users.noreply.github.com>2022-04-05 20:05:33 +0200
committerGitHub <noreply@github.com>2022-04-05 20:05:33 +0200
commit559ac3c9e792ae905497528d22e31f9fa9df5982 (patch)
treed3acba16e06763557797a8666198e96425fb515c /pkgs/stdenv
parentf1aa084baa724e97e8aa24b28f6d000952a31340 (diff)
parentfffabe7500e972eb5275199c82a35132a07fa29f (diff)
downloadnixpkgs-559ac3c9e792ae905497528d22e31f9fa9df5982.tar
nixpkgs-559ac3c9e792ae905497528d22e31f9fa9df5982.tar.gz
nixpkgs-559ac3c9e792ae905497528d22e31f9fa9df5982.tar.bz2
nixpkgs-559ac3c9e792ae905497528d22e31f9fa9df5982.tar.lz
nixpkgs-559ac3c9e792ae905497528d22e31f9fa9df5982.tar.xz
nixpkgs-559ac3c9e792ae905497528d22e31f9fa9df5982.tar.zst
nixpkgs-559ac3c9e792ae905497528d22e31f9fa9df5982.zip
Merge pull request #166383 from hercules-ci/always-sanitize-derivation-name
Always sanitize derivation name
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,