gl icon indicating copy to clipboard operation
gl copied to clipboard

README: stop suggesting GOARCH=js go get since it no longer works

Open tanema opened this issue 6 years ago • 5 comments

I am sorry, this may be very basic but I am trying to use this library and I try to run

GOARCH=js go get -u -d github.com/goxjs/gl/...

I get unsupported GOOS/GOARCH pair darwin/js I have tried a series of pairs like js/js or /js or js/darwin and I get the same message everytime.

Am I doing something wrong? does the library need to be updated?

tanema avatar Feb 11 '19 01:02 tanema

The intention behind that command was to fetch the GopherJS dependencies of gl.

I think the go command has gotten stricter about rejecting unsupported GOOS/GOARCH combinations. In the past, it allowed unsupported ones for the purposes of go get -d, which only downloads code.

I think a workaround is to rely on specifying js as a build tag:

go get -u -d -tags=js github.com/goxjs/gl/...

That should work. I'll have to update the README. Thanks for reporting the problem!

dmitshur avatar Feb 11 '19 07:02 dmitshur

Thanks for the quick response, that definitely sheds like on the problem. I seem to have another problem. I cannot seem to build a project with gopherjs and it might be because it is a module? I can build the goxjs/example projects but I get github.com/go-gl/gl/v2.1/gl: importing "C" is not supported by GopherJS when trying to build my project that is a go module. Any idea why that might be? Could it be that the dependencies are not resolved correctly in a module system?

tanema avatar Feb 11 '19 15:02 tanema

It is related to your project using modules. Unfortunately, the current version of GopherJS on the master branch does not have support for modules yet. This is issue https://github.com/gopherjs/gopherjs/issues/855.

dmitshur avatar Feb 11 '19 16:02 dmitshur

Great as always @dmitshur! Keep kicking butts!

tanema avatar Feb 11 '19 16:02 tanema

I'm glad I was helpful with this. :)

If you don't mind, I'll reopen this issue and use it to update the README with the new instructions.

dmitshur avatar Feb 11 '19 17:02 dmitshur