Skip to content

Fix no-argument ./build.sh invocation #116315

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 4, 2025
Merged

Conversation

jkoritzinsky
Copy link
Member

Fixes issue reported in #116145 (comment)

@Copilot Copilot AI review requested due to automatic review settings June 4, 2025 17:52
@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jun 4, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR ensures that running ./build.sh without any arguments no longer fails by initializing the arguments array with an empty element.

  • Changed default arguments initialization to include an empty string.
  • Preserves existing behavior of passing flags via the arguments array.
Comments suppressed due to low confidence (1)

eng/build.sh:156

  • Using an empty string in the arguments array can lead to a spurious empty-argument being passed downstream. Consider explicitly detecting when no arguments are provided and handling that case, rather than injecting an empty element into the array.
arguments=("")

@jkoritzinsky jkoritzinsky added area-Infrastructure and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Jun 4, 2025
Copy link
Contributor

Tagging subscribers to this area: @dotnet/runtime-infrastructure
See info in area-owners.md if you want to be subscribed.

@akoeplinger
Copy link
Member

/ba-g fast merge as this is apparently not covered by CI otherwise we'd have seen it in #116145 and I verified it works locally.

@akoeplinger akoeplinger merged commit d4b08f9 into main Jun 4, 2025
48 of 129 checks passed
@akoeplinger akoeplinger deleted the jkoritzinsky-patch-1 branch June 4, 2025 18:21
@akoeplinger
Copy link
Member

@omajid do we need to make similar changes for the other cases like this you added in dotnet/dotnet#677 and dotnet/dotnet#797 ?

@omajid
Copy link
Member

omajid commented Jun 4, 2025

@jkoritzinsky I think this fix is not quite right. This adds a single empty argument. That might break something.

@akoeplinger I thought I had fixed it via https://github.com/dotnet/dotnet/pull/797/files#diff-56c552fdb744de6c93ad3afef9db9a34839f7b4b0e0d3f653b41310dd62776a3. Is there something I need to do to help the fix flow in here?

@omajid
Copy link
Member

omajid commented Jun 4, 2025

Ah, I see. I think we need to guard this as well:

for argument in "${arguments[@]}"; do

@akoeplinger
Copy link
Member

@omajid it was actually complaining about

arguments=("-restore" "-build" "${arguments[@]}")

@akoeplinger
Copy link
Member

The for loop on L590 seems to work fine as is from what I can see

akoeplinger added a commit to akoeplinger/runtime that referenced this pull request Jun 4, 2025
@omajid
Copy link
Member

omajid commented Jun 4, 2025

Thanks for finding and fixing it!

akoeplinger added a commit that referenced this pull request Jun 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants