-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
[cppwinrt] port rewrite to use cppwint.exe tool from NuGet Gallery #24967
Conversation
@BillyONeal @kennykerr Please review this as well. |
Validated the supported triplets:
|
Note I've verified consuming the port from CMake works as expected using:
This results in (a) the generated C++/WinRT headers are in the INCLUDE path before the Windows SDK |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
ports/cppwinrt/CMakeLists.txt.in
Outdated
PATHS "${CMAKE_CURRENT_SOURCE_DIR}/build/native/lib/${CPPWINRT_ARCH}" | ||
REQUIRED NO_DEFAULT_PATH) | ||
|
||
#--- Find Windows SDK Version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of searching for a windows sdk, the build should:
- Require
ENV{WindowsSDKDir}
andENV{WindowsSDKVersion
to be set (if not, fail) - Require Windows.Foundation.FoundationContract to exist (if not, fail)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simplified logic since in most cases it's already finding it from CMAKE_SYSTEM_VERSION
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried this approach and it works locally, but fails in the ADO pipelines. I've restored the scanning SDK versions fallback for cases where it isn't able to rely on the envvars.
Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!
PRs must add only one version and must not modify any published versions
When making any changes to a library, the version or port-version in vcpkg.json
or CONTROL
must be modified.
error: checked-in files for cppwinrt have changed but the version was not updated
version: 2.0.220418.1
old SHA: da4c6dd987474ee70f7d28715d791d5fa625264b
new SHA: f0b448081be6fba10e25084686a490cbd800cac6
Did you remember to update the version or port version?
Use --overwrite-version to bypass this check
***No files were updated***
Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!
PRs must add only one version and must not modify any published versions
When making any changes to a library, the version or port-version in vcpkg.json
or CONTROL
must be modified.
error: checked-in files for cppwinrt have changed but the version was not updated
version: 2.0.220418.1
old SHA: da4c6dd987474ee70f7d28715d791d5fa625264b
new SHA: 92c49ba0383df451fc8468c02552b5f2fd30aeac
Did you remember to update the version or port version?
Use --overwrite-version to bypass this check
***No files were updated***
Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!
PRs must add only one version and must not modify any published versions
When making any changes to a library, the version or port-version in vcpkg.json
or CONTROL
must be modified.
error: checked-in files for cppwinrt have changed but the version was not updated
version: 2.0.220418.1
old SHA: da4c6dd987474ee70f7d28715d791d5fa625264b
new SHA: 461c350a7afd51f12570934c778fed578e360b29
Did you remember to update the version or port version?
Use --overwrite-version to bypass this check
***No files were updated***
Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!
PRs must add only one version and must not modify any published versions
When making any changes to a library, the version or port-version in vcpkg.json
or CONTROL
must be modified.
error: checked-in files for cppwinrt have changed but the version was not updated
version: 2.0.220418.1
old SHA: da4c6dd987474ee70f7d28715d791d5fa625264b
new SHA: a5a9985a4ad486f761568067b38aec6419d82b2c
Did you remember to update the version or port version?
Use --overwrite-version to bypass this check
***No files were updated***
Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!
PRs must add only one version and must not modify any published versions
When making any changes to a library, the version or port-version in vcpkg.json
or CONTROL
must be modified.
error: checked-in files for cppwinrt have changed but the version was not updated
version: 2.0.220418.1
old SHA: da4c6dd987474ee70f7d28715d791d5fa625264b
new SHA: de946a53fc6995484d31e8d3968e0348a9f1bd88
Did you remember to update the version or port version?
Use --overwrite-version to bypass this check
***No files were updated***
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!
PRs must add only one version and must not modify any published versions
When making any changes to a library, the version or port-version in vcpkg.json
or CONTROL
must be modified.
error: checked-in files for cppwinrt have changed but the version was not updated
version: 2.0.220418.1
old SHA: da4c6dd987474ee70f7d28715d791d5fa625264b
new SHA: dd1a129028ac288130d7fef3a4de8edfe9dd3622
Did you remember to update the version or port version?
Use --overwrite-version to bypass this check
***No files were updated***
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!
PRs must add only one version and must not modify any published versions
When making any changes to a library, the version or port-version in vcpkg.json
or CONTROL
must be modified.
error: checked-in files for cppwinrt have changed but the version was not updated
version: 2.0.220418.1
old SHA: ff0b0e37642ae2f1798430f20ce763264e477b85
new SHA: 2332b10338616af4bd8ac79a8d5f8787dafe99a8
Did you remember to update the version or port version?
Use --overwrite-version to bypass this check
***No files were updated***
After all code review, revalidated supported triplets and checked consuming of this port.
|
As I was looking into why the Windows SDK env vars wouldn't work, I noticed a bunch of other little things that could be touched up:
I'd appreciate it if you could double check the change I pushed and ensure it still works for you as well, if it does this LGTM. Thanks again! |
The reason I had it install to (a) You can still use If that isn't a concern, then this is fine. |
Co-authored-by: LilyWangLL <94091114+LilyWangLL@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!
PRs must add only one version and must not modify any published versions
When making any changes to a library, the version or port-version in vcpkg.json
or CONTROL
must be modified.
error: checked-in files for cppwinrt have changed but the version was not updated
version: 2.0.220418.1
old SHA: d4e517abedddb8d20362bc9cbae6716ecf3a7f62
new SHA: 18d6860cc0a36639fe348d27ab4cb763dfc0e879
Did you remember to update the version or port version?
Use --overwrite-version to bypass this check
***No files were updated***
LGTM, thanks! |
The existing cppwinrt port really does nothing beyond verifying the installed Windows SDK has pre-generated cppwinrt headers. The Windows SDK headers for C++/WinRT are old, and the recommendation is to use the Microsoft.Windows.CppWinRT NuGet instead. This package contains the latest
cppwinrt.exe
compiler tool that is then executed using the installed Windows SDK to generate the latest C++/WinRT projections from the Windows SDK.winmd
files.This updated port now does this as well for the installed Windows SDK headers when the port is installed.