This makes 'go install cmd/compile' in one directory produce
a different binary from running it in another directory,
which is problematic for reproducible builds.
Change-Id: If26685d2e45d2695413b472142b49694716575fa
Reviewed-on: https://go-review.googlesource.com/74790
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
"cmd/link/internal/sym"
"fmt"
"log"
- "os"
"strings"
)
*/
func getCompilationDir() string {
- if dir, err := os.Getwd(); err == nil {
- return dir
- }
+ // OS X requires this, but it's really none of its business.
+ // Hard-code "/" for reproducible builds.
return "/"
}