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

On Windows MSVC, statically link the C runtime #1613

Closed
wants to merge 1 commit into from
Closed

On Windows MSVC, statically link the C runtime #1613

wants to merge 1 commit into from

Conversation

AustinWise
Copy link
Contributor

Before this change, rg.exe depended on vcruntime140.dll, which does not exist on a fresh install of Windows. The missing DLL prevents rg.exe from starting.

Before this change, rg.exe depended on vcruntime140.dll, which does not
exist on a fresh install of Windows.
@AustinWise
Copy link
Contributor Author

AustinWise commented Jun 9, 2020

There is precedence for using this option. The rg.exe shipped with VS Code is compiled with this option. rustc.exe is compiled with this option too.

@AustinWise
Copy link
Contributor Author

The main downside to this change is it grows the binary size. For x64, it increases 2% from 4.14 MB to 4.24 MB.

@wdscxsj
Copy link

wdscxsj commented Sep 1, 2020

I suppose 0.1 MB is negligible here... An immediately usable binary is much better than having to find and download the venerable Visual C++ Redistributable in emergency.

Copy link
Owner

@BurntSushi BurntSushi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love this, thank you! I'll also update the README which IIRC mentions installing vcruntime or similar.

@BurntSushi BurntSushi added the rollup A PR that has been merged with many others in a rollup. label May 31, 2021
BurntSushi pushed a commit that referenced this pull request May 31, 2021
Before this change, rg.exe depended on vcruntime140.dll, which does not
exist on a fresh install of Windows.

Closes #1613
BurntSushi pushed a commit that referenced this pull request Jun 1, 2021
Before this change, rg.exe depended on vcruntime140.dll, which does not
exist on a fresh install of Windows.

Closes #1613
@BurntSushi BurntSushi closed this in 46d0130 Jun 1, 2021
@AustinWise AustinWise deleted the austin/StaticlyLinkMsvcrt branch February 21, 2022 22:37
vthib added a commit to vthib/boreal that referenced this pull request Dec 3, 2022
vthib added a commit to vthib/boreal that referenced this pull request Dec 4, 2022
vthib added a commit to vthib/boreal that referenced this pull request Dec 4, 2022
vthib added a commit to vthib/boreal that referenced this pull request Dec 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR that has been merged with many others in a rollup.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants