{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/18678","repository_url":"https://api.github.com/repos/golang/go","labels_url":"https://api.github.com/repos/golang/go/issues/18678/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/18678/comments","events_url":"https://api.github.com/repos/golang/go/issues/18678/events","html_url":"https://github.com/golang/go/issues/18678","id":201154131,"number":18678,"title":"cmd/go: for unset GOROOT, try to derive from os.Executable() before runtime.GOROOT()","user":{"login":"minux","id":135652,"avatar_url":"https://avatars2.githubusercontent.com/u/135652?v=3","gravatar_id":"","url":"https://api.github.com/users/minux","html_url":"https://github.com/minux","followers_url":"https://api.github.com/users/minux/followers","following_url":"https://api.github.com/users/minux/following{/other_user}","gists_url":"https://api.github.com/users/minux/gists{/gist_id}","starred_url":"https://api.github.com/users/minux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minux/subscriptions","organizations_url":"https://api.github.com/users/minux/orgs","repos_url":"https://api.github.com/users/minux/repos","events_url":"https://api.github.com/users/minux/events{/privacy}","received_events_url":"https://api.github.com/users/minux/received_events","type":"User","site_admin":false},"labels":[{"id":246350233,"url":"https://api.github.com/repos/golang/go/labels/Proposal-Accepted","name":"Proposal-Accepted","color":"009800","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/golang/go/milestones/49","html_url":"https://github.com/golang/go/milestone/49","labels_url":"https://api.github.com/repos/golang/go/milestones/49/labels","id":2053058,"number":49,"title":"Go1.9","description":"","creator":{"login":"rsc","id":104030,"avatar_url":"https://avatars2.githubusercontent.com/u/104030?v=3","gravatar_id":"","url":"https://api.github.com/users/rsc","html_url":"https://github.com/rsc","followers_url":"https://api.github.com/users/rsc/followers","following_url":"https://api.github.com/users/rsc/following{/other_user}","gists_url":"https://api.github.com/users/rsc/gists{/gist_id}","starred_url":"https://api.github.com/users/rsc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsc/subscriptions","organizations_url":"https://api.github.com/users/rsc/orgs","repos_url":"https://api.github.com/users/rsc/repos","events_url":"https://api.github.com/users/rsc/events{/privacy}","received_events_url":"https://api.github.com/users/rsc/received_events","type":"User","site_admin":false},"open_issues":507,"closed_issues":382,"state":"open","created_at":"2016-10-06T18:17:55Z","updated_at":"2017-05-12T01:10:33Z","due_on":"2017-07-31T07:00:00Z","closed_at":null},"comments":14,"created_at":"2017-01-17T01:30:55Z","updated_at":"2017-05-12T09:19:18Z","closed_at":"2017-05-04T13:24:41Z","body":"Proposal:\r\n\r\nFor Go 1.9, I'd like to have cmd/go use the new os.Executable APi to find GOROOT automatically. And then we can eliminate all mentions of GOROOT in user facing documents (in fact, we should actively discourage setting GOROOT in user facing documents.)\r\n\r\nIn fact, I'd like to go so far as to display a warning if the $GOROOT setting contradicts with auto-detected one.\r\n\r\nThe proposed GOROOT logic is (error handling omitted):\r\n```\r\n// if the embedded goroot is wrong, then:\r\ngorootAuto = filepath.Dir(filepath.Dir(filepath.EvalSymlinks(os.Executable())))\r\n// issue a warning if gorootAuto is correct (having matching VERSION) and the VERSION file\r\n// is not os.SameFile with $GOROOT/VERSION.\r\n// use $GOROOT if set, otherwise gorootAuto. [*]\r\n```\r\n\r\nPotential problems:\r\n1. hardlinking bin/go to another location.\r\n2. moving bin/go to another location.\r\n\r\nIn both cases, the active fallback step [*] will preserve the current behavior.\r\n\r\n3. distribution changes that don't follow the official GOROOT layout.\r\n\r\nIn this case, the distribution must already carry patches on the go command, so they will have to adapt the patch if this proposal is accepted."},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/301027584","html_url":"https://github.com/golang/go/issues/18678#issuecomment-301027584","issue_url":"https://api.github.com/repos/golang/go/issues/18678","id":301027584,"user":{"login":"egonelbre","id":192964,"avatar_url":"https://avatars2.githubusercontent.com/u/192964?v=3","gravatar_id":"","url":"https://api.github.com/users/egonelbre","html_url":"https://github.com/egonelbre","followers_url":"https://api.github.com/users/egonelbre/followers","following_url":"https://api.github.com/users/egonelbre/following{/other_user}","gists_url":"https://api.github.com/users/egonelbre/gists{/gist_id}","starred_url":"https://api.github.com/users/egonelbre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/egonelbre/subscriptions","organizations_url":"https://api.github.com/users/egonelbre/orgs","repos_url":"https://api.github.com/users/egonelbre/repos","events_url":"https://api.github.com/users/egonelbre/events{/privacy}","received_events_url":"https://api.github.com/users/egonelbre/received_events","type":"User","site_admin":false},"created_at":"2017-05-12T09:19:18Z","updated_at":"2017-05-12T09:19:18Z","body":"I have test failure after CL 42533:\r\n\r\n```\r\n--- FAIL: TestExecutableGOROOT (0.27s)\r\n        go_test.go:3986: C:\\Users\\Egon\\AppData\\Local\\Temp\\gotest815240476\\newgoroot\\bin\\go.exe env GOROOT = \"c:\\\\Go.tip\", want \"C:\\\\Go.tip\"\r\nFAIL\r\nFAIL    cmd/go  134.329s\r\n```\r\n\r\nWindows paths are still case-insensitive (at least usually)."}}
{"actor":{"display_login":"egonelbre"}}