Skip to content

Commit

Permalink
Merge pull request #278777 from tweag/fix-evals
Browse files Browse the repository at this point in the history
`lib.callPackageWith`: Use abort again instead of throw and fix evaluation errors caused by it
  • Loading branch information
infinisil authored Jan 8, 2024
2 parents 61402f7 + 56df668 commit 0ed96ee
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 15 deletions.
6 changes: 5 additions & 1 deletion lib/customisation.nix
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,11 @@ rec {

in if missingArgs == {}
then makeOverridable f allArgs
else throw "lib.customisation.callPackageWith: ${error}";
# This needs to be an abort so it can't be caught with `builtins.tryEval`,
# which is used by nix-env and ofborg to filter out packages that don't evaluate.
# This way we're forced to fix such errors in Nixpkgs,
# which is especially relevant with allowAliases = false
else abort "lib.customisation.callPackageWith: ${error}";


/* Like callPackage, but for a function that returns an attribute
Expand Down
6 changes: 4 additions & 2 deletions pkgs/desktops/mate/mate-user-share/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@
, libnotify
, libxml2
, libcanberra-gtk3
, mod_dnssd
, apacheHttpd
, apacheHttpdPackages
, hicolor-icon-theme
, mate
, wrapGAppsHook
, mateUpdateScript
}:

let
inherit (apacheHttpdPackages) apacheHttpd mod_dnssd;
in
stdenv.mkDerivation rec {
pname = "mate-user-share";
version = "1.26.0";
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/cuda-modules/setup-hooks/extension.nix
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ final: _: {
autoAddCudaCompatRunpathHook =
final.callPackage
(
{makeSetupHook, cuda_compat}:
{makeSetupHook, cuda_compat ? throw "autoAddCudaCompatRunpathHook: No cuda_compat for CUDA ${final.cudaMajorMinorVersion}" }:
makeSetupHook
{
name = "auto-add-cuda-compat-runpath-hook";
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/python-modules/dnf-plugins-core/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# dependencies
, cmake
, dateutil
, python-dateutil
, dbus-python
, dnf4
, gettext
Expand Down Expand Up @@ -54,7 +54,7 @@ buildPythonPackage rec {
];

propagatedBuildInputs = [
dateutil
python-dateutil
dbus-python
dnf4.py
libcomps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
, fetchFromGitHub
, poetry-core
, argparse-dataclass
, ConfigArgParse
, configargparse
}:

buildPythonPackage rec {
Expand All @@ -24,7 +24,7 @@ buildPythonPackage rec {

propagatedBuildInputs = [
argparse-dataclass
ConfigArgParse
configargparse
];

pythonImportsCheck = [ "snakemake_interface_common" ];
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/python-modules/sqlalchemy/1_4.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
, aiosqlite
, asyncmy
, asyncpg
, cx_oracle
, cx-oracle
, mariadb
, mypy
, mysql-connector
Expand Down Expand Up @@ -79,7 +79,7 @@ buildPythonPackage rec {
mariadb
];
oracle = [
cx_oracle
cx-oracle
];
postgresql = [
psycopg2
Expand Down
8 changes: 4 additions & 4 deletions pkgs/test/checkpointBuild/default.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{ hello, checkpointBuildTools, runCommandNoCC, texinfo, stdenv, rsync }:
{ hello, checkpointBuildTools, runCommand, texinfo, stdenv, rsync }:
let
baseHelloArtifacts = checkpointBuildTools.prepareCheckpointBuild hello;
patchedHello = hello.overrideAttrs (old: {
buildInputs = [ texinfo ];
src = runCommandNoCC "patch-hello-src" { } ''
src = runCommand "patch-hello-src" { } ''
mkdir -p $out
cd $out
tar xf ${hello.src} --strip-components=1
Expand All @@ -24,7 +24,7 @@ let
patches = [ ./hello-additionalFile.patch ];
}));

preparedHelloRemoveFileSrc = runCommandNoCC "patch-hello-src" { } ''
preparedHelloRemoveFileSrc = runCommand "patch-hello-src" { } ''
mkdir -p $out
cd $out
tar xf ${hello.src} --strip-components=1
Expand All @@ -33,7 +33,7 @@ let

patchedHelloRemoveFile = hello.overrideAttrs (old: {
buildInputs = [ texinfo ];
src = runCommandNoCC "patch-hello-src" { } ''
src = runCommand "patch-hello-src" { } ''
mkdir -p $out
cd $out
${rsync}/bin/rsync -cutU --chown=$USER:$USER --chmod=+w -r ${preparedHelloRemoveFileSrc}/* .
Expand Down
2 changes: 1 addition & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30292,7 +30292,7 @@ with pkgs;
aaxtomp3 = callPackage ../applications/audio/aaxtomp3 { };

abcde = callPackage ../applications/audio/abcde {
inherit (python3Packages) eyeD3;
inherit (python3Packages) eyed3;
};

abiword = callPackage ../applications/office/abiword { };
Expand Down

0 comments on commit 0ed96ee

Please sign in to comment.