-
Notifications
You must be signed in to change notification settings - Fork 247
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
Add Linux native build #1239
Add Linux native build #1239
Conversation
For reasons yet unknown to me, GCC 11 on Ubuntu 22.04 emits references to the `extern char const _[]` declarations inside `strings.h` without C++ name mangling applied, causing link errors. Wrapping the declarations inside `extern "C++"` fixes this issue somehow, so this change does exactly it.
3dcbdda
to
9088cb3
Compare
I did test the native Linux build with a copy of |
We could include the winmd in the repo just for CI validation. That's what I do here for Rust: /~https://github.com/microsoft/windows-rs/tree/master/crates/libs/metadata/default |
Almost forgot - there is a nuget package with just the winmd files: https://www.nuget.org/packages/Microsoft.Windows.SDK.Contracts/ |
Ah, neat that it is included in windows-rs. I could just download the file from there as part of the workflow. Committing the file into the repo may be an option too, but I wonder if it should be done for just one CI check... While we are on this topic, will you be able to clarify the license of the winmd files? Since the merged I ask because there are concerns about the license of the generated headers. If someone as a third party generates the headers using the winmd files shipped with either Windows or the WinSDK, it is not clear whether the generated headers are clean in regard to licensing. If we do have a source of the winmd file licensed under MIT, then there should be no more licensing issues with the generated headers. This brings us back to the question whether we should include the winmd file in this repo -- if it can indeed be licensed under MIT, then it may be a good idea to include it in the repo not just for the CI check, but also to provide a copy of it next to the cppwinrt source which downstream can use. (It would still be nice if there is a standalone package of the winmd files explicitly licensed under MIT though.) |
Right, everything in the |
I sent you an invite to give you permission to re-run workflows as needed. |
Thanks! Looking at the latest failure, I think I should try using actions/cache@v3 action to avoid downloading the same dependencies repeatedly. Has this action been allowed in the repo settings? |
Yes, that's what I use on windows-rs - I've enabled it here as well. |
@@ -3,6 +3,7 @@ | |||
#include <cassert> | |||
#include <array> | |||
#include <limits> | |||
#include <climits> |
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.
Curious what this is for, as opposed to limits
...
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.
Line 316 has static constexpr uint32_t no_max = UINT_MAX;
Something seems to be wrong with the test validation. It doesn't seem to break the build anymore. /~https://github.com/microsoft/cppwinrt/actions/runs/3628603087/jobs/6120073812#step:7:44 |
This test is marked for Clang "shouldfail" because libc++ does not yet support |
Thanks! |
Depends on #1238 and microsoft/winmd#28
This adds support for building a native Linux executable of cppwinrt. It works mostly the same as on Windows, except without the code that searches for Windows SDKs and local WinMetadata.