From 0ad13ca8977c0e1e1d8802cf4b723bf6ebf3479a Mon Sep 17 00:00:00 2001 From: Arnaud Date: Wed, 3 Jun 2026 12:27:04 +0400 Subject: [PATCH] chore: update nimbus build system (#1433) --- nix/checksums.nix | 2 +- nix/csources.nix | 4 ++-- nix/default.nix | 12 ++++-------- nix/nimble.nix | 6 ++++-- vendor/nimbus-build-system | 2 +- 5 files changed, 12 insertions(+), 14 deletions(-) diff --git a/nix/checksums.nix b/nix/checksums.nix index c9c9f3d4..1146e461 100644 --- a/nix/checksums.nix +++ b/nix/checksums.nix @@ -8,5 +8,5 @@ in pkgs.fetchFromGitHub { repo = "checksums"; rev = tools.findKeyValue "^ +ChecksumsStableCommit = \"([a-f0-9]+)\".*$" sourceFile; # WARNING: Requires manual updates when Nim compiler version changes. - hash = "sha256-JZhWqn4SrAgNw/HLzBK0rrj3WzvJ3Tv1nuDMn83KoYY="; + hash = "sha256-xC11sD13OTMMUY4F5CrF1XxKSigLtIPt2XQCcQOFNdM="; } diff --git a/nix/csources.nix b/nix/csources.nix index 33cd9d0f..f65da1ff 100644 --- a/nix/csources.nix +++ b/nix/csources.nix @@ -5,8 +5,8 @@ let sourceFile = ../vendor/nimbus-build-system/vendor/Nim/config/build_config.txt; in pkgs.fetchFromGitHub { owner = "nim-lang"; - repo = "csources_v2"; + repo = "csources_v3"; rev = tools.findKeyValue "^nim_csourcesHash=([a-f0-9]+)$" sourceFile; # WARNING: Requires manual updates when Nim compiler version changes. - hash = "sha256-UCLtoxOcGYjBdvHx7A47x6FjLMi6VZqpSs65MN7fpBs="; + hash = "sha256-pTcm2y+HDOuTol8DyoJMOMHsUA6QrgwGdfcOu1NX4PU="; } diff --git a/nix/default.nix b/nix/default.nix index d7cd15ce..2c38dd89 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -63,15 +63,11 @@ in stdenv.mkDerivation rec { "QUICK_AND_DIRTY_NIMBLE=${if quickAndDirty then "1" else "0"}" ]; - # FIXME: Remove once permanent fix is applied to NBS: - patchPhase = '' - substituteInPlace vendor/nimbus-build-system/scripts/build_nim.sh \ - --replace-fail '"''${NIX_BUILD_TOP}" != "/build"' '-z $${NIX_BUILD_TOP}' - ''; - configurePhase = '' # Avoid Nim cache permission errors. export XDG_CACHE_HOME=$TMPDIR + # Force build of Nimble from dist/nimble source. + export NIMBLE_COMMIT="" patchShebangs . vendor/nimbus-build-system > /dev/null make nimbus-build-system-paths ''; @@ -81,8 +77,8 @@ in stdenv.mkDerivation rec { mkdir dist cp -r ${callPackage ./nimble.nix {}} dist/nimble cp -r ${callPackage ./checksums.nix {}} dist/checksums - cp -r ${callPackage ./csources.nix {}} csources_v2 - chmod 777 -R dist/nimble csources_v2 + cp -r ${callPackage ./csources.nix {}} csources_v3 + chmod 777 -R dist/nimble csources_v3 popd ''; diff --git a/nix/nimble.nix b/nix/nimble.nix index 6eb4c8a0..7dde65c5 100644 --- a/nix/nimble.nix +++ b/nix/nimble.nix @@ -2,12 +2,14 @@ let tools = pkgs.callPackage ./tools.nix {}; + nbsVersion = tools.findKeyValue "^[[:space:]]+NIMBLE_COMMIT='([a-f0-9]+)'.*$" ../vendor/nimbus-build-system/scripts/build_nim.sh; + nimVersion = tools.findKeyValue "^ +NimbleStableCommit = \"([a-f0-9]+)\".+" ../vendor/nimbus-build-system/vendor/Nim/koch.nim; sourceFile = ../vendor/nimbus-build-system/vendor/Nim/koch.nim; in pkgs.fetchFromGitHub { owner = "nim-lang"; repo = "nimble"; fetchSubmodules = true; - rev = tools.findKeyValue "^ +NimbleStableCommit = \"([a-f0-9]+)\".+" sourceFile; + rev = if nbsVersion != null then nbsVersion else nimVersion; # WARNING: Requires manual updates when Nim compiler version changes. - hash = "sha256-wgzFhModFkwB8st8F5vSkua7dITGGC2cjoDvgkRVZMs="; + hash = "sha256-v0RhIx6ithFJqH6ThKpyvC0JB3CBCevahhCossC+deA="; } diff --git a/vendor/nimbus-build-system b/vendor/nimbus-build-system index 0be0663e..f34e2130 160000 --- a/vendor/nimbus-build-system +++ b/vendor/nimbus-build-system @@ -1 +1 @@ -Subproject commit 0be0663e1af76e869837226a4ef3e586fcc737d3 +Subproject commit f34e2130c14e527e62fc1118de2fc2d7d6fdcb4a