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

tempfile 3.17 compile failed while using windows-sys 0.52 #331

Closed
Xuanwo opened this issue Feb 17, 2025 · 3 comments · Fixed by #332
Closed

tempfile 3.17 compile failed while using windows-sys 0.52 #331

Xuanwo opened this issue Feb 17, 2025 · 3 comments · Fixed by #332

Comments

@Xuanwo
Copy link

Xuanwo commented Feb 17, 2025

Hi, @Stebalien, thank you for the maintenance. I found that the latest tempfile 3.17 failed to compile when using windows-sys 0.52.

The error message:

error[E0308]: mismatched types
   --> C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tempfile-3.17.0\src\file\imp\windows.rs:34:13
    |
33  |         if SetFileInformationByHandle(
    |            -------------------------- arguments to this function are incorrect
34  |             f.as_raw_handle(),
    |             ^^^^^^^^^^^^^^^^^ expected `isize`, found `*mut c_void`
    |
    = note:     expected type `isize`
            found raw pointer `*mut c_void`
note: function defined here
   --> C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows-sys-0.52.0\src\Windows\Win32\Storage\FileSystem\mod.rs:607:106
    |
607 | ::windows_targets::link!("kernel32.dll" "system" #[doc = "Required features: `\"Win32_Foundation\"`"] fn SetFileInformationByHandle(hfile...
    |                                                                                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^

For more information about this error, try `rustc --explain E0308`.
error: could not compile `tempfile` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...

The commit that breaks the build: 461369f

Stebalien added a commit that referenced this issue Feb 17, 2025
This isn't necessary for windows-sys 0.59, but is for windows-sys 0.52.

fixes #331
@Stebalien
Copy link
Owner

Ah... crap. Thanks for the report. Fixed in 3.17.1.

Our of curiosity, is there any reason you can't upgrade to windows-sys 0.59? If I'm going to keep support for windows-sys 0.52, I'm probably going to need to figure out a good way to test multiple windows-sys versions in CI which isn't going to be pretty. I'd prefer to move to 0.59 entirely.

@Xuanwo
Copy link
Author

Xuanwo commented Feb 17, 2025

Thank you for the quick fix!

Our of curiosity, is there any reason you can't upgrade to windows-sys 0.59?

Sadly, I'm not a direct user of either tempfile or windows-sys. I happen to rely on them through my dependency tree (I'm guessing it's from tonic or prost). So it's not something I can control.

@Stebalien
Copy link
Owner

Hm. Yeah, quite a few packages depend on 0.52 and haven't updated yet. Oh well.

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 a pull request may close this issue.

2 participants