Add Nix dev shell with pinned test binaries#34
Merged
Conversation
Introduce a reproducible development environment so the project builds and tests the same way on any machine. The flake provides the pinned Rust toolchain, nightly rustfmt, and the bitcoind/electrs binaries the integration tests need; .envrc loads it via direnv and the justfile wraps the common check/fmt/test commands to mirror CI's gates. bitcoind is pinned to 27.1 from an older nixpkgs rev because the tests' bundled corepc-node only decodes the 27.x getblockchaininfo RPC schema; the current 25.11 channel ships 30.0 and fails decoding. For electrs we package the exact prebuilt esplora binary CI downloads and patch it for NixOS rather than using nixpkgs' blockstream-electrs. The nixpkgs build is much newer and its initial regtest indexing takes around 80 seconds, which overruns the tests' chain sync timeout and makes every integration test fail locally. Building that old revision from source under the current toolchain is fragile, so reusing the same binary CI runs is the cheapest way to match its behaviour. The prebuilt only exists for x86_64 linux and macOS, the two platforms the download script supports.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce a reproducible development environment so the project builds and tests the same way on any machine. The flake provides the pinned Rust toolchain, nightly rustfmt, and the bitcoind/electrs binaries the integration tests need; .envrc loads it via direnv and the justfile wraps the common check/fmt/test commands to mirror CI's gates.
bitcoind is pinned to 27.1 from an older nixpkgs rev because the tests' bundled corepc-node only decodes the 27.x getblockchaininfo RPC schema; the current 25.11 channel ships 30.0 and fails decoding.
For electrs we package the exact prebuilt esplora binary CI downloads and patch it for NixOS rather than using nixpkgs' blockstream-electrs. The nixpkgs build is much newer and its initial regtest indexing takes around 80 seconds, which overruns the tests' chain sync timeout and makes every integration test fail locally. Building that old revision from source under the current toolchain is fragile, so reusing the same binary CI runs is the cheapest way to match its behaviour. The prebuilt only exists for x86_64 linux and macOS, the two platforms the download script supports.