summary refs log tree commit diff
path: root/pkgs/stdenv/adapters.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/stdenv/adapters.nix')
-rw-r--r--pkgs/stdenv/adapters.nix20
1 files changed, 12 insertions, 8 deletions
diff --git a/pkgs/stdenv/adapters.nix b/pkgs/stdenv/adapters.nix
index 311d967c0a34..a1e8aafd7bc6 100644
--- a/pkgs/stdenv/adapters.nix
+++ b/pkgs/stdenv/adapters.nix
@@ -302,7 +302,7 @@ rec {
               else
                 null;
           in
-            builtins.trace "@:drv:${toString drvPath}:${builtins.exprToString license}:@"
+            builtins.trace "@:drv:${toString drvPath}:${builtins.toString license}:@"
               val;
         in pkg // {
           outPath = printDrvPath pkg.outPath;
@@ -330,20 +330,24 @@ rec {
     { mkDerivation = args:
         let
           pkg = stdenv.mkDerivation args;
+          drv = builtins.unsafeDiscardStringContext pkg.drvPath;
           license =
             if pkg ? meta && pkg.meta ? license then
               pkg.meta.license
+            else if pkg ? outputHash then
+              # Fixed-output derivations such as source tarballs usually
+              # don't have licensing information, but that's OK.
+              null
             else
-              null;
+              builtins.trace
+                "warning: ${drv} lacks licensing information" null;
 
           validate = arg:
             if licensePred license then arg
-            else abort "
-              Error while building ${builtins.unsafeDiscardStringContext pkg.drvPath}:
-              The license predicate is not verified.
-
-              bad license: ${builtins.exprToString license}
-            ";
+            else abort ''
+              while building ${drv}:
+              license `${builtins.toString license}' does not pass the predicate.
+            '';
 
         in pkg // {
           outPath = validate pkg.outPath;