ripgrep
ripgrep copied to clipboard
pkg: embed windows manifest to support long file paths if enabled
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.
this is also what https://github.com/nabijaczleweli/cargo-update is using
Works fine for me with the registry key LongPathsEnabled
set to 1.
@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?
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.
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.
@ChrisDenton what are your thoughts on this PR? Is this the right way to support long paths on Windows?
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 Oh yessss! Thank you for that link. I will do what you did for rustc
. That looks much better.