svenstaro/miniserve

Can the compilation target i686-pc-windows-msvc be added to run on a 32-bit Windows?

Closed this issue · 15 comments

This is a wonderful project. It works very well.
But the current build cannot run it on an old machine with 32-bit Windows.
Can the compilation target i686-pc-windows-msvc be added to run on a 32-bit Windows?

I (or someone else) could easily add that as rustc still has official support for that. I have to ask, however, is this a target that you are personally using? I'm not saying that it's an invalid use case, rather am I rather interested in the circumstances of yours that lead to such a requirement.

I (or someone else) could easily add that as rustc still has official support for that. I have to ask, however, is this a target that you are personally using? I'm not saying that it's an invalid use case, rather am I rather interested in the circumstances of yours that lead to such a requirement.

I have some 2G or 1G RAM machines on which I will run windows thinpc, which is the official stripped-down version of windows7 with very low RAM and disk requirements.

Could you check whether the binary here works for you? https://github.com/svenstaro/miniserve/actions/runs/6925636871?pr=1273

I tested it on the win8.1 x86 version.

First of all, Windows will report an error, and the error module is: api-ms-win-crt-heap-l1-1-0.dll.
Fixed after installing Windows8.1-KB2999226-x86.msu.

Then, another error is reported, and the error module is: VCRUNTIME140.dll.
Resolve after installing vc_redist.x86.exe (Visual C++ Redistributable for Visual Studio 2015-2022).

Then It works ok!

I'll test some other versions of Windows later.

After the above two steps, Windows ThinPC (the official stripped-down version of win7 x86) works fine too.

By the way, I tested it on Win10 x64, and it worked fine without installing any patches.

So I think we're good then?

Actually hang on, I got an idea.

I was missing

[target.i686-pc-windows-msvc]
rustflags = ["-C", "target-feature=+crt-static"]

in .cargo/config.toml. With that added, I don't think the additional libs for Windows 32 should be required.

I guess 64-bit (Win7, win8, and win8.1) has the same dependency.

Yeah but that already had this entry for it:

[target.x86_64-pc-windows-msvc]
rustflags = ["-C", "target-feature=+crt-static"]

OK, I can test the program after adding the dependency again.

Nice! I rolled back the win8.1 snapshot in the virtual machine before the patch was installed, and now works fine without the above two patches.
I think it's enough to merge pull.

Happy to hear!