The main package contains no worlds
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 38/100
Research direction
Start with the reproduction linked in the issue and the go tool wit-bindgen-go generate --out internal ./wit command. Then inspect wit/bindgen/generator.go around line 2416, where witText is assembled. Done means generated WIT has a valid main package with a world and the command no longer reports that the package contains no worlds.
Written by the indexing model from the issue text.
Description
I'm encountering behavior that I don't understand in the latest version of wit-bindgen-go.
I've created a detailed reproduction and summary here
Here's a brief summary:
When I run go tool wit-bindgen-go generate --out internal ./wit I get the following output:
Generated WIT for custom section:
package wasi:clocks@0.2.0;
interface wall-clock {
/// A time and date in seconds plus nanoseconds.
record datetime {
seconds: u64,
nanoseconds: u32,
}
now: func() -> datetime;
resolution: func() -> datetime;
}
package wasi:filesystem@0.2.0 {
...
}
package wasi:io@0.2.0 {
...
}
error: wasm-tools: error: The main package `wasi:clocks@0.2.0` contains no worlds
Something I noticed in the output: Both the filesystem package and the io package enclose their interfaces with brackets, while the clocks package ends with a semicolon and its corresponding interface is placed below it:
package wasi:clocks@0.2.0;
<INTERFACES>
package wasi:filesystem@0.2.0 {
<INTERFACES>
}
package wasi:io@0.2.0 {
<INTERFACES>
}
I tried manually creating the wasi:clocks package in a WIT file and tried inserting the file data in place of the witText variable here; however, it then complains about not having a package header:
error: wasm-tools: error: no `package` header was found in any WIT file for this package
If I try to add a generic package header, we get another "package contains no worlds" error:
error: wasm-tools: error: The main package `foo:bar@0.0.0` contains no worlds
- Dominant language
- Go
- Stars
- 148
- Forks
- 20
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from bytecodealliance/go-modules
-
Difficulty 2/5 1-3 hours Newbie friendliness 48/100
bytecodealliance/go-modules#428 · 1 reaction ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
bytecodealliance/go-modules#411 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
bytecodealliance/go-modules#410 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
bytecodealliance/go-modules#394 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 38/100
bytecodealliance/go-modules#371 · 3 comments ·
All issues in bytecodealliance/go-modules
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
-
enhancement needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
kind/cleanup
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
kubernetes-sigs/kueue#15947 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sympozium-ai/sympozium#627 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100