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

Move to windows 0.58.0, and also permit version 0.59 #65

Merged
merged 2 commits into from
Jan 20, 2025

Conversation

ErichDonGubler
Copy link
Contributor

@ErichDonGubler ErichDonGubler commented Jan 10, 2025

No description provided.

@ErichDonGubler ErichDonGubler changed the title WIP: build: allow windows-core 0.59, windows-targets 0.53 build: allow windows-core 0.59, windows-targets 0.53 Jan 10, 2025
@ErichDonGubler ErichDonGubler changed the title build: allow windows-core 0.59, windows-targets 0.53 build: use windows-{core,bindgen} 0.59, windows-targets 0.53 Jan 10, 2025
Copy link

codecov bot commented Jan 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.53%. Comparing base (ded3b5b) to head (4afd54a).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #65      +/-   ##
==========================================
- Coverage   86.71%   86.53%   -0.18%     
==========================================
  Files           5        5              
  Lines         557      557              
  Branches      557      557              
==========================================
- Hits          483      482       -1     
- Misses         48       49       +1     
  Partials       26       26              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ErichDonGubler
Copy link
Contributor Author

Not sure what the Linux-only nightly debug failure is, but it's something to do with LSAN. 😬 I don't think I have the bandwidth to figure it out right this moment, though.

@ErichDonGubler
Copy link
Contributor Author

This PR only upgrades windows-* dependencies, though @mxinden had invited me to make them a range dependency instead. The reason I didn't is that while things seem source-compatible between versions of windows-core releases, windows-bindgen's output supposedly changes significantly between the 0.58 and 0.59 versions. I wasn't sure if it was safe to use a range in that case.

It seems that bindgen is/was used to avoid bringing in the windows crate, but I think that should actually be fine to use now in mozilla-central. Was there another reason not to use the windows crate directly? If not, we might be able to use a range over the windows crate itself.

@mxinden
Copy link
Collaborator

mxinden commented Jan 13, 2025

Not sure what the Linux-only nightly debug failure is, but it's something to do with LSAN. 😬 I don't think I have the bandwidth to figure it out right this moment, though.

Will be fixed with #69.

@mxinden
Copy link
Collaborator

mxinden commented Jan 13, 2025

It seems that bindgen is/was used to avoid bringing in the windows crate, but I think that should actually be fine to use now in mozilla-central. Was there another reason not to use the windows crate directly? If not, we might be able to use a range over the windows crate itself.

@larseggert can you explain why bindgen is used?

Cargo.toml Outdated Show resolved Hide resolved
@larseggert
Copy link
Collaborator

In earlier versions, we tried to avoid pulling in the other largerwindows crates by having a static Rust binding file for the few Windows APIs we called, together with a CI test that called bindgen to detect any changes.

We abandoned that at some point, and converted to calling bindgen during build. I don't think there was any reason other than it was a simply change.

If we can avoid bindgen by just using the other windows crates, let's do so, esp. if it makes integration easier.

@larseggert
Copy link
Collaborator

@ErichDonGubler I don't seem to have the ability to rebase your PR; did you maybe not give owners the relevant permission?

@ErichDonGubler
Copy link
Contributor Author

ErichDonGubler commented Jan 13, 2025

@larseggert: Huh, that's strange, I'm not sure why you can't rebase. I don't see the Allow maintainers to edit this PR checkbox, but that's normally what I'd check. 🤔

I've rebased using the GH UI.

@larseggert
Copy link
Collaborator

@ErichDonGubler Thanks for rebasing. Would you want to switch us from the bindgen dep to the other windows deps in this PR?

@ErichDonGubler
Copy link
Contributor Author

@larseggert: Sure!

@mxinden
Copy link
Collaborator

mxinden commented Jan 17, 2025

For what my input is worth here, I am in favor of moving from windows-bindgen to windows, as the former is not yet part of mozilla-central, but the latter is.

