about summary refs log tree commit diff
path: root/pkgs/stdenv
diff options
context:
space:
mode:
authorSergei Trofimovich <slyich@gmail.com>2023-12-28 15:28:09 +0000
committerSergei Trofimovich <slyich@gmail.com>2023-12-28 15:29:29 +0000
commit3f3e74bc93d4d2ccbff8c5cfa913daf7f1baec3f (patch)
treef979103cf28ac675b3e2251b8dabfc76f242a965 /pkgs/stdenv
parent26270cb605b932d2d8187ba47e4ed77a1b74e11f (diff)
stdenv: fix eval of pkgsMusl packages with platform constraints
Before the change `pkgsMusl.adobe-reader` was failing the interpreter:

    $ nix-instantiate --eval --strict --expr 'with import ./. {}; builtins.tryEval pkgsMusl.adobe-reader'
error:
       error: evaluation aborted with the following error message: 'unsupported platform for the pure Linux stdenv'

After the change `pkgsMusl.adobe-reader` returns catchable excation:

    $ nix-instantiate --eval --strict --expr 'with import ./. {}; builtins.tryEval pkgsMusl.adobe-reader'
    { success = false; value = false; }

Noticed when was exploring `nixpkgs` for uncatchable evaluation errors.
Ideally those should only happen when there is a code bug in the use
site. In this case it's just a package with incompatible constraints for
`musl`.

Changed uncatchable `abort` to `throw`.
Diffstat (limited to 'pkgs/stdenv')
-rw-r--r--pkgs/stdenv/linux/default.nix4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix
index 35cdb6311df32..d2f3cc31ca08a 100644
--- a/pkgs/stdenv/linux/default.nix
+++ b/pkgs/stdenv/linux/default.nix
@@ -89,9 +89,9 @@
     else null) null (lib.attrNames archLookupTable);
 
   archLookupTable = table.${localSystem.libc}
-    or (abort "unsupported libc for the pure Linux stdenv");
+    or (throw "unsupported libc for the pure Linux stdenv");
   files = archLookupTable.${localSystem.system} or (if getCompatibleTools != null then getCompatibleTools
-    else (abort "unsupported platform for the pure Linux stdenv"));
+    else (throw "unsupported platform for the pure Linux stdenv"));
   in files
 }: