Skip to content

Stop the refresh when a step inside a command substitution fails - #213

Merged
estebanzimanyi merged 1 commit into
MobilityDB:masterfrom
estebanzimanyi:tools/refresh-stops-on-failed-fetch
Oct 26, 2026
Merged

estebanzimanyi merged 1 commit into
MobilityDB:masterfrom
estebanzimanyi:tools/refresh-stops-on-failed-fetch

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

refresh-binding.sh, provision-meos.sh and ecosystem-generate.sh run each command substitution with errexit (shopt -s inherit_errexit), so a step that fails inside one stops the script as it does outside one. resolve_repo, which refresh-binding.sh calls inside a substitution, stops at a fetch of a ref the remote does not have instead of checking out the commit fetched before it and answering its path. Every substitution whose failure the scripts expect keeps its own fallback (|| echo unknown), and missing_python_reqs answers the missing requirements with status 0.

Witness: on master, refresh-binding.sh --jmeos-ref 88e7ef03 over a work dir whose JMEOS clone holds main prints fatal: couldn't find remote ref 88e7ef03, then builds the JMEOS jar from main and runs the binding's suite to chain rc=0, as if it had derived from the ref asked for. With this change the same refresh stops there with status 128 and builds no jar. bash -c 'set -euo pipefail; f(){ false; echo path; }; v="$(f)"; echo continued' prints continued; with inherit_errexit it exits 1.

refresh-binding.sh, provision-meos.sh and ecosystem-generate.sh run each command substitution with errexit (shopt -s inherit_errexit), so a step that fails inside one stops the script as it does outside one. resolve_repo, which refresh-binding.sh calls inside a substitution, stops at a fetch of a ref the remote does not have instead of checking out the commit fetched before it and answering its path. Every substitution whose failure the scripts expect keeps its own fallback (`|| echo unknown`), and missing_python_reqs answers the missing requirements with status 0.

Witness: on master, `refresh-binding.sh --jmeos-ref 88e7ef03` over a work dir whose JMEOS clone holds main prints `fatal: couldn't find remote ref 88e7ef03`, then builds the JMEOS jar from main and runs the binding's suite to `chain rc=0`, as if it had derived from the ref asked for. With this change the same refresh stops there with status 128 and builds no jar. bash -c 'set -euo pipefail; f(){ false; echo path; }; v="$(f)"; echo continued' prints `continued`; with inherit_errexit it exits 1.
@estebanzimanyi
estebanzimanyi merged commit a011fee into MobilityDB:master Oct 26, 2026
2 checks passed
@estebanzimanyi
estebanzimanyi deleted the tools/refresh-stops-on-failed-fetch branch October 26, 2026 18:21
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