-
Notifications
You must be signed in to change notification settings - Fork 15
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
Use windows-core
with embedded bindings via windows-bindgen
#117
Conversation
Thank you for working on this! I propose this new CI test (.github/workflow/rust.yml): test-windows-api-gen:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Rust
run: |
rustup toolchain install stable --profile minimal --no-self-update
- run: cargo run --package api_gen
- run: git diff --exit-code This way we know if anything has changed upstream, and users can be sure that the code is what it claims to be. :) |
The generated code works with I would allow a version range as I proposed in #112: |
a4a0de4
to
c7f9ba1
Compare
I hadn't yet pushed this from my other Not sure what we need most
Nice catch! I hadn't even thought of trying this because There's a strict downside as users of MSRV 1.48 will now have to make sure to lock
This will only apply to the |
Let's approve/run the CI to confirm the above? |
Darn, this will change will increase the MSRV to 1.56 for unrelated platforms, too. Cargo fails if it finds Cargo.toml with IMO it's okay to bump the MSRV. Versions < 1.56 are unusable by now, because fundamental crates like syn are edition = 2021 by now. |
11b1cd7
to
968eb9c
Compare
Aplogies, it was me who forgot to replace I've removed it so that we can see where we stand now - probably still need to downgrade |
Fwiw the |
968eb9c
to
c052d79
Compare
@Kijewski where are we at with this? |
Thank you for your work! Sorry that it took so long to get merged. |
No worries, I just wanted to see the CI run-failure so that I could add something akin to ed6476b, making sure that Windows+MSRV is only validated for |
Closes #116
As discussed in #97 (comment)
iana-time-zone
might not have to pull in the wholewindows
crate, but only generate the bindings (one single type and function call) that it needs and use simplified/stripped-down windows components from the (much lighter!)windows-core
crate.As also brought up in #97 (comment) however, this approach currently has as few drawbacks:
cfg
around APIs. The wholeWindows.Globalization.Calendar
type is generated, and a few functions require external types, which also require more types ,leading to a bit of (compile) overhead (and generated file bloat) that wasn't there with thewindows
crate;On my machine this appears to be about half a second faster to compile.
Opening this as draft to put some visibility to the changes I've already made, and to have a place to discuss how/where we could improve this; allowing it to be merged (if folks are happy with this) as soon as there is an applicable MSRV bump.