Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build/nix/update flake inputs #98

Merged
merged 10 commits into from
Jul 22, 2023
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: cachix/install-nix-action@v21
- uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixos-22.11
github_access_token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -30,8 +30,11 @@ jobs:

- uses: cachix/cachix-action@v12
with:
name: nix-blockchain-development
name: mcl-blockchain-packages
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'

- name: Run the Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@v1

- name: Build Nix dev shell
run: ./scripts/ci.sh
2 changes: 1 addition & 1 deletion .github/workflows/update-flake-lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: cachix/install-nix-action@v21
- uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixos-unstable
github_access_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
42 changes: 21 additions & 21 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@

nixConfig = {
extra-substituters = [
"https://mcl-blockchain-packages.cachix.org"
"https://nix-blockchain-development.cachix.org"
"https://cache.iog.io"
];
extra-trusted-public-keys = [
"mcl-blockchain-packages.cachix.org-1:qoEiUyBgNXmgJTThjbjO//XA9/6tCmx/OohHHt9hWVY="
"nix-blockchain-development.cachix.org-1:Ekei3RuW3Se+P/UIo6Q/oAgor/fVhFuuuX5jR8K/cdg="
"hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ="
];
Expand Down
2 changes: 1 addition & 1 deletion packages/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
sha256 = "sha256-mYLxwJ0oiKfiz+NZ5bnlY0h2uq5wbeQKrwoCCw23Bg0=";
};
subPackages = builtins.filter (x: x != "cmd/puppeth") args.subPackages;
vendorSha256 = "sha256-6yLkeT5DrAPUohAmobssKkvxgXI8kACxiu17WYbw+n0=";
vendorHash = "sha256-6yLkeT5DrAPUohAmobssKkvxgXI8kACxiu17WYbw+n0=";
});
};

Expand Down
24 changes: 16 additions & 8 deletions packages/nimbus/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
fetchFromGitHub,
darwin,
lib,
git,
nim,
cmake,
which,
fetchpatch,
writeScriptBin,
# Options: nimbus_light_client, nimbus_validator_client, nimbus_signing_node
makeTargets ? ["all"],
Expand All @@ -20,21 +20,30 @@
"x86_64-windows"
],
}:
# Version 1.6.12 is known to be stable and overriden in top-level.
assert nim.version == "1.6.12";
# Nim version(s) that are known to be stable
assert nim.version == "1.6.12" || nim.version == "1.6.14";
stdenv.mkDerivation rec {
pname = "nimbus";
rev = "499b870a1a8e6688ff03b958709955075064b7e5";
version = "23.3.2.dev";
rev = "187e1a06335e36bbc508fff38729833d154edbaa";
version = "23.6.1";

src = fetchFromGitHub {
owner = "status-im";
repo = "nimbus-eth2";
inherit rev;
hash = "sha256-0w9XGXxCAhBAuMkQ42Wh67Lmetn7Ihbdoq3iBOSx71k=";
hash = "sha256-O7jxRuJZkrdNZVZ3jMOPjTh/tWk3XgPwx5A0xgELvAU=";
fetchSubmodules = true;
};

patches = [
# Nim 1.6.14 support
(fetchpatch {
name = "nim-v1.6.14-support.patch";
url = "https://github.com/status-im/nimbus-eth2/commit/41b93ae57a7bb32758f453a09259ae44b37e3db9.patch";
hash = "sha256-yvXREhqc/C0Yo2ioTaOFFw7KAc0WgDkoM5SXXnaIjrQ=";
})
];

# Fix for Nim compiler calling 'git rev-parse' and 'lsb_release'.
nativeBuildInputs = let
fakeGit = writeScriptBin "git" "echo $commit";
Expand Down Expand Up @@ -73,9 +82,8 @@ assert nim.version == "1.6.12";
including Raspberry Pis, its low resource usage also makes it an excellent choice
for any server or desktop (where it simply takes up fewer resources).
'';
branch = "capella-eip4844-local-sim";
license = with licenses; [asl20 mit];
maintainers = with maintainers; [jakubgs];
mainProgram = "nimbus_beacon_node";
platforms = stablePlatforms;
};
}
6 changes: 5 additions & 1 deletion packages/polkadot/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@
commitSha1 = "9b1fc27cec47f01a2c229532ee7ab79cc5bb28ef";
srcSha256 = "sha256-73YvkpYoRcM9cvEICjqddxT/gJDcEVfP7QrSSyT92JY=";
};
"v0.9.43" = {
commitSha1 = "ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25";
srcSha256 = "sha256-KYmMMcQMkkXfWj5ZTr549a/8ftELKo0PUvCrmRMiDaE=";
};
};

