feat(runner): give .bin binaries priority and skip their builds - #3590
Merged
Conversation
Binaries placed in the repo's .bin directory were always shadowed by the nix-built ones, because the built bin dirs were prepended in front of .bin in PATH_PREPEND. Reverse the order so that .bin always wins, and skip the (nix) build of any binary for which a usable executable is already present in .bin. - Append built bin dirs after .bin in PATH_PREPEND instead of prepending, and move the db-sync setup after the node/cli setup so its bin dirs also come after theirs. - Add is_usable_binary and report_existing_binary helpers. The latter logs the binary's version (best effort) and hard-fails binaries that cannot run at all (wrong arch, missing libs, crash on startup), since they would still shadow working ones on PATH. - Skip builds per binary: node bundle (via new skip_bindir args), standalone cardano-cli, tx-centrifuge, cardano-db-sync and cardano-smash-server. The db-sync repo is still cloned for the schema files and the release tarball is still downloaded. - Categorize .bin entries early and fail fast on executable but unusable entries (e.g. empty files) that would shadow built binaries as silent no-ops. - Re-verify all required binaries on the final PATH before the testrun and exit 3 (distinct from pytest's 1) when any is missing or unusable. Create the artifacts dirs upfront so this exit code is not masked by grep_errors.sh. - Document the .bin behavior in the README.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the runner scripts to ensure user-provided executables in the repo’s .bin directory take precedence over nix-built binaries, and to skip building binaries when a usable one is already present in .bin. It also adds helper functions to validate/report existing binaries and documents the .bin behavior.
Changes:
- Add
is_usable_binary,report_existing_binary, andassert_cmds_availablehelpers to support.binprioritization and validation. - Update
runner/regression.sh(and supporting scripts) to (a) prefer.binon PATH, (b) skip nix builds when.binprovides a usable binary, and (c) re-check required commands before running tests. - Update db-sync and cardano-node setup scripts to support build skipping and adjust PATH ordering; document
.binbehavior inREADME.md.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| scripts/common.sh | Adds helpers for determining “usable” executables, reporting existing binaries, and asserting required commands exist. |
| runner/source_dbsync.sh | Allows skipping db-sync/smash builds when .bin provides usable binaries; adjusts PATH handling and adds helper dependency check. |
| runner/source_cardano_node.sh | Adds optional skip_bindir to skip builds and omit PATH entries for binaries already present in .bin. |
| runner/regression.sh | Reorders PATH so .bin wins, categorizes .bin entries early, skips builds when possible, and re-verifies required commands before testrun. |
| README.md | Documents .bin usage and container constraints for custom binaries. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Binaries placed in the repo's .bin directory were always shadowed by the nix-built ones, because the built bin dirs were prepended in front of .bin in PATH_PREPEND. Reverse the order so that .bin always wins, and skip the (nix) build of any binary for which a usable executable is already present in .bin.