Fix non-portable find -iname in verify-release-candidate.sh#1613
Open
viirya wants to merge 1 commit into
Open
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.shruns:findis invoked without a starting path. GNU find (Linux) tolerates this and treats the current directory as the start, but BSD find (macOS) rejects it:When that happens,
findprints the usage error and produces no output, so the pipedxargs grep SNAPSHOTreceives nothing and exits non-zero. Theif (...)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: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.