Skip to content

Add Nix dev shell with pinned test binaries#34

Merged
amackillop merged 1 commit into
lsp-0.7.0from
austin_add-flake
Jun 9, 2026
Merged

Add Nix dev shell with pinned test binaries#34
amackillop merged 1 commit into
lsp-0.7.0from
austin_add-flake

Conversation

@amackillop

Copy link
Copy Markdown

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.

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.
@amackillop amackillop requested a review from martinsaposnic June 5, 2026 18:12
@amackillop amackillop merged commit 1ba91ab into lsp-0.7.0 Jun 9, 2026
4 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant