Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

proposal: Limit support to one GOOS value (primarily for stdlib). #693

Copy link
Copy link
Closed
@dmitshur

Description

@dmitshur
Issue body actions

The GopherJS compiler supports building output only for GOARCH=js value, and any GOOS value.

That means it will produce valid and different output for this Go package, depending on which GOOS value is used:

// +build plan9

package p

const Message = "It was a hot summer..."
// +build !plan9

package p

const Message = "It was a cold winter..."

Of course, it also supports cross-compiling, so one can produce different outputs by doing:

$ GOOS=plan9 gopherjs build
# hot summer

$ GOOS=solaris gopherjs build
# cold winter

I propose we limit support to just a single fixed GOOS value.

This is primarily meant to apply to the Go standard library, which we must manually apply overrides for in order to get it to build and work correctly for GOARCH=js. See https://github.com/gopherjs/gopherjs/commits/master/compiler/natives/src. However, I think we should apply for all packages for simplicity/consistency. Applying the limit to just Go stdlib but not 3rd party packages would be weird and unnecessary.

The motivation is simple. It costs a lot of developer time to support Go standard library for GopherJS. Right now, I don't think this project can afford to continue to support all GOOS values. It's an open source project, with no funding, and most of the progress is made by volunteers contributing in their spare time in after work hours.

The value gained from supporting multiple GOOS values is small. The cost is prohibitively high.

The compiler will continue to be able to (theoretically) compile for many GOOS values, we're just not going to support GOOS values other than a single one that we pick.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.