Under which conditions can GlobSetBuilder::build()
error?
#2927
-
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This variant: ripgrep/crates/globset/src/lib.rs Lines 177 to 178 in 4b0e5a1 Specifically, from here: ripgrep/crates/globset/src/lib.rs Lines 292 to 295 in 4b0e5a1 Something to note here is that a ripgrep/crates/globset/src/lib.rs Line 286 in 4b0e5a1 So basically, if your globs combine into one compiled regex that is too big, then this step could fail. Since Unicode handling is generally disabled in this crate, and since the glob syntax doesn't give you access to things that would otherwise make it easy to build huge regexes (like bounded repetitions), you would likely need many globs to blow the size limit. |
Beta Was this translation helpful? Give feedback.
This variant:
ripgrep/crates/globset/src/lib.rs
Lines 177 to 178 in 4b0e5a1
Specifically, from here:
ripgrep/crates/globset/src/lib.rs
Lines 292 to 295 in 4b0e5a1
Something to note here is that a
Glob
itself can't do any matching. Basically, aGlob
is just the result of converting a glob pattern to a regex. That can fail because of invalid glob syntax. But the process of converting aGlob
to aGlobMatcher
(for matching one glob) or manyGlob
s to aGlobSet
(for matching zero or more g…