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

Using Visual Studio BuildTools as a MinGW alternative #23212

Merged
merged 1 commit into from
Jul 11, 2024

Conversation

l0rd
Copy link
Member

@l0rd l0rd commented Jul 6, 2024

Building the MSI hook on Windows currently requires MinGW CC. This commit updates the build script (build-hooks.bat is now build-hooks.ps1) so that, when MinGW is absent but the C compiler included in Visual Studio BuildTools is installed, the latter is used to build the MSI hook.

Documentation in build_windows.md has been updated with the instructions to install VS BuildTools (not MSYS2/MinGW).

Another change included in the PR is the installertest target in windows Makefile (winmake.ps1) to run the Windows installer tests that are part of Cirrus CI.

Does this PR introduce a user-facing change?

None

Copy link

We were not able to find or create Copr project packit/containers-podman-23212 specified in the config with the following error:

Cannot create a new Copr project (owner=packit project=containers-podman-23212 chroots=['centos-stream-10-aarch64', 'centos-stream-9-x86_64', 'centos-stream-10-x86_64', 'centos-stream-9-aarch64']): Response is not in JSON format, there is probably a bug in the API code.

Please check your configuration for:

  1. typos in owner and project name (groups need to be prefixed with @)
  2. whether the project name doesn't contain not allowed characters (only letters, digits, underscores, dashes and dots must be used)
  3. whether the project itself exists (Packit creates projects only in its own namespace)
  4. whether Packit is allowed to build in your Copr project
  5. whether your Copr project/group is not private

@l0rd l0rd requested review from n1hility and lsm5 July 6, 2024 09:21
@lsm5
Copy link
Member

lsm5 commented Jul 8, 2024

/packit build-failed

Comment on lines 25 to 27
$wslCheckboxVar = $($installWSL ? "1" : "0")
$hypervCheckboxVar = $($installHyperV ? "1" : "0")
$allowOldWinVar = $($skipWinVersionCheck ? "1" : "0")
Copy link
Member

Choose a reason for hiding this comment

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

@l0rd these 3 lines seem to be failing tests.

Copy link
Member Author

Choose a reason for hiding this comment

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

@lsm5 thank you. I suspect that's related to the version of PowerShell that's used by CI (< v7.0) that doesn't support the ternary operator syntax I am going to put this PR back in draft mode until I fix it.

Copy link
Member

Choose a reason for hiding this comment

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

are you planning to update the cirrus windows image with latest powershell? Looks like github actions windows env does have required min-version of powershell

Copy link
Member Author

Choose a reason for hiding this comment

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

This is an option, yes. But no, I think it's simpler to update the PowerShell script introduced with this PR to support old and new versions of PWSH. So that it has a wider compatibility of windows dev environments.

@l0rd l0rd marked this pull request as draft July 8, 2024 13:11
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 8, 2024
Building the MSI hook on Windows
(`contrib/win-installer/podman-msihooks/check.c`)
currently requires MinGW. This commit updates the build
script so that, when MinGW is absent but the C compiler
included in Visual Studio BuildTools is installed, the
latter is used to build the MSI hook.

Other than that, `winmake.ps1` has a new `installertest`
target to run the Windows installer tests that are
currently verified by Cirrus CI.

Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
@l0rd l0rd marked this pull request as ready for review July 8, 2024 18:18
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 8, 2024
@l0rd
Copy link
Member Author

l0rd commented Jul 8, 2024

Tests are passing. Re-opening for review. @containers/podman-maintainers PTAL.

@mheon
Copy link
Member

mheon commented Jul 9, 2024

LGTM, though my unfamiliarity with Powershell makes me less able to find issues than normal

Copy link
Member

@lsm5 lsm5 left a comment

Choose a reason for hiding this comment

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

I removed mingw tools from my windows env and installed the VSSetup extension as mentioned in the PR. Was able to build the installer just fine.

I won't be able to review the powershell details, but I can say it works for me :) . Setting a hold in case anyone else has the time/expertise to review it.

@n1hility PTAL

/lgtm
/approve
/hold

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 10, 2024
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 10, 2024
Copy link
Contributor

openshift-ci bot commented Jul 10, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: l0rd, lsm5

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 10, 2024
@baude
Copy link
Member

baude commented Jul 11, 2024

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 11, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit e570aac into containers:main Jul 11, 2024
90 checks passed
@stale-locking-app stale-locking-app bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Oct 10, 2024
@stale-locking-app stale-locking-app bot locked as resolved and limited conversation to collaborators Oct 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. release-note-none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants