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

windows-targets v0.52.3 increased MSRV to 1.60 #2896

Closed
lopopolo opened this issue Feb 28, 2024 · 11 comments · Fixed by #2898
Closed

windows-targets v0.52.3 increased MSRV to 1.60 #2896

lopopolo opened this issue Feb 28, 2024 · 11 comments · Fixed by #2898
Labels
bug Something isn't working

Comments

@lopopolo
Copy link

lopopolo commented Feb 28, 2024

Summary

windows-targets v0.52.3 increased its MSRV in a patch release from Rust 1.56 to Rust 1.60. This means that windows-sys v0.52.0 no longer builds on Rust 1.56, which is its stated MSRV on crates.io and in Cargo.toml.

Crate manifest

[package]
name = "known-folders"
version = "1.1.0" # remember to set `html_root_url` in `src/lib.rs`.
authors = ["Ryan Lopopolo <[email protected]>"]
license = "Apache-2.0 OR MIT"
edition = "2021"
rust-version = "1.58.0"
readme = "README.md"
repository = "https://github.com/artichoke/known-folders-rs"
documentation = "https://docs.rs/known-folders"
homepage = "https://github.com/artichoke/known-folders-rs"
description = "A safe wrapper around the Known Folders API on Windows"
keywords = ["app_dirs", "known-folder", "path", "windows"]
categories = ["api-bindings", "filesystem", "os::windows-apis"]
include = ["examples/**/*", "src/**/*", "tests/**/*", "LICENSE-*", "README.md"]

[dependencies]

[target.'cfg(windows)'.dependencies.windows-sys]
version = "0.52.0"
features = [
  "Win32_Foundation",
  "Win32_Globalization",
  "Win32_System_Com",
  "Win32_UI_Shell",
]

# Check that crate versions are properly updated in documentation and code when
# bumping the version.
[dev-dependencies.version-sync]
version = "0.9.4"
default-features = false
features = ["markdown_deps_updated", "html_root_url_updated"]

[package.metadata.docs.rs]
rustdoc-args = ["--cfg", "docsrs"]
targets = [
  # Tier 1
  "x86_64-pc-windows-msvc",
  "x86_64-pc-windows-gnu",
  "i686-pc-windows-msvc",
  "i686-pc-windows-gnu",
  # Tier 2
  #  "aarch64-pc-windows-msvc",
  #  "i586-pc-windows-msvc",
]

Crate code

No response

@lopopolo lopopolo added the bug Something isn't working label Feb 28, 2024
@lopopolo
Copy link
Author

These are the build logs from my weekly CI build with Rust 1.58 for known-folders:

$ rustc -Vv
rustc 1.58.0 (02072b482 2022-01-11)
binary: rustc
commit-hash: 02072b482a8b5357f7fb5e5637444ae30e423c40
commit-date: 2022-01-11
host: x86_64-pc-windows-msvc
release: 1.58.0
LLVM version: 13.0.0
$ cargo version --verbose
cargo 1.58.0 (7f08ace4f 2021-11-24)
release: 1.58.0
commit-hash: 7f08ace4f1305de7f3b1b0e2f76]5911957226bd4
commit-date: 2021-11-24
host: x86_64-pc-windows-msvc
libgit2: 1.3.0 (sys:0.13.23 vendored)
libcurl: 7.80.0-DEV (sys:0.4.51+curl-7.80.0 vendored ssl:Schannel)
os: Windows 10.0.20348 (Windows Server 2022 Datacenter) [64-bit]
$ cargo build --verbose
    Updating crates.io index
 Downloading crates ...
  Downloaded windows-targets v0.52.3
  Downloaded windows_x86_64_msvc v0.52.3
  Downloaded windows-sys v0.52.0
error: package `windows_x86_64_msvc v0.52.3` cannot be built because it requires rustc 1.60 or newer, while the currently active rustc version is 1.58.0
Error: Process completed with exit code 1.

@kennykerr
Copy link
Collaborator

Took a moment to recall, but this is another case where a Cargo workspace bug (rust-lang/cargo#10623) forced an artificial version bump (#2815) as a workaround.

@kennykerr
Copy link
Collaborator

I could remove the "rust-version" from the Cargo.toml file and republish. I can't build within the repo with Rust 1.56 because of the Cargo bug, but perhaps it will work as a package. I just don't know how to test that. @ChrisDenton may know.

@kennykerr
Copy link
Collaborator

Alternatively, I may just get rid of the workspace as it has caused so many of these kinds of issues.

@ChrisDenton
Copy link
Collaborator

You can do a dry run publish with the latest toolchain, e.g.:

cargo publish --dry-run -p windows_x86_64_msvc
cargo publish --dry-run -p windows-targets
git switch --detach 0.52.0
cargo publish --dry-run -p windows-sys

Etc, etc. Publishes to target/package. Then it can be tested with a separate crate using path dependencies and whatever rustc version you like. Admittedly this is a bit of a pain but either removing or restoring the rust-version to 1.56 seemed to work for me, after editing to use path dependencies.

@kennykerr
Copy link
Collaborator

Thanks Chris - I think I can just remove the rust-version for now to fix this issue - but after that I may just rip out the workspace.

@kennykerr
Copy link
Collaborator

I've published another update and everything seems to be working well:

D:\git\scratch>rustup default
1.56-x86_64-pc-windows-msvc (default)

D:\git\scratch>cargo check       
   Compiling windows_x86_64_msvc v0.52.4
    Checking windows-targets v0.52.4
    Checking windows-sys v0.52.0
    Checking scratch2 v0.1.0 (D:\git\scratch)
    Finished dev [unoptimized + debuginfo] target(s) in 0.46s

@ijackson
Copy link

ijackson commented Feb 29, 2024

Thanks for fixing the accidental MSRV increase.

However, I don't think yanking 0.52.3 was helpful. For us, it resulted in a hiccup in the release process of Arti. Generally it's not a good idea to yank a crate unless the consequences of a user using the questionable version is worse than a compile error. (Assuming you have published an fix as a point release.)

After all, in this situation, yanking causes a compile error if it does anything at all. And it can create compile errors where in fact everything would have been fine. So yanking a crate to prevent compile errors doesn't make sense.

@kennykerr
Copy link
Collaborator

Thanks for the feedback. Yes, that makes sense. I assume at this point there's no value in unyanking? 🤷

@ijackson
Copy link

Thanks for the feedback. Yes, that makes sense. I assume at this point there's no value in unyanking? 🤷

Well, I don't think it would do any harm and if someone hasn't noticed a failure yet it might mean they never see it. So I think I would suggest unyanking.

Thanks :-)

@kennykerr
Copy link
Collaborator

Done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants