Stream: git-wasmtime

Topic: wasmtime / issue #9615 Duplicate Definition Error in `def...


view this post on Zulip Wasmtime GitHub notifications bot (Nov 16 2024 at 16:03):

BERADQ added the bug label to Issue #9615.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 16 2024 at 16:04):

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

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.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 16 2024 at 16:11):

BERADQ commented on issue #9615:

allowing_shadowing makes all shadowing legal, which is not very good.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 18 2024 at 16:54):

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.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 18 2024 at 17:06):

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.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 18 2024 at 17:06):

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

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