Skip to content

core: don't build decompression reader unless we intend to use it#3181

Merged
BurntSushi merged 1 commit intomasterfrom
ag/skip-binary-resolution-windows
Oct 12, 2025
Merged

core: don't build decompression reader unless we intend to use it#3181
BurntSushi merged 1 commit intomasterfrom
ag/skip-binary-resolution-windows

Conversation

@BurntSushi
Copy link
Owner

Building it can consume resources. In particular, on Windows, the
various binaries are eagerly resolved.

I think this originally wasn't done. The eager resolution was added
later for security purposes. But the "eager" part isn't actually
necessary.

It would probably be better to change the decompression reader to do
lazy resolution only when the binary is needed. But this will at least
avoid doing anything when the -z/--search-zip flag isn't used. But
when it is, ripgrep will still eagerly resolve all possible binaries.

Fixes #2111

Building it can consume resources. In particular, on Windows, the
various binaries are eagerly resolved.

I think this originally wasn't done. The eager resolution was added
later for security purposes. But the "eager" part isn't actually
necessary.

It would probably be better to change the decompression reader to do
lazy resolution only when the binary is needed. But this will at least
avoid doing anything when the `-z/--search-zip` flag isn't used. But
when it is, ripgrep will still eagerly resolve all possible binaries.

Fixes #2111
@BurntSushi BurntSushi merged commit 9164158 into master Oct 12, 2025
21 checks passed
@BurntSushi BurntSushi deleted the ag/skip-binary-resolution-windows branch October 12, 2025 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

decompression binaries are searched for even when they will never be used

1 participant