Skip to content

GOOS=wasip1 support #2911

Closed as not planned
Closed as not planned
@mymmrac

Description

@mymmrac

Operating System

  • Windows
  • macOS
  • Linux
  • FreeBSD
  • OpenBSD
  • Android
  • iOS
  • Nintendo Switch
  • PlayStation 5
  • Xbox
  • Web Browsers

What feature would you like to be added?

Support for builds for WASI (GOOS=wasip1 GOARCH=wasm)

Sine Go 1.21 it supports WASI, it would be nice to be able to use at least Ebiten's constants inside WASI

I know that implementing full Ebiten support in WASI might be really complicated (or most likely impossible due to WASI limitations), but it would be great to at least partially support it

Why is this needed?

I am right now playing with WASI & Ebiten and I got working "mod" system using WASI, but Ebiten can't be build for wasip1

Example:

package main

import (
	"fmt"

	"github.com/hajimehoshi/ebiten/v2"
)

func main() {
	fmt.Println(ebiten.KeyA)
}

Build:

$ GOOS=wasip1 GOARCH=wasm go build .

package mod
        imports github.com/hajimehoshi/ebiten/v2
        imports github.com/hajimehoshi/ebiten/v2/internal/ui
        imports github.com/hajimehoshi/ebiten/v2/internal/devicescale
        imports github.com/hajimehoshi/ebiten/v2/internal/glfw
        imports github.com/hajimehoshi/ebiten/v2/internal/cglfw: build constraints exclude all Go files in /home/mymmrac/.go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/internal/cglfw
$ GOOS=js GOARCH=wasm go build .

(builds fine)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions