Skip to main content

anchor_pattern

Function anchor_pattern 

Source
pub fn anchor_pattern(base: &Path, pattern: &str) -> (PathBuf, String)
Expand description

Where pattern’s matches live: base with the pattern’s leading . and .. components applied, and the rest of the pattern, relative to that directory. ../../Dockerfile declared in /repo/contexts/shared anchors at /repo as Dockerfile.

Lexical on purpose: .. names the parent of the directory as the Beamfile spells it, the way its author reads it, not the parent of wherever a symbolic link on the way leads. Every consumer that matches a path against inputs (the cache, affected runs, watch mode) anchors through here, so they cannot disagree about what a pattern names.