python312Packages.array-record: improve eval error

Before the change access to non-existent `.cp312` attribute caused
irrecoverable eval failure:

    $ nix build --no-link -f. python312Packages.array-data
    ...
    error: attribute 'cp312' missing

After the change we use `throw` fallback to turn the error into
recoverable:

    $ nix build --no-link -f. python312Packages.array-data
    ...
    error: array-record is missing hash for cp312

The difference is visible when one tries to skip the derivations that
throw errors. Irrecoverable eval errors do not allow skipping such
derivations.
This commit is contained in:
Sergei Trofimovich 2023-12-29 14:07:43 +00:00 committed by GitHub
parent 75e6da4bce
commit 836e74d695
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,7 +31,7 @@ buildPythonPackage rec {
cp39 = "sha256-BzMOVue7E1S1+5+XTcPELko81ujc9MbmqLhNsU7pqO0=";
cp310 = "sha256-eUD9pQu9GsbV8MPD1MiF3Ihr+zYioSOo6P15hYIwPYo=";
cp311 = "sha256-rAmkI3EIZPYiXrxFowfDC0Gf3kRw0uX0i6Kx6Zu+hNM=";
}.${pyShortVersion};
}.${pyShortVersion} or (throw "${pname} is missing hash for ${pyShortVersion}");
};
propagatedBuildInputs = [