{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/buck/issues/631","labels_url":"https://api.github.com/repos/facebook/buck/issues/631/labels{/name}","comments_url":"https://api.github.com/repos/facebook/buck/issues/631/comments","events_url":"https://api.github.com/repos/facebook/buck/issues/631/events","html_url":"https://github.com/facebook/buck/issues/631","id":128957991,"number":631,"title":"Autodiscovery of Go compiler fails","user":{"login":"nemith","id":349360,"avatar_url":"https://avatars.githubusercontent.com/u/349360?v=3","gravatar_id":"","url":"https://api.github.com/users/nemith","html_url":"https://github.com/nemith","followers_url":"https://api.github.com/users/nemith/followers","following_url":"https://api.github.com/users/nemith/following{/other_user}","gists_url":"https://api.github.com/users/nemith/gists{/gist_id}","starred_url":"https://api.github.com/users/nemith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nemith/subscriptions","organizations_url":"https://api.github.com/users/nemith/orgs","repos_url":"https://api.github.com/users/nemith/repos","events_url":"https://api.github.com/users/nemith/events{/privacy}","received_events_url":"https://api.github.com/users/nemith/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-26T22:09:43Z","updated_at":"2016-01-26T22:12:54Z","closed_at":null,"body":"If i create a sample project using a go_binary on my ubuntu system using all the go defaults build fails trying to find the compiler.\r\n\r\nIt looks like Buck is properly using 'go env GOTOOLDIR' to find the path, but somehow is appending to my current working directory and ignoring the root.\r\n\r\n```\r\n$ buck build //simple_binary:xyzzy                                                                                                                 \r\nNot using buckd because watchman isn't installed.\r\nBUILD FAILED: com.google.common.util.concurrent.UncheckedExecutionException: java.lang.RuntimeException: java.nio.file.NoSuchFileException: /home/bbennett/src/test//usr/lib/go/pkg/tool/linux_amd64\r\n/compile\r\ncom.google.common.util.concurrent.UncheckedExecutionException: com.google.common.util.concurrent.UncheckedExecutionException: java.lang.RuntimeException: java.nio.file.NoSuchFileException: /home/bbennett/src/test//usr/lib/go/pkg/tool/linux_amd64\r\n/compile\r\ncom.google.common.util.concurrent.UncheckedExecutionException: com.google.common.util.concurrent.UncheckedExecutionException: java.lang.RuntimeException: java.nio.file.NoSuchFileException: /home/bbennett/src/test//usr/lib/go/pkg/tool/linux_amd64\r\n/compile\r\n\tat com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2203)\r\n\tat com.google.common.cache.LocalCache.get(LocalCache.java:3937)\r\n\tat com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3941)\r\n\tat com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4824)\r\n\tat com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4830)\r\n\tat com.facebook.buck.rules.keys.DefaultRuleKeyBuilderFactory$2.getAppendableRuleKey(DefaultRuleKeyBuilderFactory.java:70)\r\n\tat com.facebook.buck.rules.RuleKeyBuilder.setAppendableRuleKey(RuleKeyBuilder.java:162)\r\n\tat com.facebook.buck.rules.RuleKeyBuilder.setReflectively(RuleKeyBuilder.java:168)\r\n\tat com.facebook.buck.rules.keys.DefaultAlterRuleKey.amendKey(DefaultAlterRuleKey.java:31)\r\n\tat com.facebook.buck.rules.keys.ReflectiveRuleKeyBuilderFactory.newInstance(ReflectiveRuleKeyBuilderFactory.java:78)\r\n\tat com.facebook.buck.rules.keys.DefaultRuleKeyBuilderFactory.newInstance(DefaultRuleKeyBuilderFactory.java:95)\r\n\tat com.facebook.buck.rules.BuildRuleEvent$Suspended.<init>(BuildRuleEvent.java:167)\r\n\tat com.facebook.buck.rules.BuildRuleEvent.suspended(BuildRuleEvent.java:69)\r\n\tat com.facebook.buck.rules.CachingBuildEngine$11.apply(CachingBuildEngine.java:945)\r\n\tat com.facebook.buck.rules.CachingBuildEngine$11.apply(CachingBuildEngine.java:1)\r\n\tat com.google.common.util.concurrent.Futures$2.apply(Futures.java:760)\r\n\tat com.google.common.util.concurrent.Futures$ChainingListenableFuture.run(Futures.java:906)\r\n\tat com.google.common.util.concurrent.Futures$1$1.run(Futures.java:635)\r\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\r\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\r\n\tat java.lang.Thread.run(Thread.java:745)\r\nCaused by: com.google.common.util.concurrent.UncheckedExecutionException: java.lang.RuntimeException: java.nio.file.NoSuchFileException: /home/bbennett/src/test//usr/lib/go/pkg/tool/linux_amd64\r\n/compile\r\n\tat com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2203)\r\n\tat com.google.common.cache.LocalCache.get(LocalCache.java:3937)\r\n\tat com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3941)\r\n\tat com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4824)\r\n\tat com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4830)\r\n\tat com.facebook.buck.rules.keys.DefaultRuleKeyBuilderFactory$2.getAppendableRuleKey(DefaultRuleKeyBuilderFactory.java:70)\r\n\tat com.facebook.buck.rules.RuleKeyBuilder.setAppendableRuleKey(RuleKeyBuilder.java:162)\r\n\tat com.facebook.buck.rules.RuleKeyBuilder.setReflectively(RuleKeyBuilder.java:168)\r\n\tat com.facebook.buck.rules.RuleKeyBuilder.setReflectively(RuleKeyBuilder.java:181)\r\n\tat com.facebook.buck.rules.CommandTool.appendToRuleKey(CommandTool.java:113)\r\n\tat com.facebook.buck.rules.keys.DefaultRuleKeyBuilderFactory$1.load(DefaultRuleKeyBuilderFactory.java:48)\r\n\tat com.facebook.buck.rules.keys.DefaultRuleKeyBuilderFactory$1.load(DefaultRuleKeyBuilderFactory.java:1)\r\n\tat com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3527)\r\n\tat com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2319)\r\n\tat com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2282)\r\n\tat com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2197)\r\n\t... 20 more\r\nCaused by: java.lang.RuntimeException: java.nio.file.NoSuchFileException: /home/bbennett/src/test//usr/lib/go/pkg/tool/linux_amd64\r\n/compile\r\n\tat com.facebook.buck.rules.HashedFileTool.appendToRuleKey(HashedFileTool.java:50)\r\n\tat com.facebook.buck.rules.keys.DefaultRuleKeyBuilderFactory$1.load(DefaultRuleKeyBuilderFactory.java:48)\r\n\tat com.facebook.buck.rules.keys.DefaultRuleKeyBuilderFactory$1.load(DefaultRuleKeyBuilderFactory.java:1)\r\n\tat com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3527)\r\n\tat com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2319)\r\n\tat com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2282)\r\n\tat com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2197)\r\n\t... 35 more\r\nCaused by: java.nio.file.NoSuchFileException: /home/bbennett/src/test//usr/lib/go/pkg/tool/linux_amd64\r\n/compile\r\n\tat com.facebook.buck.util.cache.StackedFileHashCache.get(StackedFileHashCache.java:73)\r\n\tat com.facebook.buck.rules.RuleKeyBuilder.setPath(RuleKeyBuilder.java:245)\r\n\tat com.facebook.buck.rules.HashedFileTool.appendToRuleKey(HashedFileTool.java:47)\r\n\t... 41 more\r\n\r\n[-] PROCESSING BUCK FILES...FINISHED 0.0s [100%]\r\n[-] DOWNLOADING... (0.00 B/S AVG, TOTAL: 0.00 B, 0 Artifacts)\r\n[-] BUILDING...FINISHED 0.2s [100%] (0/4 JOBS, 0 UPDATED, 0.0% CACHE MISS)\r\n```\r\n\r\n\r\nKey part seems to be here.  Note the two // in the middle and newline before /compile\r\n```\r\n/home/bbennett/src/test//usr/lib/go/pkg/tool/linux_amd64\r\n/compile\r\n```\r\n\r\nIf i specify the linker and compiler in .buckconfig it works fine.\r\n```\r\n$ cat .buckconfig                                                                                                                                              \r\n[go]\r\nlinker=/usr/lib/go/pkg/tool/linux_amd64/link\r\ncompiler=/usr/lib/go/pkg/tool/linux_amd64/compile\r\nroot=/usr/lib/go\r\n$ buck build //simple_binary:xyzzy                                                                                                                 \r\nNot using buckd because watchman isn't installed.\r\n[-] PROCESSING BUCK FILES...FINISHED 0.0s [100%]\r\n[-] DOWNLOADING... (0.00 B/S AVG, TOTAL: 0.00 B, 0 Artifacts)\r\n[-] BUILDING...FINISHED 0.4s [100%] (1/4 JOBS, 0 UPDATED, 0.0% CACHE MISS)\r\n\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/facebook/buck/issues/comments/175257950","html_url":"https://github.com/facebook/buck/issues/631#issuecomment-175257950","issue_url":"https://api.github.com/repos/facebook/buck/issues/631","id":175257950,"user":{"login":"nemith","id":349360,"avatar_url":"https://avatars.githubusercontent.com/u/349360?v=3","gravatar_id":"","url":"https://api.github.com/users/nemith","html_url":"https://github.com/nemith","followers_url":"https://api.github.com/users/nemith/followers","following_url":"https://api.github.com/users/nemith/following{/other_user}","gists_url":"https://api.github.com/users/nemith/gists{/gist_id}","starred_url":"https://api.github.com/users/nemith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nemith/subscriptions","organizations_url":"https://api.github.com/users/nemith/orgs","repos_url":"https://api.github.com/users/nemith/repos","events_url":"https://api.github.com/users/nemith/events{/privacy}","received_events_url":"https://api.github.com/users/nemith/received_events","type":"User","site_admin":false},"created_at":"2016-01-26T22:12:54Z","updated_at":"2016-01-26T22:12:54Z","body":"@mikekap "}}