Skip to content

Set -x flag for release script to show commands being run - #2639

Merged
eregon merged 1 commit into
rbenv:masterfrom
eregon:release-script-set-x-flag
Sep 15, 2026
Merged

eregon merged 1 commit into
rbenv:masterfrom
eregon:release-script-set-x-flag

Conversation

@eregon

@eregon eregon commented Sep 15, 2026

Copy link
Copy Markdown
Member
  • This makes it much easier to rerun a command if it failed and to know where the script stopped.

* This makes it much easier to rerun a command if it failed
  and to know where the script stopped.

@mislav mislav left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good idea! I never needed this since I made the script and I would know by heart which part of it failed based on the output, but I can imagine this would be useful to everyone else.

Comment thread script/release
# - [automated] a GitHub Action will create a Homebrew PR for the new release

set -e
set -ex

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thoughts on using something like:

[ -n "${DEBUG-}" ] && set -x

So that the extra debug/tracing output is opt-in rather than always on?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Is there a use case for wanting to not see the extra output?
I think the extra output doesn't matter if it works, but it's important to be there if it fails.
Having it only after setting DEBUG is too late.

@eregon

eregon commented Sep 15, 2026

Copy link
Copy Markdown
Member Author

What failed in my case is the gh release create ... line (because I only give read-only access to gh by default).
I had to rerun and manually copy/paste the values for the arguments, workable but would be so much easier if it just printed the full command, which it does with this change.

It actually happened multiple times to me already. There used to be an early gh something check to ensure everything works, but anyway I think this simple change is good enough.

@eregon
eregon merged commit 59b1392 into rbenv:master Sep 15, 2026
4 checks passed
social4hyq pushed a commit to social4hyq/homebrew-core that referenced this pull request Sep 20, 2026
ruby-build 20260916

Created-by: HarmonybrewBot
Commit-by: HarmonybrewBot
Merged-by: HarmonybrewBot
Description: Created by `brew bump`

---

Created with `brew bump-formula-pr`.<details>
  <summary>release notes</summary>
  <pre>## What's Changed
* Set -x flag for release script to show commands being run by @eregon in rbenv/ruby-build#2639
* Hide dup3() and pipe2() from configure on macOS older than 27 by @hsbt in rbenv/ruby-build#2641


**Full Changelog**: https://github.com/rbenv/ruby-build/compare/v20260915...v20260916</pre>
  <p>View the full release notes at <a href="https://github.com/rbenv/ruby-build/releases/tag/v20260916">https://github.com/rbenv/ruby-build/releases/tag/v20260916</a>.</p>
</details>
<hr>

See merge request: Harmonybrew/homebrew-core!20421
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.

3 participants