Skip to content

Unable to rebuild/update playground. #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dmitshur opened this issue Jun 1, 2015 · 5 comments
Closed

Unable to rebuild/update playground. #27

dmitshur opened this issue Jun 1, 2015 · 5 comments

Comments

@dmitshur
Copy link
Member

dmitshur commented Jun 1, 2015

If I'm not mistaken, it seems the playground is in a broken state if one tries to rebuild it. I suspect it's a result of changing importer/exporter in gopherjs/gopherjs@d60db54.

When I rebuild/update the playground using the latest version of GopherJS, I get Uncaught Error: AddInt32 already declared panics when the playground loads.

I was able to get around that temporarily by making the following change to golang.org/x/tools/go/importer package, importer.go file:

if alt := pkg.Scope().Insert(obj); alt != nil {
    //panic(fmt.Sprintf("%s already declared", alt.Name()))
    println(fmt.Sprintf("%s already declared", alt.Name()))
}

That way the playground seems to work, but it does print the above warning quite a few times, seemingly for all exported symbols in sync/atomic and unicode packages (no idea why those specifically).

It is possible I messed something up with the update.sh script since I had to do its steps manually (since my GOROOT is not user-writeable, I have multiple GOPATH workspaces, etc.), but I double checked very carefully so the chance is quite low. I think it's a legitimate issue. I wasn't able to investigate it much further because I'm not very familiar with golang.org/x/tools/go/importer package at this time.

@neelance
Copy link
Member

neelance commented Jun 1, 2015

update.sh works fine for me (except the two paths that you mentioned and which are fixed now). What might be different between our setups?

@dmitshur
Copy link
Member Author

dmitshur commented Jun 1, 2015

update.sh works fine for me (except the two paths that you mentioned and which are fixed now).

Have you tested the Playground?

I'm using latest stable Chrome (Version 43.0.2357.81 (64-bit)) on OS X and it gives me the error I mentioned earlier on load:

image

If I click Run, it gives another error ASCII_Hex_Digit already declared and nothing happens. If I click Run a second time, it seems to execute the snippet code okay.

Is this not happening for you?

@neelance
Copy link
Member

neelance commented Jun 1, 2015

Oh right, I just clicked on "Run" and it seemed to work. I did not check the JS console. Thx for making me aware.

@dmitshur
Copy link
Member Author

Any updates on what the issue could be?

I've tried it again just now, and with the latest packages for everything, the issue still persists and I'm unable to rebuild the playground without it panicking in the console.

image

I was able to get around that temporarily by making the following change to golang.org/x/tools/go/importer package, importer.go file:

if alt := pkg.Scope().Insert(obj); alt != nil {
  //panic(fmt.Sprintf("%s already declared", alt.Name()))
  println(fmt.Sprintf("%s already declared", alt.Name()))
}

That way the playground seems to work, but it does print the above warning quite a few times, seemingly for all exported symbols in sync/atomic and unicode packages (no idea why those specifically).

Any ideas why sync/atomic and unicode packages specifically are getting duplicate symbols?

@dmitshur
Copy link
Member Author

It seems this issue is not completely resolved. See #34.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants