Diagnostic and cause
LinkModule source is too large
- Family
- topaz
- Phase
- resolve
- Code
TPZ3003
Cause and conditions
An imported file that is not valid UTF-8 produces TPZ3003 at its import path.
Related rule: Trigger and repairResponse
Save the source as valid UTF-8 and make the module file and its containing directories readable. For a size-related failure, split the source into smaller modules.
Source evidence
- compiler/crates/topaz_diag/src/explain.rs at
151141d7bb44· 360-368 - compiler/crates/topaz_self_frontend/topaz/resolver/graph.tpz at
151141d7bb44· 606-606 - compiler/crates/topaz_cli/src/package/target.rs at
151141d7bb44· 454-484 - compiler/crates/topaz_cli/src/package/target.rs at
151141d7bb44· 565-583 - compiler/crates/topaz_self_frontend/topaz/resolver/graph.tpz at
151141d7bb44· 275-299 - compiler/crates/topaz_self_frontend/topaz/resolver/graph.tpz at
151141d7bb44· 758-782 - TPZ3003 at
f42fbeb4f27e - TPZ3003 repair at
151141d7bb44
Compiler phase: resolve.
Compiler explanation: A module source exceeds the compiler's bounded source-map size.
Message templates. The marker ⟨value⟩ stands for text computed for the reported program.
- cannot load entry
⟨value⟩: ⟨value⟩ Source - cannot load entry
⟨value⟩: source is not valid UTF-8 Source - cannot inspect module path for
⟨value⟩: ⟨value⟩ Source
The resolver cannot read a source file or inspect a module directory. Invalid UTF-8 produces this diagnostic as well. The reproduction replaces lib.tpz with the single byte ff.
Trigger and repair
An imported file that is not valid UTF-8 produces TPZ3003 at its import path.
Source evidence
- compiler/crates/topaz_cli/src/package/target.rs at
151141d7bb44· 454-484 - compiler/crates/topaz_cli/src/package/target.rs at
151141d7bb44· 565-583 - compiler/crates/topaz_self_frontend/topaz/resolver/graph.tpz at
151141d7bb44· 275-299 - compiler/crates/topaz_self_frontend/topaz/resolver/graph.tpz at
151141d7bb44· 758-782 - TPZ3003 at
f42fbeb4f27e - TPZ3003 repair at
151141d7bb44
Response
LinkSave the source as valid UTF-8 and make the module file and its containing directories readable. For a size-related failure, split the source into smaller modules.
Reproduction and verification
LinkProduct diagnostic test
Linkimport lib
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.
Write the hexadecimal byte sequence ff to lib..
Run topaz check example..
Expect exit status 1, empty standard output, and TPZ3003.
The resolver cannot read a source file or inspect a module directory. Invalid UTF-8 produces this diagnostic as well. The reproduction replaces lib.tpz with the single byte ff.
The primary location is example..
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· 454-484 - compiler/crates/topaz_cli/src/package/target.rs at
151141d7bb44· 565-583 - compiler/crates/topaz_self_frontend/topaz/resolver/graph.tpz at
151141d7bb44· 275-299 - compiler/crates/topaz_self_frontend/topaz/resolver/graph.tpz at
151141d7bb44· 758-782 - TPZ3003 at
f42fbeb4f27e - TPZ3003 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· 454-484 - compiler/crates/topaz_cli/src/package/target.rs at
151141d7bb44· 565-583 - compiler/crates/topaz_self_frontend/topaz/resolver/graph.tpz at
151141d7bb44· 275-299 - compiler/crates/topaz_self_frontend/topaz/resolver/graph.tpz at
151141d7bb44· 758-782 - TPZ3003 at
f42fbeb4f27e - TPZ3003 repair at
151141d7bb44