From 4662abd3b4e878437ff762788c7af858e2c03ca8 Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Fri, 1 Oct 2021 04:20:00 +0000 Subject: [PATCH 01/16] R: don't restrict hydraPlatforms The restriction of hydraPlatforms was added in [1: ef05fad51ab], but doesn't seem to be a real reason behind it. R is Free Software and it take takes a few minutes to build so I believe it can be distributed by Hydra. 1: 2014-05-04 ef05fad51ab36c0064d542d8665ae27faab2e9d3 R: don't restrict meta.platforms to Linux; other architectures should build fine --- pkgs/applications/science/math/R/default.nix | 1 - pkgs/development/r-modules/default.nix | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/pkgs/applications/science/math/R/default.nix b/pkgs/applications/science/math/R/default.nix index a8fdfe8571a6..263130c281b9 100644 --- a/pkgs/applications/science/math/R/default.nix +++ b/pkgs/applications/science/math/R/default.nix @@ -118,7 +118,6 @@ stdenv.mkDerivation rec { ''; platforms = platforms.all; - hydraPlatforms = platforms.linux; maintainers = with maintainers; [ peti ] ++ teams.sage.members; }; diff --git a/pkgs/development/r-modules/default.nix b/pkgs/development/r-modules/default.nix index 16cbe2c510b3..2a66c54fc9cb 100644 --- a/pkgs/development/r-modules/default.nix +++ b/pkgs/development/r-modules/default.nix @@ -22,7 +22,7 @@ let doCheck ? true, requireX ? false, broken ? false, - hydraPlatforms ? R.meta.hydraPlatforms + hydraPlatforms ? R.meta.platforms }: buildRPackage { name = "${name}-${version}"; src = fetchurl { From e08f54959964c966b027dbec84dd6e37070988b0 Mon Sep 17 00:00:00 2001 From: Hunter Jones Date: Mon, 4 Oct 2021 14:33:44 -0500 Subject: [PATCH 02/16] marble: fix build with gpsd 3.23.1 --- pkgs/applications/kde/marble.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/kde/marble.nix b/pkgs/applications/kde/marble.nix index 7fe3aa529fa2..637ae3bc977e 100644 --- a/pkgs/applications/kde/marble.nix +++ b/pkgs/applications/kde/marble.nix @@ -2,7 +2,7 @@ , extra-cmake-modules, kdoctools , qtscript, qtsvg, qtquickcontrols, qtwebengine , krunner, shared-mime-info, kparts, knewstuff -, gpsd, perl +, gpsd, perl, fetchpatch }: mkDerivation { @@ -18,6 +18,15 @@ mkDerivation { qtscript qtsvg qtquickcontrols qtwebengine shared-mime-info krunner kparts knewstuff gpsd ]; + patches = [ + (fetchpatch { + # Backport fix to allow compilation with gpsd 3.23.1 + # Remove when marble compiles without the patch. + # See: https://invent.kde.org/education/marble/-/merge_requests/57 + url = "https://invent.kde.org/education/marble/-/commit/8aadc3eb8f9484a65d497d442cd8c61fe1462bef.diff"; + sha256 = "sha256-ZkPXyunVItSRctv6SLGIonvyZwLDhCz+wfJrIXeHcDo="; + }) + ]; preConfigure = '' cmakeFlags+=" -DINCLUDE_INSTALL_DIR=''${!outputDev}/include" ''; From 7ad2a73cb286223c2f5116f2a728f42aa0467c98 Mon Sep 17 00:00:00 2001 From: Hunter Jones Date: Mon, 4 Oct 2021 14:48:41 -0500 Subject: [PATCH 03/16] foxtrotgps: 1.2.2+329 -> 1.2.2+331 --- pkgs/applications/misc/foxtrotgps/default.nix | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/pkgs/applications/misc/foxtrotgps/default.nix b/pkgs/applications/misc/foxtrotgps/default.nix index 8692ac98933b..745a2357e236 100644 --- a/pkgs/applications/misc/foxtrotgps/default.nix +++ b/pkgs/applications/misc/foxtrotgps/default.nix @@ -6,8 +6,8 @@ let srcs = { foxtrot = fetchbzr { url = "lp:foxtrotgps"; - rev = "329"; - sha256 = "0fwgnsrah63h1xdgm5xdi5ancrz89shdp5sdzw1qc1m7i9a03rid"; + rev = "331"; + sha256 = "sha256-/kJv6a3MzAzzwIl98Mqi7jrUJC1kDvouigf9kGtv868="; }; screenshots = fetchbzr { url = "lp:foxtrotgps/screenshots"; @@ -17,7 +17,7 @@ let }; in stdenv.mkDerivation rec { pname = "foxtrotgps"; - version = "1.2.2+329"; + version = "1.2.2+331"; # Pull directly from bzr because gpsd API version 9 is not supported on latest release src = srcs.foxtrot; @@ -39,12 +39,20 @@ in stdenv.mkDerivation rec { ]; postUnpack = '' - cp -R ${srcs.screenshots} $sourceRoot/doc/screenshots - chmod -R u+w $sourceRoot/doc/screenshots + cp -R ${srcs.screenshots} $sourceRoot/doc/screenshots + chmod -R u+w $sourceRoot/doc/screenshots + ''; + + # Remove when foxtrotgps supports gpsd 3.23.1 + # Patch for compatibility with gpsd 3.23.1. This was added for foxtrotgps + # 1.2.2+331. The command can be removed if the build of a newer version + # succeeds without it. + postPatch = '' + substituteInPlace src/gps_functions.c --replace "STATUS_NO_FIX" "STATUS_UNK" ''; preConfigure = '' - intltoolize --automake --copy --force + intltoolize --automake --copy --force ''; meta = with lib; { From d96e16638f0bcf40e1bee01112f7370dd64e5271 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 6 Oct 2021 15:57:56 +0200 Subject: [PATCH 04/16] python3Packages.iso4217: init at 1.6 --- .../python-modules/iso4217/default.nix | 52 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 54 insertions(+) create mode 100644 pkgs/development/python-modules/iso4217/default.nix diff --git a/pkgs/development/python-modules/iso4217/default.nix b/pkgs/development/python-modules/iso4217/default.nix new file mode 100644 index 000000000000..58d9ef5ffbd5 --- /dev/null +++ b/pkgs/development/python-modules/iso4217/default.nix @@ -0,0 +1,52 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, fetchurl +, pytestCheckHook +, python +}: +let + table = fetchurl { + # See https://github.com/dahlia/iso4217/blob/main/setup.py#L18 + url = "http://www.currency-iso.org/dam/downloads/lists/list_one.xml"; + sha256 = "0frhicc7s8gqglr41hzx61fic3ckvr4sg773ahp1s28n5by3y7ac"; + }; +in +buildPythonPackage rec { + pname = "iso4217"; + version = "1.6"; + + src = fetchFromGitHub { + owner = "dahlia"; + repo = pname; + rev = version; + sha256 = "0mdpf5a0xr5lrcfgvqi1sdn7ln2w6pkc3lg0laqkbx5mhxky0fla"; + }; + + checkInputs = [ + pytestCheckHook + ]; + + preBuild = '' + # The table is already downloaded + export ISO4217_DOWNLOAD=0 + # Copy the table file to satifiy the build process + cp -r ${table} $pname/table.xml + ''; + + postInstall = '' + # Copy the table file + cp -r ${table} $out/${python.sitePackages}/$pname/table.xml + ''; + + pytestFlagsArray = [ "$pname/test.py" ]; + + pythonImportsCheck = [ "iso4217" ]; + + meta = with lib; { + description = "ISO 4217 currency data package for Python"; + homepage = "https://github.com/dahlia/iso4217"; + license = with licenses; [ publicDomain ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 648a94ff4211..fa7bd0edf0e7 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3753,6 +3753,8 @@ in { iso-639 = callPackage ../development/python-modules/iso-639 { }; + iso4217 = callPackage ../development/python-modules/iso4217 { }; + iso8601 = callPackage ../development/python-modules/iso8601 { }; isodate = callPackage ../development/python-modules/isodate { }; From ac53325cfba03cde392d435937bb554b142e7223 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 2 Oct 2021 15:13:25 +0200 Subject: [PATCH 05/16] python3Packages.pyefergy: init at 0.1.0 --- .../python-modules/pyefergy/default.nix | 42 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 44 insertions(+) create mode 100644 pkgs/development/python-modules/pyefergy/default.nix diff --git a/pkgs/development/python-modules/pyefergy/default.nix b/pkgs/development/python-modules/pyefergy/default.nix new file mode 100644 index 000000000000..042b6a858fa4 --- /dev/null +++ b/pkgs/development/python-modules/pyefergy/default.nix @@ -0,0 +1,42 @@ +{ lib +, aiohttp +, buildPythonPackage +, fetchFromGitHub +, iso4217 +, pytestCheckHook +, pythonOlder +, pytz +}: + +buildPythonPackage rec { + pname = "pyefergy"; + version = "0.1.0"; + format = "setuptools"; + + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "tkdrob"; + repo = pname; + rev = version; + sha256 = "0nm7dc5q4wvdpqxpirlc4nwm68lf3n2df6j5yy4m8wr294yb7a1k"; + }; + + propagatedBuildInputs = [ + aiohttp + iso4217 + pytz + ]; + + # Project has no tests + doCheck = false; + + pythonImportsCheck = [ "pyefergy" ]; + + meta = with lib; { + description = "Python API library for Efergy energy meters"; + homepage = "https://github.com/tkdrob/pyefergy"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index fa7bd0edf0e7..1a8ce514d93f 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6180,6 +6180,8 @@ in { pyee = callPackage ../development/python-modules/pyee { }; + pyefergy = callPackage ../development/python-modules/pyefergy { }; + pyeight = callPackage ../development/python-modules/pyeight { }; pyelftools = callPackage ../development/python-modules/pyelftools { }; From 864f7f87ccf2c415e1e496258af5d5d75e009db9 Mon Sep 17 00:00:00 2001 From: "R. RyanTM" Date: Wed, 6 Oct 2021 14:06:40 +0000 Subject: [PATCH 06/16] python38Packages.mypy-boto3-s3: 1.18.54 -> 1.18.55 --- pkgs/development/python-modules/mypy-boto3-s3/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/mypy-boto3-s3/default.nix b/pkgs/development/python-modules/mypy-boto3-s3/default.nix index f245994cc474..79142d925d70 100644 --- a/pkgs/development/python-modules/mypy-boto3-s3/default.nix +++ b/pkgs/development/python-modules/mypy-boto3-s3/default.nix @@ -8,12 +8,12 @@ buildPythonPackage rec { pname = "mypy-boto3-s3"; - version = "1.18.54"; + version = "1.18.55"; disabled = pythonOlder "3.6"; src = fetchPypi { inherit pname version; - sha256 = "fdbb7ff1687fba8e7ac521502cb2d2ca4b845e1a331f5b4fe55aff7c17e1f985"; + sha256 = "45519e811bbd284fc7d69e932abcaa9c551071db4fb6e69502736b81dcc72a7d"; }; propagatedBuildInputs = [ From bc9b01fadda2bbcdfbffcb07273a0138a6f2c832 Mon Sep 17 00:00:00 2001 From: superherointj <5861043+superherointj@users.noreply.github.com> Date: Wed, 6 Oct 2021 14:59:30 -0300 Subject: [PATCH 07/16] k3s: updateScript updated --- .../networking/cluster/k3s/default.nix | 2 +- .../networking/cluster/k3s/update.sh | 20 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/pkgs/applications/networking/cluster/k3s/default.nix b/pkgs/applications/networking/cluster/k3s/default.nix index 445483c1ecde..78dffeb20ede 100644 --- a/pkgs/applications/networking/cluster/k3s/default.nix +++ b/pkgs/applications/networking/cluster/k3s/default.nix @@ -47,7 +47,7 @@ let k3sCommit = "3e250fdbab72d88f7e6aae57446023a0567ffc97"; # k3s git commit at the above version k3sRepoSha256 = "1w7drvk0bmlmqrxh1y6dxjy7dk6bdrl72pkd25lc1ir6wbzb05h9"; - traefikChartVersion = "9.18.2"; # taken from ./scripts/download at TRAEFIK_VERSION + traefikChartVersion = "9.18.2"; # taken from ./manifests/traefik.yaml at spec.version traefikChartSha256 = "sha256-9d7p0ngyMN27u4OPgz7yI14Zj9y36t9o/HMX5wyDpUI="; k3sRootVersion = "0.9.1"; # taken from ./scripts/download at ROOT_VERSION diff --git a/pkgs/applications/networking/cluster/k3s/update.sh b/pkgs/applications/networking/cluster/k3s/update.sh index 79432f06c235..1795b48f3382 100755 --- a/pkgs/applications/networking/cluster/k3s/update.sh +++ b/pkgs/applications/networking/cluster/k3s/update.sh @@ -10,19 +10,16 @@ cd $(dirname "${BASH_SOURCE[0]}") LATEST_TAG_RAWFILE=${WORKDIR}/latest_tag.json curl --silent ${GITHUB_TOKEN:+"-u \":$GITHUB_TOKEN\""} \ - https://api.github.com/repos/k3s-io/k3s/releases/latest > ${LATEST_TAG_RAWFILE} - -LATEST_TAG_NAME=$(jq -r '.tag_name' ${LATEST_TAG_RAWFILE}) + https://api.github.com/repos/k3s-io/k3s/releases > ${LATEST_TAG_RAWFILE} +LATEST_TAG_NAME=$(jq 'map(.tag_name)' ${LATEST_TAG_RAWFILE} | grep -v -e rc -e engine | sed 's/["|,| ]//g' | sort -r | head -n1) K3S_VERSION=$(echo ${LATEST_TAG_NAME} | sed 's/^v//') -LATEST_TAG_TARBALL_URL=$(jq -r '.tarball_url' ${LATEST_TAG_RAWFILE}) - K3S_COMMIT=$(curl --silent ${GITHUB_TOKEN:+"-u \":$GITHUB_TOKEN\""} \ https://api.github.com/repos/k3s-io/k3s/tags \ | jq -r "map(select(.name == \"${LATEST_TAG_NAME}\")) | .[0] | .commit.sha") -K3S_REPO_SHA256=$(nix-prefetch-url --quiet --unpack ${LATEST_TAG_TARBALL_URL}) +K3S_REPO_SHA256=$(nix-prefetch-url --quiet --unpack https://github.com/k3s-io/k3s/archive/refs/tags/${LATEST_TAG_NAME}.tar.gz) FILE_SCRIPTS_DOWNLOAD=${WORKDIR}/scripts-download curl --silent https://raw.githubusercontent.com/k3s-io/k3s/${K3S_COMMIT}/scripts/download > $FILE_SCRIPTS_DOWNLOAD @@ -30,16 +27,19 @@ curl --silent https://raw.githubusercontent.com/k3s-io/k3s/${K3S_COMMIT}/scripts FILE_SCRIPTS_VERSION=${WORKDIR}/scripts-version.sh curl --silent https://raw.githubusercontent.com/k3s-io/k3s/${K3S_COMMIT}/scripts/version.sh > $FILE_SCRIPTS_VERSION -TRAEFIK_CHART_VERSION=$(grep TRAEFIK_VERSION= $FILE_SCRIPTS_DOWNLOAD \ - | cut -d'=' -f2 | cut -d' ' -f1) +FILE_MANIFESTS_TRAEFIK=${WORKDIR}/manifests-traefik.yaml +curl --silent https://raw.githubusercontent.com/k3s-io/k3s/${K3S_COMMIT}/manifests/traefik.yaml > $FILE_MANIFESTS_TRAEFIK + +TRAEFIK_CHART_VERSION=$(awk -F/ '/traefik-([[:digit:]]+\.)/ {sub(/traefik-/, "", $6) ; sub(/\.tgz/, "", $6); print $6}' $FILE_MANIFESTS_TRAEFIK) + TRAEFIK_CHART_SHA256=$(nix-prefetch-url --quiet "https://helm.traefik.io/traefik/traefik-${TRAEFIK_CHART_VERSION}.tgz") -K3S_ROOT_VERSION=$(grep ROOT_VERSION= $FILE_SCRIPTS_DOWNLOAD \ +K3S_ROOT_VERSION=$(grep 'ROOT_VERSION=' ${FILE_SCRIPTS_DOWNLOAD} \ | cut -d'=' -f2 | cut -d' ' -f1 | sed 's/^v//') K3S_ROOT_SHA256=$(nix-prefetch-url --quiet --unpack \ "https://github.com/k3s-io/k3s-root/releases/download/v${K3S_ROOT_VERSION}/k3s-root-amd64.tar") -CNIPLUGINS_VERSION=$(grep VERSION_CNIPLUGINS= $FILE_SCRIPTS_VERSION \ +CNIPLUGINS_VERSION=$(grep 'VERSION_CNIPLUGINS=' ${FILE_SCRIPTS_VERSION} \ | cut -d'=' -f2 | cut -d' ' -f1 | sed -e 's/"//g' -e 's/^v//') CNIPLUGINS_SHA256=$(nix-prefetch-url --quiet --unpack \ "https://github.com/rancher/plugins/archive/refs/tags/v${CNIPLUGINS_VERSION}.tar.gz") From 1fd150bf62b923cd55abe00a5f740b547e4fb490 Mon Sep 17 00:00:00 2001 From: Karl Fischer Date: Wed, 6 Oct 2021 21:10:35 +0200 Subject: [PATCH 08/16] vsh: 0.12.0 -> 0.12.1 --- pkgs/tools/misc/vsh/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/misc/vsh/default.nix b/pkgs/tools/misc/vsh/default.nix index 416dd4bfcc13..78cf177b3dec 100644 --- a/pkgs/tools/misc/vsh/default.nix +++ b/pkgs/tools/misc/vsh/default.nix @@ -2,13 +2,13 @@ buildGoModule rec { pname = "vsh"; - version = "0.12.0"; + version = "0.12.1"; src = fetchFromGitHub { owner = "fishi0x01"; repo = "vsh"; rev = "v${version}"; - sha256 = "059zzsg94287sxlk5clz6in7jscqaq530c84xqgy537f6cq3vr2p"; + sha256 = "0skd16j969mb2kgq503wskaw8clyhkw135ny2nsqv5j2zjpr71ap"; }; # vendor directory is part of repository From 50db7e49ed64a7c22d853512844be49aa1bada23 Mon Sep 17 00:00:00 2001 From: "R. RyanTM" Date: Wed, 6 Oct 2021 20:27:21 +0000 Subject: [PATCH 09/16] python38Packages.urlextract: 1.3.0 -> 1.4.0 --- pkgs/development/python-modules/urlextract/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/urlextract/default.nix b/pkgs/development/python-modules/urlextract/default.nix index 49ff7ddf08a5..cc5d2ae000ca 100644 --- a/pkgs/development/python-modules/urlextract/default.nix +++ b/pkgs/development/python-modules/urlextract/default.nix @@ -11,11 +11,11 @@ buildPythonPackage rec { pname = "urlextract"; - version = "1.3.0"; + version = "1.4.0"; src = fetchPypi { inherit pname version; - sha256 = "sha256-yxOuiswFOJnAvxwTT++Zhk8nZWK2f4ePsQpUYI7EYS4="; + sha256 = "669f07192584b841b49ba8868fbd6b00e7ddc28367d36a3d8ca8c8e429420748"; }; propagatedBuildInputs = [ From cc3f2432d0d05ed12ef8b9858c54048edadbccbb Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sat, 24 Apr 2021 21:02:15 +0000 Subject: [PATCH 10/16] nixos/nix-daemon: Add enable option Don't worry, it's is true by default. But I think this is important to have because NixOS indeed shouldn't need Nix at run time when the installation is not being modified, and now we can verify that. NixOS images that cannot "self-modify" are a legitamate use-case that this supports more minimally. One should be able to e.g. do a sshfs mount and use `nixos-install` to modify them remotely, or just discard them and build fresh ones if they are run VMs or something. The next step would be to make generations optional, allowing just baking `/etc` and friends rather than using activation scripts. But that's more involved so I'm leaving it out. --- nixos/modules/services/misc/nix-daemon.nix | 11 ++++++++++- nixos/tests/all-tests.nix | 1 + nixos/tests/without-nix.nix | 23 ++++++++++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 nixos/tests/without-nix.nix diff --git a/nixos/modules/services/misc/nix-daemon.nix b/nixos/modules/services/misc/nix-daemon.nix index 789d0355b05c..8a620887f98a 100644 --- a/nixos/modules/services/misc/nix-daemon.nix +++ b/nixos/modules/services/misc/nix-daemon.nix @@ -82,6 +82,15 @@ in nix = { + enable = mkOption { + type = types.bool; + default = true; + description = '' + Whether to enable Nix. + Disabling Nix makes the system hard to modify and the Nix programs and configuration will not be made available by NixOS itself. + ''; + }; + package = mkOption { type = types.package; default = pkgs.nix; @@ -499,7 +508,7 @@ in ###### implementation - config = { + config = mkIf cfg.enable { nix.binaryCachePublicKeys = [ "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" ]; nix.binaryCaches = [ "https://cache.nixos.org/" ]; diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index f92a9241c506..1c44030eaab2 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -478,6 +478,7 @@ in wasabibackend = handleTest ./wasabibackend.nix {}; wiki-js = handleTest ./wiki-js.nix {}; wireguard = handleTest ./wireguard {}; + without-nix = handleTest ./without-nix.nix {}; wmderland = handleTest ./wmderland.nix {}; wpa_supplicant = handleTest ./wpa_supplicant.nix {}; wordpress = handleTest ./wordpress.nix {}; diff --git a/nixos/tests/without-nix.nix b/nixos/tests/without-nix.nix new file mode 100644 index 000000000000..2fc00b04144f --- /dev/null +++ b/nixos/tests/without-nix.nix @@ -0,0 +1,23 @@ +import ./make-test-python.nix ({ lib, ... }: { + name = "without-nix"; + meta = with lib.maintainers; { + maintainers = [ ericson2314 ]; + }; + + nixpkgs.overlays = [ + (self: super: { + nix = throw "don't want to use this"; + }) + ]; + + nodes.machine = { ... }: { + nix.enable = false; + }; + + testScript = '' + start_all() + + machine.succeed("which which") + machine.fail("which nix") + ''; +}) From 0ee5640d78f53c2b912accf7573fb628224feca3 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Wed, 30 Jun 2021 15:49:15 +0000 Subject: [PATCH 11/16] buildRustCrate: Fix extra cross args Do proper list separation, use ld not cc because rustc doesn't `-Wl,`. --- pkgs/build-support/rust/build-rust-crate/build-crate.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/build-support/rust/build-rust-crate/build-crate.nix b/pkgs/build-support/rust/build-rust-crate/build-crate.nix index 3441e2c5e7bf..ba695f2f66c3 100644 --- a/pkgs/build-support/rust/build-rust-crate/build-crate.nix +++ b/pkgs/build-support/rust/build-rust-crate/build-crate.nix @@ -15,8 +15,10 @@ "--remap-path-prefix=$NIX_BUILD_TOP=/" (mkRustcDepArgs dependencies crateRenames) (mkRustcFeatureArgs crateFeatures) + ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "--target" (rust.toRustTargetSpec stdenv.hostPlatform) + "-C" "linker=${stdenv.hostPlatform.config}-ld" ] ++ extraRustcOpts - ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "--target ${rust.toRustTargetSpec stdenv.hostPlatform} -C linker=${stdenv.hostPlatform.config}-gcc" # since rustc 1.42 the "proc_macro" crate is part of the default crate prelude # https://github.com/rust-lang/cargo/commit/4d64eb99a4#diff-7f98585dbf9d30aa100c8318e2c77e79R1021-R1022 ++ lib.optional (lib.elem "proc-macro" crateType) "--extern proc_macro" From 443076118675ef83ef0db0938fb249273170fc56 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Wed, 30 Jun 2021 15:50:45 +0000 Subject: [PATCH 12/16] buildRustCrate: Add `extraRustcOptsForBuild` `extraRustcOpts` should not be used for build.rs, lest it contain host-platform-specific options during cross builds. --- .../rust/build-rust-crate/configure-crate.nix | 4 ++-- .../build-support/rust/build-rust-crate/default.nix | 13 ++++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/pkgs/build-support/rust/build-rust-crate/configure-crate.nix b/pkgs/build-support/rust/build-rust-crate/configure-crate.nix index d1010ac1adb3..1a9705591d6d 100644 --- a/pkgs/build-support/rust/build-rust-crate/configure-crate.nix +++ b/pkgs/build-support/rust/build-rust-crate/configure-crate.nix @@ -13,7 +13,7 @@ , crateRenames , crateVersion , extraLinkFlags -, extraRustcOpts +, extraRustcOptsForBuildRs , libName , libPath , release @@ -24,7 +24,7 @@ let version_ = lib.splitString "-" crateVersion; version = lib.splitVersion (lib.head version_); rustcOpts = lib.foldl' (opts: opt: opts + " " + opt) (if release then "-C opt-level=3" else "-C debuginfo=2") - (["-C codegen-units=$NIX_BUILD_CORES"] ++ extraRustcOpts); + (["-C codegen-units=$NIX_BUILD_CORES"] ++ extraRustcOptsForBuildRs); buildDeps = mkRustcDepArgs buildDependencies crateRenames; authors = lib.concatStringsSep ":" crateAuthors; optLevel = if release then 3 else 0; diff --git a/pkgs/build-support/rust/build-rust-crate/default.nix b/pkgs/build-support/rust/build-rust-crate/default.nix index 13b153315f7f..afb938e51182 100644 --- a/pkgs/build-support/rust/build-rust-crate/default.nix +++ b/pkgs/build-support/rust/build-rust-crate/default.nix @@ -172,6 +172,11 @@ crate_: lib.makeOverridable # Example: [ "-Z debuginfo=2" ] # Default: [] , extraRustcOpts + # A list of extra options to pass to rustc when building a build.rs. + # + # Example: [ "-Z debuginfo=2" ] + # Default: [] + , extraRustcOptsForBuildRs # Whether to enable building tests. # Use true to enable. # Default: false @@ -228,6 +233,7 @@ crate_: lib.makeOverridable nativeBuildInputs_ = nativeBuildInputs; buildInputs_ = buildInputs; extraRustcOpts_ = extraRustcOpts; + extraRustcOptsForBuildRs_ = extraRustcOptsForBuildRs; buildTests_ = buildTests; # crate2nix has a hack for the old bash based build script that did split @@ -308,12 +314,16 @@ crate_: lib.makeOverridable lib.optionals (crate ? extraRustcOpts) crate.extraRustcOpts ++ extraRustcOpts_ ++ (lib.optional (edition != null) "--edition ${edition}"); + extraRustcOptsForBuildRs = + lib.optionals (crate ? extraRustcOptsForBuildRs) crate.extraRustcOptsForBuildRs + ++ extraRustcOptsForBuildRs_ + ++ (lib.optional (edition != null) "--edition ${edition}"); configurePhase = configureCrate { inherit crateName buildDependencies completeDeps completeBuildDeps crateDescription crateFeatures crateRenames libName build workspace_member release libPath crateVersion - extraLinkFlags extraRustcOpts + extraLinkFlags extraRustcOptsForBuildRs crateAuthors crateHomepage verbose colors; }; buildPhase = buildCrate { @@ -337,6 +347,7 @@ crate_: lib.makeOverridable release = crate_.release or true; verbose = crate_.verbose or true; extraRustcOpts = [ ]; + extraRustcOptsForBuildRs = [ ]; features = [ ]; nativeBuildInputs = [ ]; buildInputs = [ ]; From 811f849961b7e0abe45daa291aadd884fac3bb18 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 1 Jul 2021 04:06:55 +0000 Subject: [PATCH 13/16] buildRustCrate: Don't override the linker during cross lld is sometimes need. The caller can do that instead. --- pkgs/build-support/rust/build-rust-crate/build-crate.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/build-support/rust/build-rust-crate/build-crate.nix b/pkgs/build-support/rust/build-rust-crate/build-crate.nix index ba695f2f66c3..42c5f6ab3c0f 100644 --- a/pkgs/build-support/rust/build-rust-crate/build-crate.nix +++ b/pkgs/build-support/rust/build-rust-crate/build-crate.nix @@ -17,7 +17,6 @@ (mkRustcFeatureArgs crateFeatures) ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "--target" (rust.toRustTargetSpec stdenv.hostPlatform) - "-C" "linker=${stdenv.hostPlatform.config}-ld" ] ++ extraRustcOpts # since rustc 1.42 the "proc_macro" crate is part of the default crate prelude # https://github.com/rust-lang/cargo/commit/4d64eb99a4#diff-7f98585dbf9d30aa100c8318e2c77e79R1021-R1022 From dffd972ab417c182dcad9524acfcf6f2a72160b9 Mon Sep 17 00:00:00 2001 From: "R. RyanTM" Date: Wed, 6 Oct 2021 21:36:52 +0000 Subject: [PATCH 14/16] ser2net: 4.3.3 -> 4.3.4 --- pkgs/servers/ser2net/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/servers/ser2net/default.nix b/pkgs/servers/ser2net/default.nix index ce14e5d89650..c09b19378af4 100644 --- a/pkgs/servers/ser2net/default.nix +++ b/pkgs/servers/ser2net/default.nix @@ -10,13 +10,13 @@ stdenv.mkDerivation rec { pname = "ser2net"; - version = "4.3.3"; + version = "4.3.4"; src = fetchFromGitHub { owner = "cminyard"; repo = pname; rev = "v${version}"; - sha256 = "sha256-p8iQifCf/IXXPdbjB3pgcw8FgkqRLShHSSeTzJ83Ecg="; + sha256 = "sha256-J95WDF6x6nHF+r+97E4WdTkXWF98/lx1OSauZTy1/3Q="; }; passthru = { From 6eb75312553092f4b0b1a7a98868c7303dfe2125 Mon Sep 17 00:00:00 2001 From: Robin Townsend Date: Wed, 6 Oct 2021 18:15:58 -0400 Subject: [PATCH 15/16] bcachefs-tools: 2021-07-08 -> 2021-10-01 Recent updates to the bcachefs kernel resulted in a change in on-disk format. However, since bcachefs-tools wasn't updated at the same time, they became incompatible, causing a variety of issues. This brings the linux-testing-bcachefs and bcachefs-tools versions back into sync. --- pkgs/tools/filesystems/bcachefs-tools/default.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkgs/tools/filesystems/bcachefs-tools/default.nix b/pkgs/tools/filesystems/bcachefs-tools/default.nix index be7a42e19e9d..bdb7e55b5cf5 100644 --- a/pkgs/tools/filesystems/bcachefs-tools/default.nix +++ b/pkgs/tools/filesystems/bcachefs-tools/default.nix @@ -22,20 +22,21 @@ stdenv.mkDerivation { pname = "bcachefs-tools"; - version = "unstable-2021-07-08"; + version = "unstable-2021-10-01"; src = fetchFromGitHub { owner = "koverstreet"; repo = "bcachefs-tools"; - rev = "050d5f7bcf08bd02f5077a1c5559f352fa449e1e"; - sha256 = "15bl9ni0ckmvs5d7hi6v26z690rrmkb7dx00skn6gwq87ffz3imw"; + rev = "37850436dd7dfbe67738749c4d4a2506ffff1ec3"; + sha256 = "040vgxrimahmfs9rhlggfwg0bzl7h9j2ksx3563rh63asjwlhnhi"; }; postPatch = '' substituteInPlace Makefile \ --replace "pytest-3" "pytest --verbose" \ --replace "INITRAMFS_DIR=/etc/initramfs-tools" \ - "INITRAMFS_DIR=${placeholder "out"}/etc/initramfs-tools" + "INITRAMFS_DIR=${placeholder "out"}/etc/initramfs-tools" \ + --replace "doc/macro2rst.py" "python3 doc/macro2rst.py" ''; nativeBuildInputs = [ pkg-config docutils ]; From a961352f5ebc021129ce529fda52968b0b0eb158 Mon Sep 17 00:00:00 2001 From: Robin Townsend Date: Wed, 6 Oct 2021 18:19:24 -0400 Subject: [PATCH 16/16] linux-testing-bcachefs: Add note about keeping bcachefs-tools up to date --- pkgs/os-specific/linux/kernel/linux-testing-bcachefs.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/os-specific/linux/kernel/linux-testing-bcachefs.nix b/pkgs/os-specific/linux/kernel/linux-testing-bcachefs.nix index 378461f217e8..fa5729baf73a 100644 --- a/pkgs/os-specific/linux/kernel/linux-testing-bcachefs.nix +++ b/pkgs/os-specific/linux/kernel/linux-testing-bcachefs.nix @@ -1,6 +1,7 @@ { lib, buildPackages, fetchFromGitHub, fetchpatch, perl, buildLinux, ... } @ args: buildLinux (args // { + # NOTE: bcachefs-tools should be updated simultaneously to preserve compatibility version = "5.13.0-2021.10.01"; modDirVersion = "5.13.0";