bump nimbus-build-system to use Nim v2.0.6 (#6386)

* 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 <jakub@status.im>

---------

Signed-off-by: Jakub Sokołowski <jakub@status.im>
Co-authored-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
tersec 2024-06-24 22:02:16 +00:00 committed by GitHub
parent 7b680bb72d
commit 2d4ece0c3b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 24 additions and 18 deletions

View File

@ -35,21 +35,16 @@ jobs:
cpu: amd64 cpu: amd64
- os: windows - os: windows
cpu: amd64 cpu: amd64
branch: [~, upstream/version-1-6, v2.0.6] branch: [~, upstream/version-2-0]
exclude: exclude:
- target: - target:
os: macos os: macos
branch: upstream/version-1-6 branch: upstream/version-2-0
- target: - target:
os: windows os: windows
branch: upstream/version-1-6 branch: upstream/version-2-0
- target:
os: windows
branch: ~
include: include:
- branch: upstream/version-1-6 - branch: upstream/version-2-0
branch-short: version-1-6
- branch: v2.0.6
branch-short: version-2-0 branch-short: version-2-0
nimflags-extra: --mm:refc nimflags-extra: --mm:refc
- target: - target:

12
nix/checksums.nix Normal file
View File

@ -0,0 +1,12 @@
{ pkgs ? import <nixpkgs> { } }:
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=";
}

View File

@ -5,8 +5,8 @@ let
sourceFile = ../vendor/nimbus-build-system/vendor/Nim/config/build_config.txt; sourceFile = ../vendor/nimbus-build-system/vendor/Nim/config/build_config.txt;
in pkgs.fetchFromGitHub { in pkgs.fetchFromGitHub {
owner = "nim-lang"; owner = "nim-lang";
repo = "csources_v1"; repo = "csources_v2";
rev = tools.findKeyValue "^nim_csourcesHash=([a-f0-9]+)$" sourceFile; rev = tools.findKeyValue "^nim_csourcesHash=([a-f0-9]+)$" sourceFile;
# WARNING: Requires manual updates when Nim compiler version changes. # WARNING: Requires manual updates when Nim compiler version changes.
hash = "sha256-gwBFuR7lzO4zttR/6rgdjXMRxVhwKeLqDwpmOwMyU7A="; hash = "sha256-UCLtoxOcGYjBdvHx7A47x6FjLMi6VZqpSs65MN7fpBs=";
} }

View File

@ -19,9 +19,7 @@
let let
inherit (pkgs) stdenv lib writeScriptBin callPackage; inherit (pkgs) stdenv lib writeScriptBin callPackage;
nimble = callPackage ./nimble.nix {}; revision = lib.substring 0 8 (src.rev or "unknown");
csources = callPackage ./csources.nix {};
revision = lib.substring 0 8 (src.rev or "dirty");
in stdenv.mkDerivation rec { in stdenv.mkDerivation rec {
pname = "nimbus-eth2"; pname = "nimbus-eth2";
version = "${callPackage ./version.nix {}}-${revision}"; version = "${callPackage ./version.nix {}}-${revision}";
@ -60,9 +58,10 @@ in stdenv.mkDerivation rec {
preBuild = '' preBuild = ''
pushd vendor/nimbus-build-system/vendor/Nim pushd vendor/nimbus-build-system/vendor/Nim
mkdir dist mkdir dist
cp -r ${nimble} dist/nimble cp -r ${callPackage ./nimble.nix {}} dist/nimble
cp -r ${csources} csources_v1 cp -r ${callPackage ./checksums.nix {}} dist/checksums
chmod 777 -R dist/nimble csources_v1 cp -r ${callPackage ./csources.nix {}} csources_v2
chmod 777 -R dist/nimble csources_v2
sed -i 's/isGitRepo(destDir)/false/' tools/deps.nim sed -i 's/isGitRepo(destDir)/false/' tools/deps.nim
popd popd
''; '';

@ -1 +1 @@
Subproject commit 8cdaec502b5a48f2514e11209f0d81a001d2a2b1 Subproject commit 09a35687897041c152986f13473466fa55f987ca