Diagnostic and cause
СсылкаPhysical path escapes root
- Семейство
- topaz
- Этап
- resolve
- Код
TPZ3005
Причина и условия
An imported source whose canonical physical path lies outside the selected root is rejected with TPZ3005 before its source is loaded.
Связанное правило · Trigger and repair →Действия
Place the source inside the root or choose a root that contains its physical location. Check symbolic-link targets as well as import spellings.
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.
Response
СсылкаPlace 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
СсылкаProduct diagnostic test
Ссылкаimport lib
export let value = 1
Ожидаемый результат
Ожидаемый результат
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.
Corrected program
Ссылкаimport lib
export let value = 1
Ожидаемый результат
Ожидаемый результат
Проверка принимает программу. Код завершения 0.
This program applies the repair described above. The verification status records whether it has been run.