BERADQ added the bug label to Issue #9615.
BERADQ opened issue #9615:
Test Case
// omit ... linker .define_unknown_imports_as_traps(&component_a) .unwrap(); let ins_a = linker.instantiate_pre(&component_a).unwrap(); let ins_a = ins_a.instantiate(store_a.as_context_mut())?; linker .define_unknown_imports_as_traps(&component_b) .unwrap(); let ins_b = linker.instantiate_pre(&component_b).unwrap(); let ins_b = ins_b.instantiate(store_b.as_context_mut())?;
Steps to Reproduce
- Call the define_unknown_imports_as_traps method multiple times in the same linker.
Expected Results
The method should handle multiple calls without causing duplicate definitions for any module.
Actual Results
The method results in a duplicate definition error for the wasi module.
map entry `wasi:cli/environment@0.2.0` defined twice
Versions and Environment
Wasmtime version or commit: 26.0.1
Operating system: Windows11 22631.4391
Architecture: rustc 1.84.0-nightly (a93c1718c 2024-10-24)
Extra Info
Possible Solutions:
Exclude Specific Entries: Modify the method to exclude specific entries like
wasi
from being redefined.I think it's not a bug at all, but I can't handle it by myself.
BERADQ commented on issue #9615:
allowing_shadowing
makes all shadowing legal, which is not very good.
alexcrichton commented on issue #9615:
Would it be possible to use two linkers here perhaps? We'd ideally prefer to avoid hardcoding WASI-specific names into the linker.
BERADQ commented on issue #9615:
Would it be possible to use two linkers here perhaps? We'd ideally prefer to avoid hardcoding WASI-specific names into the linker.
This approach is somewhat troublesome, but it can completely solve the problem.
BERADQ closed issue #9615:
Test Case
// omit ... linker .define_unknown_imports_as_traps(&component_a) .unwrap(); let ins_a = linker.instantiate_pre(&component_a).unwrap(); let ins_a = ins_a.instantiate(store_a.as_context_mut())?; linker .define_unknown_imports_as_traps(&component_b) .unwrap(); let ins_b = linker.instantiate_pre(&component_b).unwrap(); let ins_b = ins_b.instantiate(store_b.as_context_mut())?;
Steps to Reproduce
- Call the define_unknown_imports_as_traps method multiple times in the same linker.
Expected Results
The method should handle multiple calls without causing duplicate definitions for any module.
Actual Results
The method results in a duplicate definition error for the wasi module.
map entry `wasi:cli/environment@0.2.0` defined twice
Versions and Environment
Wasmtime version or commit: 26.0.1
Operating system: Windows11 22631.4391
Architecture: rustc 1.84.0-nightly (a93c1718c 2024-10-24)
Extra Info
Possible Solutions:
Exclude Specific Entries: Modify the method to exclude specific entries like
wasi
from being redefined.I think it's not a bug at all, but I can't handle it by myself.
Last updated: Nov 22 2024 at 17:03 UTC