Skip to content

Fix non-portable find -iname in verify-release-candidate.sh#1613

Merged
kosiew merged 1 commit into
apache:mainfrom
viirya:fix-find-iname-portability
Jun 29, 2026
Merged

Fix non-portable find -iname in verify-release-candidate.sh#1613
kosiew merged 1 commit into
apache:mainfrom
viirya:fix-find-iname-portability

Conversation

@viirya

@viirya viirya commented Jun 27, 2026

Copy link
Copy Markdown
Member

Which issue does this PR close?

No separate issue filed; this is a small portability fix to the release verification script.

Rationale for this change

The SNAPSHOT-version guard in verify-release-candidate.sh runs:

if ( find -iname 'Cargo.toml' | xargs grep SNAPSHOT ); then

find is invoked without a starting path. GNU find (Linux) tolerates this and treats the current directory as the start, but BSD find (macOS) rejects it:

find: illegal option -- i

When that happens, find prints the usage error and produces no output, so the piped xargs grep SNAPSHOT receives nothing and exits non-zero. The if (...) therefore evaluates false and the script continues — meaning the SNAPSHOT check is silently skipped on macOS rather than actually running. A release verifier on macOS would get a passing run without this safety check ever executing.

This surfaced while verifying the 54.0.0 RC on macOS.

What changes are included in this PR?

Add an explicit . starting path:

if ( find . -iname 'Cargo.toml' | xargs grep SNAPSHOT ); then

This is accepted by both GNU and BSD find, so the SNAPSHOT check runs correctly on Linux and macOS.

Are there any user-facing changes?

No. This only affects the release-candidate verification script used by maintainers.

This pull request and its description were written by Isaac.

The SNAPSHOT check used `find -iname 'Cargo.toml'` without a starting
path. GNU find tolerates this, but BSD find (macOS) rejects it with
`find: illegal option -- i`. The error makes the piped `xargs grep`
receive no input and return non-zero, so the `if` silently evaluates
false and the SNAPSHOT check is skipped on macOS rather than running.

Add the explicit `.` starting path so the check works on both GNU and
BSD find.

Co-authored-by: Isaac
@viirya viirya requested review from alamb and andygrove June 28, 2026 06:45

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

Looks 👍 to me

@viirya

viirya commented Jun 29, 2026

Copy link
Copy Markdown
Member Author

Thanks @kosiew

@kosiew kosiew merged commit 5118a8b into apache:main Jun 29, 2026
26 checks passed
@viirya viirya deleted the fix-find-iname-portability branch June 29, 2026 06:15
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