version = "0.9.42";
version = "0.9.43";

commonArgs = {
src = fetchFromGitHub {
Expand Down
12 changes: 8 additions & 4 deletions packages/solana-bpf-tools/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,23 @@
with pkgs;
stdenv.mkDerivation rec {
name = "solana-bpf-tools-${version}";
version = "1.29";
version = "1.37";
src = fetchzip {
url = "https://github.com/solana-labs/bpf-tools/releases/download/v${version}/solana-bpf-tools-linux.tar.bz2";
sha256 = "sha256-WxO7Jw2EJPP1u2U80MEosjrwPfOAFzvl0ovx3nADtMk=";
url = "https://github.com/solana-labs/platform-tools/releases/download/v${version}/platform-tools-linux-x86_64.tar.bz2";
sha256 = "sha256-llKrtYIxM8YvIiJZauYdVIV4XISS7Jk4EZ/H4bCbfN4=";
stripRoot = false;
};

# TODO autoPatchElf is Linux-specific. We need a cross-platform solution.
nativeBuildInputs = lib.optionals stdenv.isLinux [autoPatchelfHook gccForLibs.lib];

buildInputs = with pkgs; [
python38
ncurses
lzma
libxml2
zlib
openssl_1_1
openssl
];

installPhase = ''
Expand Down
15 changes: 2 additions & 13 deletions packages/solana-rust-artifacts/default.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
{pkgs}:
pkgs.solana-testnet.overrideAttrs (old: {
pname = "solana-rust-artifacts";
buildAndTestSubdir = null;
nativeBuildInputs = old.nativeBuildInputs ++ [pkgs.llvmPackages_13.clang];
buildInputs = old.buildInputs ++ [pkgs.openssl];
LIBCLANG_PATH = "${pkgs.llvmPackages_13.libclang.lib}/lib";
CARGO_FEATURE_VENDORED = "0";
OPENSSL_NO_VENDOR = "1";
postInstall = ''
mkdir -p $out/bin/sdk/
cp -r ./sdk/bpf $out/bin/sdk/
'';
patches = old.patches ++ [../cargo-build-bpf/patches/main.rs.diff];
pkgs.solana-validator.overrideAttrs (old: {
# patches = old.patches ++ [../cargo-build-bpf/patches/main.rs.diff];
})
18 changes: 3 additions & 15 deletions scripts/commit_flake_update.bash
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,15 @@ if ! git config --get user.name >/dev/null 2>&1 || \
[ "$(git config --get user.email)" = "" ]; then
echo "git config user.{name,email} is not set - configuring"
set -x
git config --local user.email "actions-bot"
git config --local user.name "actions-bot@users.noreply.github.com"
git config --local user.email "out@space.com"
git config --local user.name "beep boop"
fi

nix flake update --commit-lock-file

cat >commit_msg <<EOF
git commit --amend -F - <<EOF
chore(flake.lock): Update all Flake inputs ($(date -I))

$(git log -1 '--pretty=format:%b' | sed '1,2d')
EOF

git reset --soft 'HEAD~'

if [[ -z "${GITHUB_ENV:-}" ]]; then
echo "Not running in CI - exiting"
exit 0
fi

>> "$GITHUB_ENV" cat <<EOF
COMMIT_MSG<<EOV
$(cat ./commit_msg)
EOV
EOF