Skip to content

Setuid not declared by package syscall #3274

Closed
@tachyonicbytes

Description

@tachyonicbytes

Hello! I am trying to port gau to wasm, using tinygo.

The package compiles fine to wasm with GOOS=js GOARCH=wasm, but I want to use tinygo, in order to get better wasi bindings and be able to use it as is with more wasm runtimes.

The package uses some libraries that are not yet usable with tinygo (fasthttp and json-iterator-go), but I was able to swap them for tinygo/drivers/net/http and encoding/json in my fork, so the compilation problems went away. The code still compiles and works with go, but I ran into tinygo -target=wasi compilation problems that I was not able to resolve.

The main problem now stands at:

tinygo build -o ./build/gau -target=wasi ./cmd/gau/main.go 
# golang.org/x/sys/unix
go/pkg/mod/golang.org/x/[email protected]/unix/syscall_linux.go:1896:17: Setuid not declared by package syscall
go/pkg/mod/golang.org/x/[email protected]/unix/syscall_linux.go:1900:17: Setgid not declared by package syscall
go/pkg/mod/golang.org/x/[email protected]/unix/syscall_linux.go:1904:17: Setreuid not declared by package syscall
go/pkg/mod/golang.org/x/[email protected]/unix/syscall_linux.go:1908:17: Setregid not declared by package syscall
go/pkg/mod/golang.org/x/[email protected]/unix/syscall_linux.go:1912:17: Setresuid not declared by package syscall
go/pkg/mod/golang.org/x/[email protected]/unix/syscall_linux.go:1916:17: Setresgid not declared by package syscall
go/pkg/mod/golang.org/x/[email protected]/unix/syscall_unix.go:524:17: Exec not declared by package syscall

As the code does not use the syscall package directly, I am not sure exactly which is the problematic call, and how to solve it. I looked around in the tinygo github issues and it seems like these kinds of issues have some chance of being solved (#1286).

Is there anyway to make it work for now or it cannot be solved until tinygo supports more of golang? The main idea is that since tinygo/drivers/net/http is supported, and the package itself is basically a http client plus some processing and reporting, I am also not sure exactly which library uses the syscall package. Is there a way to identify this, barring looking into each package itself?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions