-
Notifications
You must be signed in to change notification settings - Fork 99
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
Statically link C-runtime for MSVC Windows #221
Conversation
Hm, is this really something we want to specify for the whole project? Maybe it should be limited to the release action. |
The other option would be to use the |
.github/workflows/release.yaml
Outdated
@@ -77,6 +77,8 @@ jobs: | |||
use-cross: ${{ matrix.job.use-cross }} | |||
command: build | |||
args: --release --target ${{ matrix.job.target }} ${{ matrix.job.flags }} | |||
env: | |||
RUSTFLAGS: ${{ matrix.job.os == 'windows-latest' && '-C target-feature=+crt-static' || '' }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I set RUSTFLAGS
in other places as well?
Can you run the release action somewhere for a binary we can test with? |
Sure, I have created https://github.com/ducaale/xh-temp-111 for testing purposes. I'll grant you push access in a moment. |
|
||
- name: Set RUSTFLAGS env variable | ||
if: matrix.job.rustflags | ||
shell: bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless I set shell
to bash
, RUSTFLAGS
will not get passed to cargo in the next step.
Should we perhaps also move LTO from |
I will need to add Edit: I am currently experimenting with
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Unlike v0.14.1 it just works on a clean Windows installation.
On windows, xh requires
VS C++ Runtime Redistributable
to be installed or will fail withThe code execution cannot proceed because VCRUNTIME140.dll was not found
. This PR changes that by statically linking the C-runtime.Also, see BurntSushi/ripgrep#1613
Partially resolves #219