From 03d7171b4a9f5bce60d0cbe98bb61463836f7e3d Mon Sep 17 00:00:00 2001 From: David Meister Date: Sat, 23 May 2026 07:19:46 +0000 Subject: [PATCH 1/7] ci: modernize on latest rainix + use rust-shell Co-Authored-By: Claude Opus 4.7 --- .github/workflows/manual-rs-release.yml | 13 +-- .github/workflows/rainix-rs.yaml | 5 + .github/workflows/rainix.yml | 40 -------- .pre-commit-config.yaml | 1 + flake.lock | 131 +++++++++++++++++++----- flake.nix | 11 +- 6 files changed, 119 insertions(+), 82 deletions(-) create mode 100644 .github/workflows/rainix-rs.yaml delete mode 100644 .github/workflows/rainix.yml create mode 120000 .pre-commit-config.yaml diff --git a/.github/workflows/manual-rs-release.yml b/.github/workflows/manual-rs-release.yml index a5e5878..51be54f 100644 --- a/.github/workflows/manual-rs-release.yml +++ b/.github/workflows/manual-rs-release.yml @@ -14,7 +14,6 @@ on: - major # Increase the major version (x.0.0) - release # Remove the pre-version, ie remove alpha/beta/rc (x.y.z) - rc # Increase the rc pre-version (x.y.z-rc.M) - jobs: release: runs-on: ubuntu-latest @@ -22,8 +21,6 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - submodules: recursive - - uses: nixbuild/nix-quick-install-action@v30 with: nix_conf: | @@ -32,19 +29,13 @@ jobs: - name: Restore and save Nix store uses: nix-community/cache-nix-action@v6 with: - # restore and save a cache using this key primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }} - # if there's no cache hit, restore a cache by this prefix restore-prefixes-first-match: nix-${{ runner.os }}- gc-max-store-size-linux: 1G - - run: | git config --global user.email "${{ secrets.CI_GIT_EMAIL }}" git config --global user.name "${{ secrets.CI_GIT_USER }}" - - - run: nix develop -c rainix-rs-prelude - - run: nix develop -c rainix-rs-test - - - run: nix develop -c cargo release --no-confirm --execute ${{ inputs.version-level }} + - run: nix develop github:rainlanguage/rainix#rust-shell -c cargo test + - run: nix develop github:rainlanguage/rainix#rust-shell -c cargo release --no-confirm --execute ${{ inputs.version-level }} env: CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.github/workflows/rainix-rs.yaml b/.github/workflows/rainix-rs.yaml new file mode 100644 index 0000000..dd8689c --- /dev/null +++ b/.github/workflows/rainix-rs.yaml @@ -0,0 +1,5 @@ +name: rainix-rs +on: [push] +jobs: + rs: + uses: rainlanguage/rainix/.github/workflows/rainix-rs.yaml@main diff --git a/.github/workflows/rainix.yml b/.github/workflows/rainix.yml deleted file mode 100644 index 9b61d2d..0000000 --- a/.github/workflows/rainix.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Rainix CI -on: [push] - -jobs: - standard-tests: - runs-on: ubuntu-latest - strategy: - matrix: - task: [rainix-rs-test, rainix-rs-artifacts, rainix-rs-static] - fail-fast: false - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - submodules: recursive - - - uses: nixbuild/nix-quick-install-action@v30 - with: - nix_conf: | - keep-env-derivations = true - keep-outputs = true - - name: Restore and save Nix store - uses: nix-community/cache-nix-action@v6 - with: - # restore and save a cache using this key - primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }} - # if there's no cache hit, restore a cache by this prefix - restore-prefixes-first-match: nix-${{ runner.os }}- - gc-max-store-size-linux: 1G - - - name: Rainix Rust Prelude - run: nix develop -c rainix-rs-prelude - - - name: Run Command ${{ matrix.task }} - run: nix develop -c ${{ matrix.task }} - - - name: Build for wasm target - run: nix develop -c cargo build --target wasm32-unknown-unknown diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 120000 index 0000000..fc74104 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1 @@ +/nix/store/lm6f18alhwp2crdaimsvr09bg58pndfc-pre-commit-config.json \ No newline at end of file diff --git a/flake.lock b/flake.lock index 09614c3..c929fc9 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,21 @@ { "nodes": { + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1767039857, + "narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=", + "owner": "NixOS", + "repo": "flake-compat", + "rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "flake-compat", + "type": "github" + } + }, "flake-utils": { "inputs": { "systems": "systems" @@ -75,11 +91,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1741023058, - "narHash": "sha256-LSd/8CBlpDLjci5ANFJjP0w+dGdY/mqKsyUfhjGwnfs=", + "lastModified": 1778486972, + "narHash": "sha256-iuy/TbK9AbghEld2VSFuxyAF30LkOGUUdtrvixLfE7M=", "owner": "shazow", "repo": "foundry.nix", - "rev": "66becfe20b7e688b8f2e5774609c4436cf202ba0", + "rev": "db117ae95a77b9ead24137c3ccb28896ae4fa4ec", "type": "github" }, "original": { @@ -88,6 +104,48 @@ "type": "github" } }, + "git-hooks-nix": { + "inputs": { + "flake-compat": "flake-compat", + "gitignore": "gitignore", + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1778507602, + "narHash": "sha256-kTwur1wV+01SdqskVMSo6JMEpg71ps3HpbFY2GsflKs=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "61ab0e80d9c7ab14c256b5b453d8b3fb0189ba0a", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "rainix", + "git-hooks-nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1666753130, @@ -104,11 +162,27 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1747828570, - "narHash": "sha256-tv8R4Z/69GC8zogsb5TNDRj5tkhMeHpyYIzRl1cJigo=", + "lastModified": 1770073757, + "narHash": "sha256-Vy+G+F+3E/Tl+GMNgiHl9Pah2DgShmIUBJXmbiQPHbI=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "47472570b1e607482890801aeaf29bfb749884f6", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1778656924, + "narHash": "sha256-lKVrom9wOmpC3i7m+uBoGaBdW0PfH3QbLRG1XmuC6YA=", "owner": "nixos", "repo": "nixpkgs", - "rev": "040a62f13f40879a05578a66dd4ae0d284c55a5b", + "rev": "4ba039de0909446943c07e2b42bd2f0f4507072e", "type": "github" }, "original": { @@ -117,7 +191,7 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_4": { "locked": { "lastModified": 1744536153, "narHash": "sha256-awS2zRgF4uTwrOKwwiJcByDzDOdo3Q1rPZbiHQg/N38=", @@ -133,13 +207,13 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_5": { "locked": { - "lastModified": 1731531548, - "narHash": "sha256-sz8/v17enkYmfpgeeuyzniGJU0QQBfmAjlemAUYhfy8=", + "lastModified": 1777641297, + "narHash": "sha256-WNGcmeOZ8Tr9dq6ztCspYbzWFswr2mPebM9LpsfGxPk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "24f0d4acd634792badd6470134c387a3b039dace", + "rev": "c6d65881c5624c9cae5ea6cedef24699b0c0a4c0", "type": "github" }, "original": { @@ -153,20 +227,21 @@ "inputs": { "flake-utils": "flake-utils_2", "foundry": "foundry", - "nixpkgs": "nixpkgs_2", + "git-hooks-nix": "git-hooks-nix", + "nixpkgs": "nixpkgs_3", "rust-overlay": "rust-overlay", "solc": "solc" }, "locked": { - "lastModified": 1748346550, - "narHash": "sha256-Rlaj/hHHACo0blFKane6/arqIXWUCGe/sCNgqX8VfZ8=", - "owner": "rainprotocol", + "lastModified": 1779209879, + "narHash": "sha256-9x9V41PmF1RQlM5R6SV6xbgVnP+qgW9mUyRC50RQ9G8=", + "owner": "rainlanguage", "repo": "rainix", - "rev": "a1a5c321f356cb5006d16dd2d1a2242c183b7e96", + "rev": "d444279bc7346a6f4f7bd4a0b7f9900523b8f00e", "type": "github" }, "original": { - "owner": "rainprotocol", + "owner": "rainlanguage", "repo": "rainix", "type": "github" } @@ -179,14 +254,14 @@ }, "rust-overlay": { "inputs": { - "nixpkgs": "nixpkgs_3" + "nixpkgs": "nixpkgs_4" }, "locked": { - "lastModified": 1747795013, - "narHash": "sha256-c7i0xJ+xFhgjO9SWHYu5dF/7lq63RPDvwKAdjc6VCE4=", + "lastModified": 1778642276, + "narHash": "sha256-bhk4lawR4ZnFhPtamB5WkCyvfgyZmsEUbWfT/3FRxFY=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "6b1cf12374361859242a562e1933a7930649131a", + "rev": "77265d2dc1e61b2abfd3b1d6609dbb66fe75e0a5", "type": "github" }, "original": { @@ -198,15 +273,15 @@ "solc": { "inputs": { "flake-utils": "flake-utils_4", - "nixpkgs": "nixpkgs_4", + "nixpkgs": "nixpkgs_5", "solc-macos-amd64-list-json": "solc-macos-amd64-list-json" }, "locked": { - "lastModified": 1742758229, - "narHash": "sha256-FrU9rhab/0vOjjeFoQF+Ej43zRLv3enUIYjgLrH3Gd8=", + "lastModified": 1777817996, + "narHash": "sha256-iI71iUhD7THLibl3w1JcQEhHmTwZMxChi70RTe33BAo=", "owner": "hellwolf", "repo": "solc.nix", - "rev": "6885b61bac89da19a6e3c70b89fdd592e2cef884", + "rev": "e3cf898cb804d5c0e5474b378a300fe8942e67d6", "type": "github" }, "original": { @@ -218,13 +293,13 @@ "solc-macos-amd64-list-json": { "flake": false, "locked": { - "narHash": "sha256-U5ckttxwKO13gIKggel6iybG5oTDbSidPR5nH3Gs+kY=", + "narHash": "sha256-zzwwHA2qPotv7yp8mK7+y9BZhm7ytuFeCJVvKBBdBn4=", "type": "file", - "url": "https://github.com/ethereum/solc-bin/raw/30a3695/macosx-amd64/list.json" + "url": "https://github.com/argotorg/solc-bin/raw/902dfaf/macosx-amd64/list.json" }, "original": { "type": "file", - "url": "https://github.com/ethereum/solc-bin/raw/30a3695/macosx-amd64/list.json" + "url": "https://github.com/argotorg/solc-bin/raw/902dfaf/macosx-amd64/list.json" } }, "systems": { diff --git a/flake.nix b/flake.nix index 92f7c3a..85f649f 100644 --- a/flake.nix +++ b/flake.nix @@ -2,13 +2,18 @@ description = "Flake for development workflows."; inputs = { - rainix.url = "github:rainprotocol/rainix"; + rainix.url = "github:rainlanguage/rainix"; flake-utils.url = "github:numtide/flake-utils"; }; - outputs = { self, flake-utils, rainix }: + outputs = + { + flake-utils, + rainix, + ... + }: flake-utils.lib.eachDefaultSystem (system: { packages = rainix.packages.${system}; - devShells = rainix.devShells.${system}; + devShells.default = rainix.devShells.${system}.rust-shell; }); } From 80808502e11930384848385d95132ec6a085da82 Mon Sep 17 00:00:00 2001 From: David Meister Date: Sat, 23 May 2026 07:20:27 +0000 Subject: [PATCH 2/7] chore: untrack .pre-commit-config.yaml symlink It auto-resolves to a /nix/store path which is host-specific. Should not be in git. Co-Authored-By: Claude Opus 4.7 --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index e2b2849..74bec3b 100644 --- a/.gitignore +++ b/.gitignore @@ -16,4 +16,4 @@ target # foundry cache -out \ No newline at end of file +out.pre-commit-config.yaml From bbc0005a57ff0408f3d14114f456345e8972668d Mon Sep 17 00:00:00 2001 From: David Meister Date: Sat, 23 May 2026 07:21:15 +0000 Subject: [PATCH 3/7] chore: actually untrack .pre-commit-config.yaml Co-Authored-By: Claude Opus 4.7 --- .pre-commit-config.yaml | 1 - 1 file changed, 1 deletion(-) delete mode 120000 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml deleted file mode 120000 index fc74104..0000000 --- a/.pre-commit-config.yaml +++ /dev/null @@ -1 +0,0 @@ -/nix/store/lm6f18alhwp2crdaimsvr09bg58pndfc-pre-commit-config.json \ No newline at end of file From 903463108b641110deac49a1f8f1bda88a613706 Mon Sep 17 00:00:00 2001 From: David Meister Date: Sat, 23 May 2026 07:26:26 +0000 Subject: [PATCH 4/7] ci: retrigger From 298663292eebe46b3d710062a46b5aac2a1cbf5f Mon Sep 17 00:00:00 2001 From: David Meister Date: Sat, 23 May 2026 07:30:45 +0000 Subject: [PATCH 5/7] fix(wasm): gate tokio dev-dep + tests behind non-wasm cfg The upstream rainix-rs-wasm-test workflow runs cargo test --target wasm32-unknown-unknown --workspace, which compiles dev-deps. tokio with features=full pulls in mio whose I/O bits do not compile on wasm. Move tokio to a non-wasm dev-dep target and gate the erc165 tests module so it only compiles on non-wasm test builds (the tests use tokio::test and a non-mock alloy provider that would not work in a wasm test runner anyway). Co-Authored-By: Claude Opus 4.7 --- .pre-commit-config.yaml | 1 + Cargo.toml | 4 +++- src/erc165/mod.rs | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) create mode 120000 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 120000 index 0000000..fc74104 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1 @@ +/nix/store/lm6f18alhwp2crdaimsvr09bg58pndfc-pre-commit-config.json \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index 72454b9..5d3ab75 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,9 +29,11 @@ getrandom_03 = { package = "getrandom", version = "0.3", features = [ [dev-dependencies] serde = "1.0.203" -tokio = { version = "1.28.0", features = ["full"] } serde_json = { version = "1.0.117", features = ["raw_value"] } +[target.'cfg(not(target_family = "wasm"))'.dev-dependencies] +tokio = { version = "1.28.0", features = ["full"] } + [lib] path = "src/lib.rs" diff --git a/src/erc165/mod.rs b/src/erc165/mod.rs index f424c65..dd1d0a9 100644 --- a/src/erc165/mod.rs +++ b/src/erc165/mod.rs @@ -138,7 +138,7 @@ pub async fn supports_erc165( supports_erc165_check2(provider, contract_address).await } -#[cfg(test)] +#[cfg(all(test, not(target_family = "wasm")))] mod tests { use super::XorSelectors; use super::*; From 589cd00e7318ffe480ec06b8efb2e72b7a01810b Mon Sep 17 00:00:00 2001 From: David Meister Date: Sat, 23 May 2026 07:31:30 +0000 Subject: [PATCH 6/7] fix(wasm): slim tokio dev-dep to rt+macros so it compiles on wasm The previous tokio[full] dev-dep dragged in mio which fails on wasm32- unknown-unknown. The tests only need #[tokio::test] for async test runtime; macros + rt are sufficient and compile cleanly on wasm. Reverts the prior cfg-gating, which was overkill for the actual need. Co-Authored-By: Claude Opus 4.7 --- Cargo.toml | 4 +--- src/erc165/mod.rs | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5d3ab75..837fc10 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,9 +30,7 @@ getrandom_03 = { package = "getrandom", version = "0.3", features = [ [dev-dependencies] serde = "1.0.203" serde_json = { version = "1.0.117", features = ["raw_value"] } - -[target.'cfg(not(target_family = "wasm"))'.dev-dependencies] -tokio = { version = "1.28.0", features = ["full"] } +tokio = { version = "1.28.0", features = ["macros", "rt"] } [lib] path = "src/lib.rs" diff --git a/src/erc165/mod.rs b/src/erc165/mod.rs index dd1d0a9..f424c65 100644 --- a/src/erc165/mod.rs +++ b/src/erc165/mod.rs @@ -138,7 +138,7 @@ pub async fn supports_erc165( supports_erc165_check2(provider, contract_address).await } -#[cfg(all(test, not(target_family = "wasm")))] +#[cfg(test)] mod tests { use super::XorSelectors; use super::*; From cd76ae9a4afc498480652a60c7a08387589c9129 Mon Sep 17 00:00:00 2001 From: David Meister Date: Sat, 23 May 2026 07:34:40 +0000 Subject: [PATCH 7/7] ci: retrigger