svenstaro/miniserve

Add "-Ctarget-feature=+crt-static" to rust flags for msvc compile to get rid off the dependency on "vcruntime140.dll"

elmkni opened this issue · 7 comments

elmkni commented

Hi there!

My name is Elmar Knittel and I use Miniserve in conjunction with x-ite.

Miniserve is a fantastic tool for programs like x-ite that use XMLHttpRequest to pull in files (images etc) and therefore need a localhost server because of restricted CORS (cross origin resource sharing) policy!

Here's my request:

Please consider adding -Ctarget-feature=+crt-static to Rust flags for msvc compile to get rid off the dependency on vcruntime140.dll.

vcruntime140.dll is not part of standard Windows (not even for Windows11)!

At the moment I undergo the inconvenience to download the newest Rust-compiler, set it up and recompile Miniserve with -Ctarget-feature=+crt-static from source (including the download of over 300 Rust-crates) for every new version of Miniserve.

The increase in size is only 33792 bytes if packed with upx -9 --ultra-brute (96256 bytes unpacked)!

Best regards,

Elmar

That's odd. I regularly use miniserve on fairly fresh Windows installs and this has not been an issue so far. I will definitely consider adding that flag though but I'd first like to try to recreate the issue, if possible.

I made a PR which should address this. You should be able to download the resulting binaries from the PR directly.

elmkni commented

What's PR? Where can I download the statically linked binary?

elmkni commented

Got it!

Thanks a lot for your efforts, saves me a lot of work in the future!

Best regards,

Elmar

Just to confirm: it works for you as expected?

elmkni commented

Yes, it does!