Skip to content

fix(release): warn when bash 3.2 will not report the failed step - #3194

Merged
blackmwk merged 3 commits into
apache:mainfrom
kevinjqliu:kevinjqliu/fix-release-license-check-err-trap
Sep 15, 2026
Merged

blackmwk merged 3 commits into
apache:mainfrom
kevinjqliu:kevinjqliu/fix-release-license-check-err-trap

Conversation

@kevinjqliu

@kevinjqliu kevinjqliu commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

N/A

What changes are included in this PR?

A small nit PR.

Hit this running create_rc.sh on macOS. The release scripts run each step in a ( trap - ERR; ... ) subshell. bash 3.2 (macOS default) does not run the parent's ERR trap for a failing subshell, so the script still exits on failure but does not report which step failed. bash 4.0+ does, verified against 3.2 through 5.1.

Since the script still fails correctly, print a warning at startup on bash older than 4 in the four scripts that install the trap.

Are these changes tested?

Under /bin/bash 3.2 each script prints the warning and continues; a forced failure exits with the tool's status and the warning explains why no step is reported. Under bash 5 there is no warning and the failed step is reported.

AI Disclosure

Written with Claude Code, reviewed by me.

Copilot AI lite review requested due to automatic review settings September 10, 2026 16:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No unresolved review issues remain.

Pull request overview

Fixes dependency-license failure reporting on macOS Bash 3.2.

Changes:

  • Runs cargo deny with an explicit manifest path.
  • Removes the problematic subshell and ERR trap override.
File summaries
File Description
dev/release/create_rc.sh Fixes dependency-license check error reporting.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@kevinjqliu
kevinjqliu marked this pull request as draft September 10, 2026 16:32
@kevinjqliu kevinjqliu changed the title fix(release): report license check failure on macOS bash 3.2 fix(release): report step failures on macOS bash 3.2 Sep 10, 2026
@kevinjqliu
kevinjqliu force-pushed the kevinjqliu/fix-release-license-check-err-trap branch from 06ca798 to 751572b Compare September 10, 2026 17:38
@kevinjqliu kevinjqliu changed the title fix(release): report step failures on macOS bash 3.2 fix(release): require bash 4+ for the release helper scripts Sep 10, 2026
@kevinjqliu
kevinjqliu force-pushed the kevinjqliu/fix-release-license-check-err-trap branch 3 times, most recently from 5b41cec to 5fa5623 Compare September 10, 2026 17:43
@kevinjqliu kevinjqliu changed the title fix(release): require bash 4+ for the release helper scripts fix(release): require bash 4+ in the release scripts Sep 10, 2026
@kevinjqliu
kevinjqliu force-pushed the kevinjqliu/fix-release-license-check-err-trap branch from 5fa5623 to fb9f009 Compare September 10, 2026 17:49
@kevinjqliu kevinjqliu changed the title fix(release): require bash 4+ in the release scripts fix(release): warn when bash 3.2 will not print the failed step Sep 10, 2026
@kevinjqliu
kevinjqliu force-pushed the kevinjqliu/fix-release-license-check-err-trap branch from fb9f009 to f24a54c Compare September 10, 2026 17:51
@kevinjqliu kevinjqliu changed the title fix(release): warn when bash 3.2 will not print the failed step fix(release): warn when bash 3.2 will not report the failed step Sep 10, 2026
The release scripts run each step in a `( trap - ERR; ... )` subshell so a
failure is reported exactly once. bash 3.2 (macOS /bin/bash) does not run
the parent's ERR trap for a failing subshell, so the script still exits on
failure but does not report which step failed. bash 4.0 and later do;
verified against 3.2 through 5.1.

Print a warning at startup on bash older than 4 in the four scripts that
install the trap.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@kevinjqliu
kevinjqliu force-pushed the kevinjqliu/fix-release-license-check-err-trap branch from f24a54c to 504e755 Compare September 10, 2026 17:51
@kevinjqliu
kevinjqliu requested review from CTTY and blackmwk September 10, 2026 17:52
@kevinjqliu

Copy link
Copy Markdown
Contributor Author

cc @dannycjones wdyt?

@kevinjqliu
kevinjqliu marked this pull request as ready for review September 10, 2026 17:53
Comment thread dev/release/create_rc.sh

# bash 3.2 (macOS default) does not run the ERR trap for a failing subshell:
# the script still exits on failure but does not report which step failed.
if [ "${BASH_VERSINFO[0]}" -lt 4 ]; then

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.

Should we consider fail directly if bash is too old?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I consider that, I think it might be too aggressive.

The script still fails with error code in bash 3.2, so its functionally correct, it just doesnt show the error message

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.

Given its the macOS default, I'm content just allowing it with this warning.

My first step on a new Mac is to just install Bash from Homebrew though :)

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.

Sounds reasonable to me.

@dannycjones dannycjones 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.

lgtm.

if we really wanted, we could catch on_exit but it's necessary, warning is enough IMO.

thanks for adding this warning! i appreciate making these scripts easier to debug when they go wrong

@laskoviymishka laskoviymishka 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.

:shipit:

@blackmwk
blackmwk added this pull request to the merge queue Sep 15, 2026
Merged via the queue into apache:main with commit 5c3d18f Sep 15, 2026
23 checks passed
dannycjones added a commit to dannycjones/iceberg-rust that referenced this pull request Sep 15, 2026
Brings the 0.11.0 release metadata back to `main`. Only `CHANGELOG.md`,
`Cargo.toml`, and `Cargo.lock` change; everything else on `0.11.x` is
either already on `main` or was deliberately superseded there.

`CHANGELOG.md` and `Cargo.toml` are three-way merged, not copied from the
release branch. `main` has moved its dependencies on since the 0.11.x cut
(arrow 58.4 -> 59.2, DataFusion 54 -> 55, pyo3 0.28 -> 0.29, and
datafusion-ffi dropped in apache#3149), and a merge keeps those while taking
the release branch's version bumps. The result is
`workspace.package.version` 0.10.1 -> 0.11.0, the nine workspace path
dependencies 0.10.0 -> 0.11.0, and the `## [v0.11.0]` changelog section.
No third-party dependency version changes.

`Cargo.lock` is regenerated from `main`'s lock with
`cargo update --workspace`, not merged. Only the 17 workspace-member
versions change.

All other paths are resolved to `main`, including the two that conflict:
`dev/hms/Dockerfile` (`main` is on the Hive 4.2.1 image) and
`.gitattributes` (apache#3193). `dev/release/` and `deny.toml` also differ,
because `main` is ahead (apache#3194) or removed things on purpose (apache#3200,
apache#3149). Fixes land on `main` first and are backported, so nothing needs
to travel in this direction.

`DEPENDENCIES.rust.tsv` is not merged. Those files are generated during
release prep on the release branch and describe the released dependency
graph, which is older than `main`'s, so carrying them across would
replace stale data with data that is wrong for `main`. Per apache#2706
generating them is a release-manager task and is not enforced by CI, so
`main`'s copies are refreshed at the next release, on the next release
branch. apache#3074 excluded them likewise.
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.

5 participants