You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
windows-sys@0.61.0+ is broken for win7 target #3808
windows-sys@0.60.2 is the last version of the crate that can works without a problem under *-win7-windows-msvc target.
Starts from 0.61.0 there is a bug that cannot allow to running compiled binaries. Compiled programs at the start output a message:
$ sea --help
C:/Users/Fenex/.cargo/bin/sea.exe: error while loading shared libraries: combase.dll: cannot open shared object file: No such file or directory
This is likely related to #3743 where it favors compatibility with Windows 11 editions over Windows 7. It only affects a handful of functions so I would just use the windows-link crate directly and specify whatever library you desire.
Thanks for your answer.
I don't understand how and where I should use `windows-link`. I just
want to install cli utility, sea-orm-cli@1.
I run `cargo install sea-orm-cli@1.1.17`, its compiled, but no works. I
believe this bug has began with other programs soon.
05.11.2025 21:21, Kenny Kerr пишет:
Kenny Kerr (@kennykerr) Why is windows-rs team so against merging #3791 ? This PR fixes the problems for the people who are experiencing issues with the Win7 target, while still being compatible with whatever weird Win11 target Microsoft is using internally. Why is this project being so actively hostile towards the folks that need win7 to work?
Also, are we pretending that this Win11 Edition will ever be public? Because it's pretty obvious this is an internal component for MS, given how much existing software will not work on it. The official MS documentation website still claims that all those functions are available through OLE32.dll and not combase.dll...
So really, this change was done "in favor" of internal MS builds, at the expense of win7 user, despite having a clear way to mitigate the breakage.
I understand not wanting to support Win7 - I really do. I only support it begrudgingly, because some of my customers have old servers they can't or won't upgrade. But I don't understand why you would reject a simple PR that fixes the win7 breakage without causing any trouble for the targets you do support.
On a practical level, we don't have the ability to test any of this and without that ability there is nothing that ensures that it even works to begin with or that ensures that it keeps working as future changes are made to this project. As it is, I've allowed a few changes over the years that were not easily testable and they have all come back to bite me in the end. 🙃
The "weird Win11 target" is actually just a subset of Windows 11 and not some different edition. That is why in practice whatever works on that edition will also work on regular Windows 11. The documentation is unfortunately out of my control but something I hope to affect as we improve the quality and efficacy of the Windows API metadata.
On a practical level, we don't have the ability to test any of this and without that ability there is nothing that ensures that it even works to begin with or that ensures that it keeps working as future changes are made to this project.
I understand that, and I'm not asking for the Windows-RS project to test win7 support or to keep win7 working in the future. I fully understand that changes you make can (and will) break win7 support. All I'm asking is the willingness to review/accept contributions that fix win7 when those patches don't impact the supported targets, and are kept simple enough to not impose undue maintenance burden. I don't think the patches I provided failed that test - though if you disagree, I'd like to understand how. As it stands, win7 support is broken anyways, so it's hard to see how the patch could make the situation worse.
Windows-rs is the foundation on which the entire Rust Windows ecosystem relies. As things stand, it's impossible to make a toolchain supporting win7, solely because of this decision to not accept win7 fixes. Cargo can't even build without this patch. And I think asking every project on earth to carry a fix to support win7, when the fix could easily be included in windows-sys, is rather unreasonable.
As an alternative, would you accept adding a new target to windows-targets for win7, with the fix provided by riverar (the forwarder .def linked through a build script)? This would make for a self-contained crate where win7-specific fixes can go, at least for windows-sys things, which would minimize your maintenance impact even further.
This is likely related to #3743 where it favors compatibility with Windows 11 editions over Windows 7. It only affects a handful of functions so I would just use the windows-link crate directly and specify whatever library you desire.
Can give an example about how to overwrite the link already existed in windows-sys crate?
I met the same issue and want to change the link for window7.
I don't get it. How can you use the codes of this repo to change or remove the link for combase.dll in windows-sys crate?
I also tried the method metioned by riverar in #3743, it did add ole32.dll function but still require combase.dll.
Is it possible to release a raw-dylib and ole32.dll based version without touching the main release?
Activity
kennykerr commentedon Nov 5, 2025
This is likely related to #3743 where it favors compatibility with Windows 11 editions over Windows 7. It only affects a handful of functions so I would just use the windows-link crate directly and specify whatever library you desire.
Fenex commentedon Nov 5, 2025
kennykerr commentedon Nov 5, 2025
Ah, you'll have to check with whoever develops the utility. It may be that they no longer support Windows 7.
Fenex commentedon Nov 5, 2025
I'm sure problem in this crate, not their.
I had clone a sea-orm-cli and make downgrade some dependency crates to exclude windows-sys>0.61 from the dependency tree. And all start works fine.
roblabla commentedon Dec 2, 2025
Kenny Kerr (@kennykerr) Why is windows-rs team so against merging #3791 ? This PR fixes the problems for the people who are experiencing issues with the Win7 target, while still being compatible with whatever weird Win11 target Microsoft is using internally. Why is this project being so actively hostile towards the folks that need win7 to work?
Also, are we pretending that this Win11 Edition will ever be public? Because it's pretty obvious this is an internal component for MS, given how much existing software will not work on it. The official MS documentation website still claims that all those functions are available through OLE32.dll and not combase.dll...
So really, this change was done "in favor" of internal MS builds, at the expense of win7 user, despite having a clear way to mitigate the breakage.
I understand not wanting to support Win7 - I really do. I only support it begrudgingly, because some of my customers have old servers they can't or won't upgrade. But I don't understand why you would reject a simple PR that fixes the win7 breakage without causing any trouble for the targets you do support.
kennykerr commentedon Dec 2, 2025
On a practical level, we don't have the ability to test any of this and without that ability there is nothing that ensures that it even works to begin with or that ensures that it keeps working as future changes are made to this project. As it is, I've allowed a few changes over the years that were not easily testable and they have all come back to bite me in the end. 🙃
The "weird Win11 target" is actually just a subset of Windows 11 and not some different edition. That is why in practice whatever works on that edition will also work on regular Windows 11. The documentation is unfortunately out of my control but something I hope to affect as we improve the quality and efficacy of the Windows API metadata.
roblabla commentedon Dec 3, 2025
I understand that, and I'm not asking for the Windows-RS project to test win7 support or to keep win7 working in the future. I fully understand that changes you make can (and will) break win7 support. All I'm asking is the willingness to review/accept contributions that fix win7 when those patches don't impact the supported targets, and are kept simple enough to not impose undue maintenance burden. I don't think the patches I provided failed that test - though if you disagree, I'd like to understand how. As it stands, win7 support is broken anyways, so it's hard to see how the patch could make the situation worse.
Windows-rs is the foundation on which the entire Rust Windows ecosystem relies. As things stand, it's impossible to make a toolchain supporting win7, solely because of this decision to not accept win7 fixes. Cargo can't even build without this patch. And I think asking every project on earth to carry a fix to support win7, when the fix could easily be included in windows-sys, is rather unreasonable.
I really hope we can find some compromise here.
roblabla commentedon Dec 3, 2025
As an alternative, would you accept adding a new target to windows-targets for win7, with the fix provided by riverar (the forwarder .def linked through a build script)? This would make for a self-contained crate where win7-specific fixes can go, at least for windows-sys things, which would minimize your maintenance impact even further.
jamesvren commentedon Jun 11, 2026
Can give an example about how to overwrite the link already existed in windows-sys crate?
I met the same issue and want to change the link for window7.
kennykerr commentedon Jun 11, 2026
https://github.com/kennykerr/patch_link
jamesvren commentedon Jun 12, 2026
I don't get it. How can you use the codes of this repo to change or remove the link for combase.dll in windows-sys crate?
I also tried the method metioned by riverar in #3743, it did add ole32.dll function but still require combase.dll.
Is it possible to release a raw-dylib and ole32.dll based version without touching the main release?
jamesvren commentedon Jun 12, 2026
Ok, here is my solution. In your lib.rs,
then in your code where use the function
Update all non-major dependencies (#111)