ripgrep icon indicating copy to clipboard operation
ripgrep copied to clipboard

pkg: embed windows manifest to support long file paths if enabled

Open thargor opened this issue 2 years ago • 5 comments

fixes #364

Implementation is based on https://gal.hagever.com/posts/windows-long-paths-in-rust/ .

This still requires long file paths to be enabled in the windows registry.

thargor avatar Nov 04 '21 12:11 thargor

this is also what https://github.com/nabijaczleweli/cargo-update is using

thargor avatar Nov 04 '21 12:11 thargor

Works fine for me with the registry key LongPathsEnabled set to 1.

SimplyDanny avatar Nov 18 '21 17:11 SimplyDanny

@BurntSushi @SimplyDanny thank you for your feedback!

Would an implementation based on https://crates.io/crates/windres (which is based on https://crates.io/crates/find-winsdk ) be acceptable for ripgrep?

thargor avatar Nov 18 '21 21:11 thargor

As long as there's nothing written by Jonathan Blow in the dependency tree, the licenses are compatible and the crates are decently maintained. Remember, once this gets added to ripgrep, it's forever mine to maintain, evev if the dependencies go defunct.

So in short: probably, but I'll still need to do a review if a PR comes in.

BurntSushi avatar Nov 18 '21 21:11 BurntSushi

For anyone interested in long path support: Stumbled over this recent pull request for rustc which adds a similar manifest file to the rustc executable. It apparently works for the *-msvc target by using a build script without external libraries.

t-rapp avatar Jun 09 '22 13:06 t-rapp

@ChrisDenton what are your thoughts on this PR? Is this the right way to support long paths on Windows?

BurntSushi avatar Jul 08 '23 14:07 BurntSushi

Yep. I'd be minded to append .xml to the file name to make github happy. And while an xml declaration (<?xml ...) isn't strictly necessary, it can make other tools happy. Also linking to the docs would make sense.

My only quibble is that it's a lot of dependencies for what can be a couple of lines in a build script (plus a few more lines to apply it conditionally). Though unfortunately windows-gnu does not support this.

ChrisDenton avatar Jul 08 '23 15:07 ChrisDenton

@ChrisDenton Oh yessss! Thank you for that link. I will do what you did for rustc. That looks much better.

BurntSushi avatar Jul 08 '23 17:07 BurntSushi