{"action":"closed","issue":{"url":"https://api.github.com/repos/gopherjs/gopherjs/issues/568","repository_url":"https://api.github.com/repos/gopherjs/gopherjs","labels_url":"https://api.github.com/repos/gopherjs/gopherjs/issues/568/labels{/name}","comments_url":"https://api.github.com/repos/gopherjs/gopherjs/issues/568/comments","events_url":"https://api.github.com/repos/gopherjs/gopherjs/issues/568/events","html_url":"https://github.com/gopherjs/gopherjs/issues/568","id":199366913,"number":568,"title":"Caching broken for complex import trees","user":{"login":"flimzy","id":8555063,"avatar_url":"https://avatars.githubusercontent.com/u/8555063?v=3","gravatar_id":"","url":"https://api.github.com/users/flimzy","html_url":"https://github.com/flimzy","followers_url":"https://api.github.com/users/flimzy/followers","following_url":"https://api.github.com/users/flimzy/following{/other_user}","gists_url":"https://api.github.com/users/flimzy/gists{/gist_id}","starred_url":"https://api.github.com/users/flimzy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flimzy/subscriptions","organizations_url":"https://api.github.com/users/flimzy/orgs","repos_url":"https://api.github.com/users/flimzy/repos","events_url":"https://api.github.com/users/flimzy/events{/privacy}","received_events_url":"https://api.github.com/users/flimzy/received_events","type":"User","site_admin":false},"labels":[{"id":53911155,"url":"https://api.github.com/repos/gopherjs/gopherjs/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-01-07T15:21:11Z","updated_at":"2017-01-09T12:07:07Z","closed_at":"2017-01-09T12:07:07Z","body":"On the main GopherJS project I'm working on, I've noticed that caching seems to be broken in a large number of situations. I've resorted to running `rm -rf $GOPATH/pkg/*_js` unconditionally before all my builds, to avoid surprises.\r\n\r\nToday I took the time to find a minimal reproduction case:\r\n\r\n`main.go`:\r\n\r\n    package main\r\n\r\n    import (\r\n    \t\"fmt\"\r\n    \t\"github.com/flimzy/jstest/foo\"\r\n    )\r\n\r\n    func main() {\r\n    \tvar x int\r\n    \tx = foo.Foo()\r\n    \tfmt.Printf(\"x = %d\\n\", x)\r\n    }\r\n\r\n`foo.go`:\r\n\r\n\tpackage foo\r\n\r\n\timport (\r\n\t\t\"github.com/flimzy/jstest/bar\"\r\n\t)\r\n\r\n\tfunc Foo() int {\r\n\t\treturn bar.Bar()\r\n\t}\r\n\r\n\r\n`bar.go`:\r\n\r\n    package bar\r\n\r\n    func Bar() int {\r\n    \treturn 1\r\n    }\r\n\r\n\r\n`gopherjs run` output:\r\n\r\n    $ gopherjs run *.go\r\n    x = 1\r\n\r\nThen edit `bar.go`, and change the return type to anything other than 'int', then run again. I used `int64` in this example, but observed the same* with `string`, `float32`, `uint8`, etc.\r\n\r\n    $ gopherjs run *.go\r\n    x = 0\r\n\r\n*By 'same', I mean no error; the return value is sometimes as expected (i.e. `1` in this case), making the problem harder to detect.\r\n\r\nExpected output:\r\n\r\n    $ gopherjs run *.go\r\n    foo/foo.go:8:9: cannot use bar.Bar() (value of type int64) as int value in return statement\r\n\r\nNote that changing the return type of `foo.Foo()` invalidates the cache as expected."}}
{"actor":{"display_login":"flimzy"}}