Skip to content
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

Note that PHP 7.4 and earlier requires windows-2019 #1

Merged
merged 3 commits into from
Jul 13, 2024

Conversation

jmikola
Copy link
Member

@jmikola jmikola commented May 22, 2024

GitHub recently removed vc15 from the windows-2022 image (see: actions/runner-images#9701).

The linked thread does discuss "Mitigation ways" to manually install missing toolsets, but I've yet to verify that. We recently encountered this in mongodb/mongo-php-driver#1555 (comment) and I'm in the process of fixing the ext-mongodb builds (tracked in PHPC-2388). I anticipate manual installation will be necessary in our case, since other parts of our release process will rely on windows-2022; however, that seems beyond the scope of this action's README.

README.md Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated
)
[string]$workloadArgs = $componentsToRemove | ForEach-Object {" --remove " + $_}
$Arguments = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"",$workloadArgs, '--quiet', '--norestart', '--nocache')
# should be run twice
Copy link
Member

Choose a reason for hiding this comment

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

Care to clarify why it needs to run twice? :-)

Copy link
Member Author

Choose a reason for hiding this comment

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

You'd have to ask the OP in actions/runner-images#9701.

While experimenting with a solution on PHPC, I did get a successful build with removing the duplicate Start-Process line as well as the first step that removes the component; however, I wasn't confident enough about those changes to rule out possible side effects.

That said, it's probably worth trying and if we run into any trouble I suppose we can always revise this after the fact. Opened mongodb/mongo-php-driver#1567 with some refactoring, and if that still passes I'll come back and refactor this PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

mongodb/mongo-php-driver#1567 looks good, so I've updated this PR to use a single, consolidated step.

$installPath = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise"
$component = "Microsoft.VisualStudio.Component.VC.v141.x86.x64"
$args = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$installPath`"", '--add', $component, '--quiet', '--norestart', '--nocache')
$process = Start-Process -FilePath cmd.exe -ArgumentList $args -Wait -PassThru -WindowStyle Hidden
Copy link
Member Author

Choose a reason for hiding this comment

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

Note: capturing the return value of Start-Process in a variable seems to suppress display of an ASCII table (for the process execution stats) in the workflow output. Therefore, I've left this in place.

@nikic nikic merged commit 4dda4d8 into php:main Jul 13, 2024
@jmikola jmikola deleted the patch-1 branch July 18, 2024 12:29
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.

4 participants