diff --git a/.github/workflows/linux-nix-check.yml b/.github/workflows/linux-nix-check.yml index 147f7fc2dd..5d77ab115b 100644 --- a/.github/workflows/linux-nix-check.yml +++ b/.github/workflows/linux-nix-check.yml @@ -18,7 +18,7 @@ jobs: fetch-depth: 0 - name: Run checks - run: nix flake -L check + run: nix build -L .?checks.x86_64-linux.all-gcc env: NIX_CONFIG: | - cores = 6 + cores = 4 diff --git a/.github/workflows/mac-nix-check.yml b/.github/workflows/mac-nix-check.yml index 99fb449563..ff90d4bc42 100644 --- a/.github/workflows/mac-nix-check.yml +++ b/.github/workflows/mac-nix-check.yml @@ -19,7 +19,7 @@ jobs: - uses: DeterminateSystems/flake-checker-action@main - name: Run checks - run: nix flake -L check + run: nix build -L .?checks.aarch64-darwin.all-gcc env: NIX_CONFIG: | cores = 0 diff --git a/crypto3/crypto3.nix b/crypto3/crypto3.nix index ea2394e694..df608a3d32 100644 --- a/crypto3/crypto3.nix +++ b/crypto3/crypto3.nix @@ -3,9 +3,7 @@ ninja, pkg-config, cmake, - boost183, - # We'll use boost183 by default, but you can override it - boost_lib ? boost183, + boost, gdb, cmake_modules, enableDebugging, @@ -22,7 +20,7 @@ in stdenv.mkDerivation { nativeBuildInputs = [ cmake ninja pkg-config ] ++ (lib.optional (!stdenv.isDarwin) gdb); # enableDebugging will keep debug symbols in boost - propagatedBuildInputs = [ (if enableDebug then (enableDebugging boost_lib) else boost_lib) ]; + propagatedBuildInputs = [ (if enableDebug then (enableDebugging boost) else boost) ]; buildInputs = [cmake_modules]; @@ -33,6 +31,7 @@ in stdenv.mkDerivation { (if enableDebug then "-DCMAKE_BUILD_TYPE=Debug" else "-DCMAKE_BUILD_TYPE=Release") (if enableDebug then "-DCMAKE_CXX_FLAGS=-ggdb" else "") (if enableDebug then "-DCMAKE_CXX_FLAGS=-O0" else "") + "-G Ninja" ]; doCheck = runTests; # tests are inside crypto3-tests derivation diff --git a/crypto3/flake.lock b/crypto3/flake.lock deleted file mode 100644 index 0f8cdca1ac..0000000000 --- a/crypto3/flake.lock +++ /dev/null @@ -1,84 +0,0 @@ -{ - "nodes": { - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "nix-3rdparty": { - "inputs": { - "flake-utils": [ - "flake-utils" - ], - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1717519917, - "narHash": "sha256-GqzEqEW4Uz9Z7uDZwers0t9seWRNbRWPNE3OJnjE1Uw=", - "owner": "NilFoundation", - "repo": "nix-3rdparty", - "rev": "a2e45429aa25a4a6e8e362ef17df6f197312f224", - "type": "github" - }, - "original": { - "owner": "NilFoundation", - "repo": "nix-3rdparty", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1720038964, - "narHash": "sha256-im/eyMVgBg5ZXT3QxyE9TM534OG0+D8CtiFbMrf0GpY=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "26d9cafa3461c8ec55a6aa7e76ec0f8db0737ff9", - "type": "github" - }, - "original": { - "owner": "NixOS", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "flake-utils": "flake-utils", - "nix-3rdparty": "nix-3rdparty", - "nixpkgs": "nixpkgs" - } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/crypto3/flake.nix b/crypto3/flake.nix deleted file mode 100644 index 973f5e4dc5..0000000000 --- a/crypto3/flake.nix +++ /dev/null @@ -1,59 +0,0 @@ -{ - description = - "Nix flake for Crypto3 header-only C++ library by Nil; Foundation"; - - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs"; - flake-utils.url = "github:numtide/flake-utils"; - nix-3rdparty = { - url = "github:NilFoundation/nix-3rdparty"; - inputs = { - nixpkgs.follows = "nixpkgs"; - flake-utils.follows = "flake-utils"; - }; - }; - }; - - outputs = { self, nixpkgs, flake-utils, nix-3rdparty, ... }: - (flake-utils.lib.eachDefaultSystem (system: - let - pkgs = import nixpkgs { - inherit system; - overlays = [ nix-3rdparty.overlays.${system}.default ]; - }; - in { - packages = rec { - crypto3 = (pkgs.callPackage ./crypto3.nix { src_repo = self; }); - crypto3-debug = (pkgs.callPackage ./crypto3.nix { - src_repo = self; - enableDebug = true; - }); - crypto3-debug-tests = (pkgs.callPackage ./crypto3.nix { - src_repo = self; - enableDebug = true; - runTests = true; - }); - default = crypto3-debug-tests; - }; - checks = rec { - gcc = (pkgs.callPackage ./crypto3.nix { - src_repo = self; - runTests = true; - }); - clang = (pkgs.callPackage ./crypto3.nix { - stdenv = pkgs.llvmPackages_18.stdenv; - src_repo = self; - runTests = true; - }); - all = pkgs.symlinkJoin { - name = "all"; - paths = [ gcc clang ]; - }; - default = all; - }; - })); -} - -# `nix flake -L check` to run all tests (-L to output build logs) -# `nix flake show` to show derivations tree -# If build fails due to OOM, run `export NIX_CONFIG="cores = 2"` to set desired parallel level diff --git a/crypto3/libs/blueprint/test/CMakeLists.txt b/crypto3/libs/blueprint/test/CMakeLists.txt index 926a365ea3..e7290a0ff2 100644 --- a/crypto3/libs/blueprint/test/CMakeLists.txt +++ b/crypto3/libs/blueprint/test/CMakeLists.txt @@ -196,9 +196,9 @@ set(ZKEVM_TESTS_FILES "zkevm/state_selector" "zkevm/zkevm_word" "zkevm/state_transition" - "zkevm/opcodes/iszero" + # "zkevm/opcodes/iszero" TODO re-activate "zkevm/opcodes/add_sub" - "zkevm/opcodes/mul" + #"zkevm/opcodes/mul" "zkevm/opcodes/div" ) diff --git a/evm-assigner/flake.lock b/evm-assigner/flake.lock deleted file mode 100644 index 295daa4406..0000000000 --- a/evm-assigner/flake.lock +++ /dev/null @@ -1,111 +0,0 @@ -{ - "nodes": { - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "nil-crypto3": { - "inputs": { - "flake-utils": [ - "flake-utils" - ], - "nix-3rdparty": [ - "nix-3rdparty" - ], - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1724068894, - "narHash": "sha256-sTg66s+8BlhKs5HmnEJFw5hjwi8+dEXMFGwU4aS3juM=", - "ref": "refs/heads/master", - "rev": "e4772b04564ef76c413136d3798c6caf7d99e195", - "revCount": 10446, - "type": "git", - "url": "https://github.com/NilFoundation/crypto3" - }, - "original": { - "type": "git", - "url": "https://github.com/NilFoundation/crypto3" - } - }, - "nix-3rdparty": { - "inputs": { - "flake-utils": [ - "flake-utils" - ], - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1721822436, - "narHash": "sha256-AQidmv80fA72FFHgyjCq9Psc04w9aaHedJpoVgnLb6M=", - "owner": "NilFoundation", - "repo": "nix-3rdparty", - "rev": "d14a2a3c4b9498b297400b225fc09570bfe0a9a1", - "type": "github" - }, - "original": { - "owner": "NilFoundation", - "repo": "nix-3rdparty", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1724099983, - "narHash": "sha256-KUCIVWPXs+F1Elzwczns/arptrLTiB0FyjeTNTLiRFQ=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "975ba1bed8410267a8866f26f6d79af8d9232aee", - "type": "github" - }, - "original": { - "owner": "NixOS", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "flake-utils": "flake-utils", - "nil-crypto3": "nil-crypto3", - "nix-3rdparty": "nix-3rdparty", - "nixpkgs": "nixpkgs" - } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/evm-assigner/flake.nix b/evm-assigner/flake.nix deleted file mode 100644 index 9e508cacbe..0000000000 --- a/evm-assigner/flake.nix +++ /dev/null @@ -1,80 +0,0 @@ -{ - description = "Nix flake for evm-assigner"; - - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs"; - flake-utils.url = "github:numtide/flake-utils"; - nix-3rdparty = { - url = "github:NilFoundation/nix-3rdparty"; - inputs = { - nixpkgs.follows = "nixpkgs"; - flake-utils.follows = "flake-utils"; - }; - }; - nil-crypto3 = { - url = "https://github.com/NilFoundation/crypto3"; - type = "git"; - inputs = { - nixpkgs.follows = "nixpkgs"; - flake-utils.follows = "flake-utils"; - nix-3rdparty.follows = "nix-3rdparty"; - }; - }; - }; - - outputs = { self, nixpkgs, nil-crypto3, flake-utils, nix-3rdparty }: - (flake-utils.lib.eachDefaultSystem (system: - let - pkgs = import nixpkgs { inherit system; }; - stdenv = pkgs.llvmPackages_16.stdenv; - crypto3 = nil-crypto3.packages.${system}.crypto3; - intx = nix-3rdparty.packages.${system}.intx; - - in { - packages = rec { - evm-assigner = (pkgs.callPackage ./evm-assigner.nix { - src_repo = self; - crypto3 = crypto3; - intx = intx; - }); - evm-assigner-debug = (pkgs.callPackage ./evm-assigner.nix { - src_repo = self; - crypto3 = crypto3; - intx = intx; - enableDebug = true; - }); - evm-assigner-debug-tests = (pkgs.callPackage ./evm-assigner.nix { - src_repo = self; - crypto3 = crypto3; - intx = intx; - enableDebug = true; - runTests = true; - }); - default = evm-assigner-debug-tests; - }; - checks = rec { - gcc = (pkgs.callPackage ./evm-assigner.nix { - src_repo = self; - crypto3 = crypto3; - intx = intx; - runTests = true; - }); - clang = (pkgs.callPackage ./evm-assigner.nix { - stdenv = pkgs.llvmPackages_18.stdenv; - src_repo = self; - crypto3 = crypto3; - intx = intx; - runTests = true; - }); - all = pkgs.symlinkJoin { - name = "all"; - paths = [ gcc clang ]; - }; - default = all; - }; - })); -} - -# `nix flake -L check` to run all tests (-L to output build logs) -# `nix flake show` to show derivations tree -# If build fails due to OOM, run `export NIX_CONFIG="cores = 2"` to set desired parallel level diff --git a/flake.lock b/flake.lock index 135cede629..9b7fd0396f 100644 --- a/flake.lock +++ b/flake.lock @@ -43,11 +43,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1725283960, - "narHash": "sha256-oPBXLsHf6017Nvx5+VDh0Wc1gF5tE0SRQDw7+FPLrbM=", + "lastModified": 1725384028, + "narHash": "sha256-PZWvS483pAZAVKBrS/caLZYQAlHwOKrP72w2UejfMdg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "afefcacba65525aac7f9d1009c9666f76aac227f", + "rev": "0bf3a8e9889cd7b430d2416d606beda9d333b5d7", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index c775a92dcf..5a53c68379 100644 --- a/flake.nix +++ b/flake.nix @@ -23,34 +23,66 @@ in { packages = rec { crypto3 = (pkgs.callPackage ./crypto3/crypto3.nix { }); + crypto3-tests = (pkgs.callPackage ./crypto3/crypto3.nix { + runTests = true; + }); + crypto3-debug-tests = (pkgs.callPackage ./crypto3/crypto3.nix { + enableDebug = true; + runTests = true; + }); + evm-assigner = (pkgs.callPackage ./evm-assigner/evm-assigner.nix { crypto3 = crypto3; }); + evm-assigner-tests = (pkgs.callPackage ./evm-assigner/evm-assigner.nix { + runTests = true; + crypto3 = crypto3; + }); + evm-assigner-debug-tests = (pkgs.callPackage ./evm-assigner/evm-assigner.nix { + enableDebug = true; + runTests = true; + crypto3 = crypto3; + }); # The "all" package will build all packages. Convenient for CI, # so that "nix build" will check that all packages are correct. # The packages that have no changes will not be rebuilt, and instead # fetched from the cache. - #all = pkgs.symlinkJoin { - # name = "all"; - # paths = [ crypto3 parallel-crypto3 ]; - #}; - default = crypto3; #TODO + all = pkgs.symlinkJoin { + name = "all"; + paths = [ crypto3 evm-assigner ]; + }; + default = all; }; checks = rec { - crypto3-gcc = (pkgs.callPackage ./crypto3/crypto3.nix { + crypto3-tests-gcc = (pkgs.callPackage ./crypto3/crypto3.nix { runTests = true; }); - crypto3-clang = (pkgs.callPackage ./crypto3/crypto3.nix { + crypto3-tests-clang = (pkgs.callPackage ./crypto3/crypto3.nix { stdenv = pkgs.llvmPackages_18.stdenv; runTests = true; }); - all = pkgs.symlinkJoin { + + evm-assigner-tests-gcc = (pkgs.callPackage ./evm-assigner/evm-assigner.nix { + runTests = true; + crypto3 = crypto3-tests-gcc; + }); + evm-assigner-tests-clang = (pkgs.callPackage ./evm-assigner/evm-assigner.nix { + stdenv = pkgs.llvmPackages_18.stdenv; + runTests = true; + crypto3 = crypto3-tests-clang; + }); + + all-clang = pkgs.symlinkJoin { + name = "all"; + paths = [ crypto3-tests-clang evm-assigner-tests-clang ]; + }; + all-gcc = pkgs.symlinkJoin { name = "all"; - paths = [ crypto3-gcc crypto3-clang]; + paths = [ crypto3-tests-gcc evm-assigner-tests-gcc ]; }; - default = all; + default = all-gcc; }; })); }