Diagnostic and cause
LinkPhysical path escapes root
- Family
- topaz
- Phase
- resolve
- Code
TPZ3005
Cause and conditions
An imported source whose canonical physical path lies outside the selected root is rejected with TPZ3005 before its source is loaded.
Related rule: Trigger and repairResponse
Place the source inside the root or choose a root that contains its physical location. Check symbolic-link targets as well as import spellings.
Source evidence
- compiler/crates/topaz_diag/src/explain.rs at
151141d7bb44· 378-386 - compiler/crates/topaz_self_frontend/topaz/resolver/graph.tpz at
151141d7bb44· 581-581 - compiler/crates/topaz_cli/src/package/target.rs at
151141d7bb44· 526-561 - compiler/crates/topaz_self_frontend/topaz/resolver/graph.tpz at
151141d7bb44· 240-249 - compiler/crates/topaz_self_frontend/topaz/resolver/graph.tpz at
151141d7bb44· 736-745 - TPZ3005 at
f42fbeb4f27e - TPZ3005 repair at
151141d7bb44
Compiler phase: resolve.
Compiler explanation: A module resolves through a physical path or symlink outside the module root.
Message templates. The marker ⟨value⟩ stands for text computed for the reported program.
- the entry
⟨value⟩resolves outside the root (symlink/alias containment) Source ⟨value⟩resolves outside the root (symlink/alias containment) Source
The imported path crosses a symbolic link to a physical source outside the selected root. Textual containment of the import path does not admit the target.
Trigger and repair
An imported source whose canonical physical path lies outside the selected root is rejected with TPZ3005 before its source is loaded.
Source evidence
- compiler/crates/topaz_cli/src/package/target.rs at
151141d7bb44· 526-561 - compiler/crates/topaz_self_frontend/topaz/resolver/graph.tpz at
151141d7bb44· 240-249 - compiler/crates/topaz_self_frontend/topaz/resolver/graph.tpz at
151141d7bb44· 736-745 - TPZ3005 at
f42fbeb4f27e - TPZ3005 repair at
151141d7bb44
Response
LinkPlace the source inside the root or choose a root that contains its physical location. Check symbolic-link targets as well as import spellings.
Reproduction and verification
LinkProduct diagnostic test
Linkimport lib
export let value = 1
Expected result
Expected result
The separate diagnostic product test validates this command, runtime diagnostic, or filesystem setup. The shared example runner does not execute that assertion plan.
Prepare the files shown above, then complete this setup.
Create the symbolic link root/ with target .. Keep the link and its target within the same temporary test directory.
Run topaz check root/.
Expect exit status 1, empty standard output, and TPZ3005.
The imported path crosses a symbolic link to a physical source outside the selected root. Textual containment of the import path does not admit the target.
The primary location is root/.
Expect exactly one diagnostic.
The diagnostic product test checks these expectations with the same files and command.
Source evidence
- compiler/crates/topaz_cli/src/package/target.rs at
151141d7bb44· 526-561 - compiler/crates/topaz_self_frontend/topaz/resolver/graph.tpz at
151141d7bb44· 240-249 - compiler/crates/topaz_self_frontend/topaz/resolver/graph.tpz at
151141d7bb44· 736-745 - TPZ3005 at
f42fbeb4f27e - TPZ3005 repair at
151141d7bb44
Corrected program
Linkimport lib
export let value = 1
Expected result
Expected result
Checking accepts the program. Exit code 0.
This program applies the repair described above. The verification status records whether it has been run.
Source evidence
- compiler/crates/topaz_cli/src/package/target.rs at
151141d7bb44· 526-561 - compiler/crates/topaz_self_frontend/topaz/resolver/graph.tpz at
151141d7bb44· 240-249 - compiler/crates/topaz_self_frontend/topaz/resolver/graph.tpz at
151141d7bb44· 736-745 - TPZ3005 at
f42fbeb4f27e - TPZ3005 repair at
151141d7bb44