diff options
author | Sergei Trofimovich <slyich@gmail.com> | 2023-12-28 15:28:09 +0000 |
---|---|---|
committer | Sergei Trofimovich <slyich@gmail.com> | 2023-12-28 15:29:29 +0000 |
commit | 3f3e74bc93d4d2ccbff8c5cfa913daf7f1baec3f (patch) | |
tree | f979103cf28ac675b3e2251b8dabfc76f242a965 /pkgs/stdenv | |
parent | 26270cb605b932d2d8187ba47e4ed77a1b74e11f (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.nix | 4 |
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 }: |