From d9f767600fb2f5f0b7e7159cd8638c0701ad6bfc Mon Sep 17 00:00:00 2001 From: Cole Helbling Date: Fri, 24 Mar 2023 14:22:11 -0700 Subject: [PATCH 1/6] lib/customisation: callPackageWith should abort with errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ofborg relies on the behavior that existed prior to 1c00bf394867b07ed7a908408d8bc1d0afd9fa49, where evaluation would immediately abort due to a missing argument (whether it be an aliased package when `allowAliases = false;` or a typo'd or otherwise nonexistent package). If `callPackageWith` `throw`s instead of `abort`s, the following `nix-env` invocation does not fail fast but instead silently skips the attribute (assuming there is a package that has an aliased package in its `autoArgs`): $ nix-env -qa --json --file . --arg config '{ allowAliases = false; }' &>/dev/null $ echo $? 0 This does change the error output when there is a missing package (for any of the reasons mentioned above), though. Before this change, the errors looked like this: $ nix-build -A hello --arg config '{ allowAliases = false; }' error: … while calling the 'throw' builtin at /home/vin/workspace/vcs/nixpkgs/master/lib/customisation.nix:179:65: 178| 179| in if missingArgs == [] then makeOverridable f allArgs else throw error; | ^ 180| error: Function called without required argument "bash_5" at /home/vin/workspace/vcs/nixpkgs/master/pkgs/applications/misc/hello/default.nix:8, did you mean "bash" or "bashdb"? And the errors now look like this: $ nix-build -A hello --arg config '{ allowAliases = false; }' error: … while calling the 'abort' builtin at /home/vin/workspace/vcs/nixpkgs/master/lib/customisation.nix:179:65: 178| 179| in if missingArgs == [] then makeOverridable f allArgs else abort error; | ^ 180| error: evaluation aborted with the following error message: 'Function called without required argument "bash_5" at /home/vin/workspace/vcs/nixpkgs/master/pkgs/applications/misc/hello/default.nix:8, did you mean "bash" or "bashdb"?' --- lib/customisation.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/customisation.nix b/lib/customisation.nix index cb3a4b56115..fe32e890f35 100644 --- a/lib/customisation.nix +++ b/lib/customisation.nix @@ -176,7 +176,7 @@ rec { # Only show the error for the first missing argument error = errorForArg (lib.head missingArgs); - in if missingArgs == [] then makeOverridable f allArgs else throw error; + in if missingArgs == [] then makeOverridable f allArgs else abort error; /* Like callPackage, but for a function that returns an attribute From 27b9b54fe8743e237cec3baa039353e41cbae565 Mon Sep 17 00:00:00 2001 From: Cole Helbling Date: Fri, 24 Mar 2023 14:31:39 -0700 Subject: [PATCH 2/6] aws-workspaces: libusb -> libusb1 --- .../applications/networking/remote/aws-workspaces/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/networking/remote/aws-workspaces/default.nix b/pkgs/applications/networking/remote/aws-workspaces/default.nix index 984dd3e9095..a5933d105f4 100644 --- a/pkgs/applications/networking/remote/aws-workspaces/default.nix +++ b/pkgs/applications/networking/remote/aws-workspaces/default.nix @@ -1,6 +1,6 @@ { stdenv, lib , makeWrapper, dpkg, fetchurl, autoPatchelfHook -, curl, libkrb5, lttng-ust, libpulseaudio, gtk3, openssl_1_1, icu70, webkitgtk, librsvg, gdk-pixbuf, libsoup, glib-networking, graphicsmagick_q16, libva, libusb, hiredis +, curl, libkrb5, lttng-ust, libpulseaudio, gtk3, openssl_1_1, icu70, webkitgtk, librsvg, gdk-pixbuf, libsoup, glib-networking, graphicsmagick_q16, libva, libusb1, hiredis }: stdenv.mkDerivation rec { @@ -41,7 +41,7 @@ stdenv.mkDerivation rec { glib-networking graphicsmagick_q16 hiredis - libusb + libusb1 libva ]; From 29bbff83a58ae76d9b22bcecd3a04bc33a0c0ea3 Mon Sep 17 00:00:00 2001 From: Cole Helbling Date: Fri, 24 Mar 2023 14:35:50 -0700 Subject: [PATCH 3/6] djhtml: use python3Packages.callPackage --- pkgs/top-level/all-packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 50232a2abed..f8fe46bfc2b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -494,7 +494,7 @@ with pkgs; dinghy = with python3Packages; toPythonApplication dinghy; - djhtml = callPackage ../development/tools/djhtml { }; + djhtml = python3Packages.callPackage ../development/tools/djhtml { }; deadcode = callPackage ../development/tools/deadcode { }; From 0c4948cde75dba764a6c4ebfb61f9c79d1ca6854 Mon Sep 17 00:00:00 2001 From: Cole Helbling Date: Fri, 24 Mar 2023 15:13:12 -0700 Subject: [PATCH 4/6] luaPackages.lua-resty-session: mark broken I tried to add the packages, but the updater script wasn't working for me, so to prevent future Nixpkgs PRs from failing to evaluate because of this, I figured I'd mark this package as broken and remove the arguments that are not packages. --- pkgs/development/lua-modules/generated-packages.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/development/lua-modules/generated-packages.nix b/pkgs/development/lua-modules/generated-packages.nix index 4ce37ca0c15..542c14d751d 100644 --- a/pkgs/development/lua-modules/generated-packages.nix +++ b/pkgs/development/lua-modules/generated-packages.nix @@ -1352,7 +1352,7 @@ buildLuarocksPackage { }; }) {}; -lua-resty-session = callPackage({ lua_pack, buildLuarocksPackage, fetchgit, luaOlder, lua, lua-ffi-zlib, lua-resty-openssl }: +lua-resty-session = callPackage({ buildLuarocksPackage, fetchgit, luaOlder, lua, lua-resty-openssl /*, lua_pack, lua-ffi-zlib */ }: buildLuarocksPackage { pname = "lua-resty-session"; version = "4.0.3-1"; @@ -1374,12 +1374,13 @@ buildLuarocksPackage { '') ["date" "path"]) ; disabled = (luaOlder "5.1"); - propagatedBuildInputs = [ lua lua-ffi-zlib lua-resty-openssl lua_pack ]; + propagatedBuildInputs = [ lua lua-resty-openssl /* lua_pack lua-ffi-zlib */ ]; meta = { homepage = "https://github.com/bungle/lua-resty-session"; description = "Session Library for OpenResty - Flexible and Secure"; license.fullName = "BSD"; + broken = true; # lua_pack and lua-ffi-zlib are unpackaged, causing this package to not evaluate }; }) {}; From 43254386a469c179b0972e8b3bc21fbf7792846c Mon Sep 17 00:00:00 2001 From: Cole Helbling Date: Fri, 24 Mar 2023 15:13:50 -0700 Subject: [PATCH 5/6] signalbackup-tools: clang14Stdenv -> llvmPackages_14.stdenv --- .../instant-messengers/signalbackup-tools/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/networking/instant-messengers/signalbackup-tools/default.nix b/pkgs/applications/networking/instant-messengers/signalbackup-tools/default.nix index 11a95f554fc..81a66a93e3f 100644 --- a/pkgs/applications/networking/instant-messengers/signalbackup-tools/default.nix +++ b/pkgs/applications/networking/instant-messengers/signalbackup-tools/default.nix @@ -1,6 +1,6 @@ -{ lib, stdenv, clang14Stdenv, fetchFromGitHub, openssl, sqlite }: +{ lib, stdenv, llvmPackages_14, fetchFromGitHub, openssl, sqlite }: -(if stdenv.isDarwin then clang14Stdenv else stdenv).mkDerivation rec { +(if stdenv.isDarwin then llvmPackages_14.stdenv else stdenv).mkDerivation rec { pname = "signalbackup-tools"; version = "20230316"; From 6705da37dde57eca549c9ec57fd949a3d713833e Mon Sep 17 00:00:00 2001 From: Cole Helbling Date: Fri, 24 Mar 2023 15:15:11 -0700 Subject: [PATCH 6/6] stt: lzma -> xz --- pkgs/tools/audio/stt/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/audio/stt/default.nix b/pkgs/tools/audio/stt/default.nix index 31256c191ec..8697cb62f5b 100644 --- a/pkgs/tools/audio/stt/default.nix +++ b/pkgs/tools/audio/stt/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, fetchurl, autoPatchelfHook, bzip2, lzma }: +{ stdenv, lib, fetchurl, autoPatchelfHook, bzip2, xz }: stdenv.mkDerivation rec { pname = "stt"; @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { buildInputs = [ bzip2 - lzma + xz stdenv.cc.cc.lib ];