bat icon indicating copy to clipboard operation
bat copied to clipboard

Update to newer VC version - at least VS 2015

Open rkeithhill opened this issue 2 years ago • 4 comments

With this change, the bat choco install would find vcredist 2015-2019 already installed on most Windows 10 systems.

rkeithhill avatar Mar 06 '22 02:03 rkeithhill

Maybe this could be resolved by switching from windows-2019 to windows-2022?

https://github.com/sharkdp/bat/blob/282b70291f769d2e3526a9ed8d4e76c75681b284/.github/workflows/CICD.yml#L136-L146

https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources

sharkdp avatar Mar 06 '22 19:03 sharkdp

I'm sorry. I didn't realize this was a Rust-based utility. I see on the Rust repo this issue has come up - see:

https://github.com/rust-lang/rust/issues/26258 https://github.com/rust-lang/rfcs/issues/1061 https://github.com/volks73/cargo-wix/issues/115

From this documentation PR it seems you could statically link the CRT on Windows and then there would be no need of the vcredist. I tried this on a simple Rust "hello world" program and it appears to work:

image

The exe size in bytes increased from 148480 (dynamically linked) to 250368 (statically linked) for a debug build. This might be worth exploring.

Also see these docs on Rust and statically linking CRT.

rkeithhill avatar Mar 06 '22 22:03 rkeithhill

Thanks. The other option is to use the GNU toolchain. We also deploy executables which are built using that (bat-v0.20.0-x86_64-pc-windows-gnu.zip). There have been past discussions on this topic on this issue tracker. Might be valuable to summarize those here. I don't remember why we don't switch off the MSVC builds completely.

sharkdp avatar Mar 07 '22 08:03 sharkdp

Thanks. The other option is to use the GNU toolchain. [..] There have been past discussions on this topic on this issue tracker. Might be valuable to summarize those here. I don't remember why we don't switch off the MSVC builds completely.

Switching off MSVC builds? Does this imply that the GNU builds are somehow more robust, or more performant, or something like that?

Hrxn avatar Mar 28 '22 14:03 Hrxn