From 2d4ece0c3b81152ecc48b8c8fb0557d017a10d0b Mon Sep 17 00:00:00 2001 From: tersec Date: Mon, 24 Jun 2024 22:02:16 +0000 Subject: [PATCH] bump nimbus-build-system to use Nim v2.0.6 (#6386) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * bump nimbus-build-system to use Nim v2.0.6 * fix: update name and hash for csources of Nim v2 Otherwise we get errors like: ``` Building: Nim compiler /build/source/vendor/nimbus-build-system/vendor/Nim /build/source cmd: git clone -q --depth 1 -b master https://github.com/nim-lang/csources_v2.git csources_v2 24.6.0-dirty cmd: cd csources_v2 ci/funs.sh: line 10: cd: csources_v2: No such file or directory make[1]: *** [vendor/nimbus-build-system/makefiles/targets.mk:81: build-nim] Error 1 ``` Also need to add source for `checksums` repository. Signed-off-by: Jakub Sokołowski --------- Signed-off-by: Jakub Sokołowski Co-authored-by: Jakub Sokołowski --- .github/workflows/ci.yml | 13 ++++--------- nix/checksums.nix | 12 ++++++++++++ nix/csources.nix | 4 ++-- nix/default.nix | 11 +++++------ vendor/nimbus-build-system | 2 +- 5 files changed, 24 insertions(+), 18 deletions(-) create mode 100644 nix/checksums.nix diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 19bbff1ee..bb3025379 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,21 +35,16 @@ jobs: cpu: amd64 - os: windows cpu: amd64 - branch: [~, upstream/version-1-6, v2.0.6] + branch: [~, upstream/version-2-0] exclude: - target: os: macos - branch: upstream/version-1-6 + branch: upstream/version-2-0 - target: os: windows - branch: upstream/version-1-6 - - target: - os: windows - branch: ~ + branch: upstream/version-2-0 include: - - branch: upstream/version-1-6 - branch-short: version-1-6 - - branch: v2.0.6 + - branch: upstream/version-2-0 branch-short: version-2-0 nimflags-extra: --mm:refc - target: diff --git a/nix/checksums.nix b/nix/checksums.nix new file mode 100644 index 000000000..c3b322e3a --- /dev/null +++ b/nix/checksums.nix @@ -0,0 +1,12 @@ +{ pkgs ? import { } }: + +let + tools = pkgs.callPackage ./tools.nix {}; + sourceFile = ../vendor/nimbus-build-system/vendor/Nim/koch.nim; +in pkgs.fetchFromGitHub { + owner = "nim-lang"; + repo = "checksums"; + rev = tools.findKeyValue "^ +ChecksumsStableCommit = \"([a-f0-9]+)\"$" sourceFile; + # WARNING: Requires manual updates when Nim compiler version changes. + hash = "sha256-AIiMBqLcGJCTkINHfJ2dN3ogitU7Za9Z9Sv9zjKeOQk="; +} diff --git a/nix/csources.nix b/nix/csources.nix index ed217e5cf..33cd9d0fc 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_v1"; + repo = "csources_v2"; rev = tools.findKeyValue "^nim_csourcesHash=([a-f0-9]+)$" sourceFile; # WARNING: Requires manual updates when Nim compiler version changes. - hash = "sha256-gwBFuR7lzO4zttR/6rgdjXMRxVhwKeLqDwpmOwMyU7A="; + hash = "sha256-UCLtoxOcGYjBdvHx7A47x6FjLMi6VZqpSs65MN7fpBs="; } diff --git a/nix/default.nix b/nix/default.nix index a86470974..a444329eb 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -19,9 +19,7 @@ let inherit (pkgs) stdenv lib writeScriptBin callPackage; - nimble = callPackage ./nimble.nix {}; - csources = callPackage ./csources.nix {}; - revision = lib.substring 0 8 (src.rev or "dirty"); + revision = lib.substring 0 8 (src.rev or "unknown"); in stdenv.mkDerivation rec { pname = "nimbus-eth2"; version = "${callPackage ./version.nix {}}-${revision}"; @@ -60,9 +58,10 @@ in stdenv.mkDerivation rec { preBuild = '' pushd vendor/nimbus-build-system/vendor/Nim mkdir dist - cp -r ${nimble} dist/nimble - cp -r ${csources} csources_v1 - chmod 777 -R dist/nimble csources_v1 + 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 sed -i 's/isGitRepo(destDir)/false/' tools/deps.nim popd ''; diff --git a/vendor/nimbus-build-system b/vendor/nimbus-build-system index 8cdaec502..09a356878 160000 --- a/vendor/nimbus-build-system +++ b/vendor/nimbus-build-system @@ -1 +1 @@ -Subproject commit 8cdaec502b5a48f2514e11209f0d81a001d2a2b1 +Subproject commit 09a35687897041c152986f13473466fa55f987ca