ruff icon indicating copy to clipboard operation
ruff copied to clipboard

Docs: Microsoft Visual C++ 2015 Redistributable is required on Windows

Open jborbely opened this issue 1 year ago • 2 comments

OS: Windows 10 ruff: version 0.4.4 (installed via pipx)

Issue

ruff.exe silently fails to run from the terminal if Microsoft Visual C++ 2015 Redistributable is not installed.

Running

> ruff --version

does not show the version in the terminal nor is an error shown. Complete silence.

Double-clicking the executable, located at ..\pipx\venvs\ruff\Scripts\ruff.exe, pops-up the following window

vcruntime140-error

Fix

Install Microsoft Visual C++ 2015 Redistributable, then

> ruff --version
ruff 0.4.4

Suggestion

Perhaps adding something to the docs (https://docs.astral.sh/ruff/installation/) for Windows users that Microsoft Visual C++ 2015 Redistributable must be installed. Either provide the download link (https://www.microsoft.com/en-us/download/details.aspx?id=52685) and/or specify the command to run to install it winget install --exact --id Microsoft.VCRedist.2015+.x64

jborbely avatar May 23 '24 00:05 jborbely

Currently Windows builds uses msvc runtime. we can eaither use different runtime (using mingw), or statically link it into binary at link time which causes larger binary.

T-256 avatar May 23 '24 09:05 T-256

Certainly, those additional options would resolve the external VCRUNTIME###.dll dependency issue. I do not have a preference for which option (update docs, use mingw, statically link, ...) the maintainers of ruff decide to go with.

jborbely avatar May 23 '24 20:05 jborbely

@BurntSushi what's your experience with statically linking the CRT on windows? Any drawbacks that you've become aware after shipping the change in ripgrep?

https://github.com/BurntSushi/ripgrep/blob/35160a1cdb4c7e2c370e8a7fad6508ff922a33c2/.cargo/config.toml#L4C8-L8

MichaReiser avatar May 27 '24 15:05 MichaReiser

@BurntSushi what's your experience with statically linking the CRT on windows? Any drawbacks that you've become aware after shipping the change in ripgrep?

https://github.com/BurntSushi/ripgrep/blob/35160a1cdb4c7e2c370e8a7fad6508ff922a33c2/.cargo/config.toml#L4C8-L8

Not that I'm aware of! It's been without incident to the point that I totally forgot that this change even happened. :-)

BurntSushi avatar May 28 '24 12:05 BurntSushi

Also, ripgrep's msvc zip archive size went from ~1.6MB in ripgrep 13 to ~1.9MB in ripgrep 14. So at least in compressed form, the size difference seems tolerable.

BurntSushi avatar May 28 '24 12:05 BurntSushi

Would someone be interested in contributing the change to Ruff? It requires porting the configuration from ripgrep to ruff and doing a quick analysis of the file size change between the two versions (release mode).

MichaReiser avatar May 28 '24 16:05 MichaReiser

Can I take this one?

T-256 avatar May 28 '24 20:05 T-256

Can I take this one?

@T-256 definitely okay with me.

jborbely avatar May 28 '24 20:05 jborbely

Go for it!

charliermarsh avatar May 28 '24 20:05 charliermarsh