Skip to content

feat(runner): give .bin binaries priority and skip their builds - #3590

Merged
mkoura merged 1 commit into
masterfrom
bin_dir_priority
Aug 6, 2026
Merged

feat(runner): give .bin binaries priority and skip their builds#3590
mkoura merged 1 commit into
masterfrom
bin_dir_priority

Conversation

@mkoura

@mkoura mkoura commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

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.

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.
@mkoura
mkoura requested a review from saratomaz as a code owner August 6, 2026 09:14
@mkoura
mkoura requested a lite review from Copilot and removed request for saratomaz August 6, 2026 09:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, and assert_cmds_available helpers to support .bin prioritization and validation.
  • Update runner/regression.sh (and supporting scripts) to (a) prefer .bin on PATH, (b) skip nix builds when .bin provides 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 .bin behavior in README.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.

Comment thread scripts/common.sh
@mkoura
mkoura merged commit 4937356 into master Aug 6, 2026
2 checks passed
@mkoura
mkoura deleted the bin_dir_priority branch August 6, 2026 09:23
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.

2 participants