Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
elmkni opened this issue Apr 19, 2023 · 7 comments

Comments

@elmkni
Copy link

elmkni commented Apr 19, 2023

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

@svenstaro
Copy link
Owner

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.

@svenstaro
Copy link
Owner

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

@elmkni
Copy link
Author

elmkni commented Apr 20, 2023

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

@svenstaro
Copy link
Owner

If you scroll all the way to the bottom here: https://github.com/svenstaro/miniserve/actions/runs/4759134616?pr=1107

@elmkni
Copy link
Author

elmkni commented Apr 21, 2023

Got it!

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

Best regards,

Elmar

@svenstaro
Copy link
Owner

Just to confirm: it works for you as expected?

@elmkni
Copy link
Author

elmkni commented Apr 21, 2023

Yes, it does!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants