Skip to content

utils: cleanup Invoke-Program in build.ps1. #79855

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
Mar 8, 2025

Conversation

jeffdav
Copy link
Contributor

@jeffdav jeffdav commented Mar 7, 2025

In preparation for more changes in this function.

  • Rename $Args since it conflicts with a built-in automatic variable of the same name.
  • Add -Silent which will redirect all output at the invocation point (rather than callers using *> when calling Invoke-Program.
  • Cleanup some of the ToBatch logic. Ideally we'd cleanup the actual call in a similar way, but as soon as we use Invoke-Expression instead of & escaping/quoting of args starts to break.

[string] $OutFile = "",
[string] $ErrorFile = "",
[Parameter(Position = 1, ValueFromRemainingArguments)]
[string[]] $Args
[string[]] $ExecutableArgs
Copy link
Member

Choose a reason for hiding this comment

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

Great catch!

[Parameter(Position = 0, Mandatory = $true)]
[string] $Executable,
[switch] $OutNull = $false,
[switch] $Silent,
[switch] $OutNull,
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, shouldn't this be the same as -Silent.

@compnerd
Copy link
Member

compnerd commented Mar 8, 2025

@swift-ci please test

@compnerd compnerd enabled auto-merge March 8, 2025 07:01
@compnerd
Copy link
Member

compnerd commented Mar 8, 2025

@swift-ci please test Windows platform

@compnerd compnerd merged commit 03f9632 into swiftlang:main Mar 8, 2025
5 checks passed
@jeffdav jeffdav deleted the win-build-invoke-program branch March 17, 2025 16:59
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