4 ms·
No. Cargo does. The `build.rs` is basically a Cargo hook that gets compiled as a Rust program and executed just before the ripgrep binary is compiled. It lets y
by burntsushi 3y ago
No. Cargo does. The `build.rs` is basically a Cargo hook that gets compiled as a Rust program and executed just before the ripgrep binary is compiled. It lets you do things like set linker flags[1] so that you can embed an XML manifest into the binary on Windows to enable "long path support."
ripgrep's build.rs used to do more, like build shell completions and the man page. But that's now part of ripgrep proper. e.g., `rg --generate man` writes roff to stdout.
[1]: https://github.com/BurntSushi/ripgrep/blob/2a4dba3fbfef944c562bcdfa7485fa0f70d4f86f/build.rs#L27-L28 https://github.com/BurntSushi/ripgrep/blob/2a4dba3fbfef944c5...
[2]: https://github.com/BurntSushi/ripgrep/blob/2a4dba3fbfef944c562bcdfa7485fa0f70d4f86f/pkg/windows/Manifest.xml#L25 https://github.com/BurntSushi/ripgrep/blob/2a4dba3fbfef944c5...