Windows 7 support drop in 1.76: no_std affected?

Since Rust will drop support for Windows 7 in 1.76, I was wondering if the x86_64-pc-windows-msvc target could still be used to build a library to be used on Windows 7 in no_std context.

A no_std binary should not interact with the OS at all, so shouldn't be affected by the version, no? Is there anything else that could break? I guess getting an allocator would talk to the OS somehow... What about the final PE, could LLVM generate code that wouldn't run on Windows 7? I've seen that it's dropping support for Windows 7 too, but what is it that LLVM needs on specific Windows versions? It's not processor support since those are separate from the OS. Or does Windows 10 requires CPU features that could be absent on a Windows 7 and thus LLVM could generate invalid (to Windows 7) code?

Thanks for the clarification!!

1 Like

no_std should not be affected. That said, one thing to watch out for is if Rust decides to bump the default CPU requirements. This would not directly affect running Win7 but would affect very old computers (e.g. those using the very earliest x64 CPUs).

It should also be noted that there is an effort on going to make a Windows 7 target that's maintained in-tree, which would allow you to just switch target and continue as normal. This has not been accepted yet tho so don't quote me on that!

The effort mentioned: if accepted Add new targets {x86_64,i686}-win7-windows-msvc by roblabla · Pull Request #118150 · rust-lang/rust · GitHub will re-add win7 as a tier-3 target. Then you can use that with nightly and -Zbuild-std or with a custom rust build.

1 Like

My hope is that we can either jump straight to tier 2 or otherwise get there quickly as it is just splitting off from an existing target. If/when it's tier 2 the std will be available normally through rustup.

What kind of things can happen when building for an unsupported OS?

With std? Anything. It could work on that OS. It might panic when you try to do something. It might not even reach main. It may appear to work perfectly but then have weird bugs in certain situations.

With no_std (which relies less on the OS) breakage is less likely but still possible. E.g. getting a no_std Rust compiled binary to run on WinXP does require a little bit of extra set up.

2 Likes

Out of interest, why would anyone care about Windows 7 support at this point? It is no longer getting security updates by Microsoft, so it is not at all secure to use (except fully disconnected). For a long time you could also freely upgrade to Windows 10, though I believe that is no longer the case.

So I don't see any reason to still be on Windows 7 where you would also care about building new software for it.

1 Like

Windows 10 and 11 have ads, send telemetry to microsoft and in general are a privacy nightmare. This is not the case for Windows 7.

4 Likes

Fair point, but if using a system that isn't connected to the Internet that doesn't matter. If it is connected Windows 7 isn't receiving security updates. Switching to Linux is the better option at that point, and wine/proton is pretty good at running Windows software and games these days. (I use Linux exclusively these days, at home since 2009 and at work since 2018.)

4 Likes

Windows 7 does have telemetry but I'd agree it's beside the point either way. Questioning why some people (or their customers) need Windows 7 support isn't very productive. So long as a third party is willing to do the testing and provide patches when necessary, adding a win7 target should be low maintenance for the Rust project. It can't be tier 1 though because we don't have the infrastructure for automated testing on Windows 7.

3 Likes

Thanks for the info all!

I was discussing with a colleague if going no_std could alleviate the support drop but we were not sure if even no_std could be affected. I feel like it's a possibility, but a lot less probable. Thanks for confirming this!

I'll take a look at the PR adding the new target. That might also be an option.

Basically if there's demand for a Windows 7 target and there are people willing to support that (with patches and advice), then Rust can definitely support it.

It is important that it be a separate target though, because we can only have one std per target. And Windows 7 can't be tier 1, while Windows 10 can be.

1 Like