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
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.
What's PR? Where can I download the statically linked binary?
If you scroll all the way to the bottom here: https://github.com/svenstaro/miniserve/actions/runs/4759134616?pr=1107
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?
Yes, it does!