-
Notifications
You must be signed in to change notification settings - Fork 570
GopherJS incorrectly uses stale archive files when latest source code fails to build. #559
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
Comments
Thank you for posting detailed reproduce steps, that's very helpful. |
I can reproduce. It also happens with Deleting
Since there's a compilation error, that It appears the problem is something like this. When a built archive file is stale, GopherJS correctly tries to rebuild it. However, if that package fails to build due to errors, it problematically still goes ahead and uses the stale file. This is a bug in the build logic. |
I'm not completely sure this diagnosis is correct. While investigating #568, I added some debugging output to On a per-package basis, the cache is correctly used. Using my example in #568, for instance, after my change to So it seems that because 'foo' was valid at the time it was created, there is no compilation error, and the cached object is used. And because |
For our reference, there may be additional information in the duplicate issue #568. |
#598 (comment) is related too. |
Here's what I think should happen. I'll use original example from this bug report, since I was able to reproduce it earlier. Say you have In reality, As soon as you "edit So, when compiling I haven't looked at your example yet, I just wanted to think this through with the one I tried earlier. |
I suppose it's also possible for |
Uh oh!
There was an error while loading. Please reload this page.
gopherjs serve
and loadalltom/
in your browser.Bar() int
toBar2() int
.impl.MakeFoo().Bar()
toimpl.MakeFoo().Bar2()
.Instead of seeing a compile error about FooImpl no longer implementing Foo, you get a runtime error saying "Uncaught TypeError: impl.MakeFoo(...).Bar2 is not a function". It looks like
gopherjs serve
doesn't realize that impl.go needs to be recompiled.alltom/iface/iface.go
alltom/impl/impl.go
alltom/main.go
The text was updated successfully, but these errors were encountered: