Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

The main package contains no worlds

Đang mở
#377 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
38/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
go, wasm
Lĩnh vực
compilers, tooling

Hướng nghiên cứu

Bắt đầu với bản tái hiện được liên kết trong issue và lệnh go tool wit-bindgen-go generate --out internal ./wit. Sau đó kiểm tra wit/bindgen/generator.go quanh dòng 2416, nơi witText được tạo. Được xem là hoàn tất khi WIT được tạo có một package chính hợp lệ với một world và lệnh không còn báo rằng package không chứa worlds.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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:[email protected];

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:[email protected] {
...
}

package wasi:[email protected] {
...
}

error: wasm-tools: error: The main package `wasi:[email protected]` 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:[email protected];
<INTERFACES>

package wasi:[email protected] {
    <INTERFACES>
}

package wasi:[email protected] {
    <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:[email protected]` contains no worlds
Ngôn ngữ chính
Go
Star
148
Fork
20
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của bytecodealliance/go-modules

Tất cả issue của bytecodealliance/go-modules

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.