While I assume we can bring windows-bindgen into mozilla-central, it will require a cargo vet audit and, more generally, increase our dependency footprint.

        new file:   third_party/rust/windows-bindgen/.cargo-checksum.json
        new file:   third_party/rust/windows-bindgen/Cargo.toml
        new file:   third_party/rust/windows-bindgen/default/Windows.Wdk.winmd
        new file:   third_party/rust/windows-bindgen/default/Windows.Win32.winmd
        new file:   third_party/rust/windows-bindgen/default/Windows.winmd
        new file:   third_party/rust/windows-bindgen/default/readme.md
        new file:   third_party/rust/windows-bindgen/license-apache-2.0
        new file:   third_party/rust/windows-bindgen/license-mit
        new file:   third_party/rust/windows-bindgen/readme.md
        new file:   third_party/rust/windows-bindgen/src/args.rs
        new file:   third_party/rust/windows-bindgen/src/error.rs
        new file:   third_party/rust/windows-bindgen/src/lib.rs
        new file:   third_party/rust/windows-bindgen/src/metadata.rs
        new file:   third_party/rust/windows-bindgen/src/rdl/fmt.rs
        new file:   third_party/rust/windows-bindgen/src/rdl/from_reader.rs
        new file:   third_party/rust/windows-bindgen/src/rdl/mod.rs
        new file:   third_party/rust/windows-bindgen/src/rdl/to_winmd.rs
        new file:   third_party/rust/windows-bindgen/src/rust/cfg.rs
        new file:   third_party/rust/windows-bindgen/src/rust/classes.rs
        new file:   third_party/rust/windows-bindgen/src/rust/com_methods.rs
        new file:   third_party/rust/windows-bindgen/src/rust/constants.rs
        new file:   third_party/rust/windows-bindgen/src/rust/delegates.rs
        new file:   third_party/rust/windows-bindgen/src/rust/enums.rs
        new file:   third_party/rust/windows-bindgen/src/rust/extensions/mod.rs
        new file:   third_party/rust/windows-bindgen/src/rust/functions.rs
        new file:   third_party/rust/windows-bindgen/src/rust/handles.rs
        new file:   third_party/rust/windows-bindgen/src/rust/implements.rs
        new file:   third_party/rust/windows-bindgen/src/rust/index.rs
        new file:   third_party/rust/windows-bindgen/src/rust/interfaces.rs
        new file:   third_party/rust/windows-bindgen/src/rust/iterators.rs
        new file:   third_party/rust/windows-bindgen/src/rust/method_names.rs
        new file:   third_party/rust/windows-bindgen/src/rust/mod.rs
        new file:   third_party/rust/windows-bindgen/src/rust/standalone.rs
        new file:   third_party/rust/windows-bindgen/src/rust/structs.rs
        new file:   third_party/rust/windows-bindgen/src/rust/try_format.rs
        new file:   third_party/rust/windows-bindgen/src/rust/winrt_methods.rs
        new file:   third_party/rust/windows-bindgen/src/rust/writer.rs
        new file:   third_party/rust/windows-bindgen/src/tokens/mod.rs
        new file:   third_party/rust/windows-bindgen/src/tokens/runtime.rs
        new file:   third_party/rust/windows-bindgen/src/tokens/to_tokens.rs
        new file:   third_party/rust/windows-bindgen/src/tokens/token_stream.rs
        new file:   third_party/rust/windows-bindgen/src/tree.rs
        new file:   third_party/rust/windows-bindgen/src/winmd/from_reader.rs
        new file:   third_party/rust/windows-bindgen/src/winmd/mod.rs
        new file:   third_party/rust/windows-bindgen/src/winmd/writer/blobs.rs
        new file:   third_party/rust/windows-bindgen/src/winmd/writer/codes.rs
        new file:   third_party/rust/windows-bindgen/src/winmd/writer/file.rs
        new file:   third_party/rust/windows-bindgen/src/winmd/writer/mod.rs
        new file:   third_party/rust/windows-bindgen/src/winmd/writer/strings.rs
        new file:   third_party/rust/windows-bindgen/src/winmd/writer/tables.rs
        new file:   third_party/rust/windows-bindgen/src/winmd/writer/traits.rs
        new file:   third_party/rust/windows-bindgen/src/winmd/writer/type.rs
        new file:   third_party/rust/windows-metadata/.cargo-checksum.json
        new file:   third_party/rust/windows-metadata/Cargo.toml
        new file:   third_party/rust/windows-metadata/license-apache-2.0
        new file:   third_party/rust/windows-metadata/license-mit
        new file:   third_party/rust/windows-metadata/readme.md
        new file:   third_party/rust/windows-metadata/src/attributes.rs
        new file:   third_party/rust/windows-metadata/src/bindings.rs
        new file:   third_party/rust/windows-metadata/src/blob.rs
        new file:   third_party/rust/windows-metadata/src/codes.rs
        new file:   third_party/rust/windows-metadata/src/column.rs
        new file:   third_party/rust/windows-metadata/src/file.rs
        new file:   third_party/rust/windows-metadata/src/filter.rs
        new file:   third_party/rust/windows-metadata/src/lib.rs
        new file:   third_party/rust/windows-metadata/src/reader.rs
        new file:   third_party/rust/windows-metadata/src/row.rs
        new file:   third_party/rust/windows-metadata/src/table.rs
        new file:   third_party/rust/windows-metadata/src/tables.rs
        new file:   third_party/rust/windows-metadata/src/type.rs
        new file:   third_party/rust/windows-metadata/src/type_name.rs

@ErichDonGubler I appreciate your support here. Let me know if you need any help.

@ErichDonGubler ErichDonGubler changed the title build: use windows-{core,bindgen} 0.59, windows-targets 0.53 Move to windows 0.58.0, and also permit version 0.59 Jan 17, 2025
@ErichDonGubler
Copy link
Contributor Author

Just force-pushed to move to the windows crate, plus an extension to version 0.59. 🙌🏻 Nice, that was easier than I'd hoped it'd be!

@ErichDonGubler
Copy link
Contributor Author

Just made an example showing that windows 0.59.0 can be consolidated into after patching libloading here: erichdongubler-mozilla@3a713aa

ErichDonGubler referenced this pull request in erichdongubler-mozilla/mtu Jan 17, 2025
You can recreate this commit by:

1. Applying a `patch.crates-io.libloading` to point to the upstream PR
   allowing `windows` 0.59 in its dep. range.
2. Run `cargo update`.
@ErichDonGubler
Copy link
Contributor Author

🙌🏻 This PR no longer has a hard dependency on libloading's upstream PR to extend its windows dependency version range (nagisa/rust_libloading#169), but an upgrade of libloading after it releases that PR's contents is necessary to allow downstream crates to upgrade to windows 0.59.0.

@larseggert larseggert merged commit 758a40b into mozilla:main Jan 20, 2025
30 of 31 checks passed
@mxinden
Copy link
Collaborator

mxinden commented Jan 20, 2025

Thanks for the quick help here @ErichDonGubler! Will make my life a lot easier bringing mtu into mozilla-central!

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.

3 participants