|
@@ -243,7 +243,7 @@ func doInstall(cmdline []string) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Configure C compiler.
|
|
// Configure C compiler.
|
|
|
- if *cc == "" {
|
|
|
|
|
|
|
+ if *cc != "" {
|
|
|
gobuild.Env = append(gobuild.Env, "CC="+*cc)
|
|
gobuild.Env = append(gobuild.Env, "CC="+*cc)
|
|
|
} else if os.Getenv("CC") != "" {
|
|
} else if os.Getenv("CC") != "" {
|
|
|
gobuild.Env = append(gobuild.Env, "CC="+os.Getenv("CC"))
|
|
gobuild.Env = append(gobuild.Env, "CC="+os.Getenv("CC"))
|
|
@@ -259,6 +259,9 @@ func doInstall(cmdline []string) {
|
|
|
// Put the default settings in.
|
|
// Put the default settings in.
|
|
|
gobuild.Args = append(gobuild.Args, buildFlags(env)...)
|
|
gobuild.Args = append(gobuild.Args, buildFlags(env)...)
|
|
|
|
|
|
|
|
|
|
+ // We use -trimpath to avoid leaking local paths into the built executables.
|
|
|
|
|
+ gobuild.Args = append(gobuild.Args, "-trimpath")
|
|
|
|
|
+
|
|
|
// Show packages during build.
|
|
// Show packages during build.
|
|
|
gobuild.Args = append(gobuild.Args, "-v")
|
|
gobuild.Args = append(gobuild.Args, "-v")
|
|
|
|
|
|
|
@@ -294,8 +297,6 @@ func buildFlags(env build.Environment) (flags []string) {
|
|
|
if len(ld) > 0 {
|
|
if len(ld) > 0 {
|
|
|
flags = append(flags, "-ldflags", strings.Join(ld, " "))
|
|
flags = append(flags, "-ldflags", strings.Join(ld, " "))
|
|
|
}
|
|
}
|
|
|
- // We use -trimpath to avoid leaking local paths into the built executables.
|
|
|
|
|
- flags = append(flags, "-trimpath")
|
|
|
|
|
return flags
|
|
return flags
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -318,6 +319,7 @@ func localGoTool(goroot string, subcmd string, args ...string) *exec.Cmd {
|
|
|
|
|
|
|
|
// goToolSetEnv forwards the build environment to the go tool.
|
|
// goToolSetEnv forwards the build environment to the go tool.
|
|
|
func goToolSetEnv(cmd *exec.Cmd) {
|
|
func goToolSetEnv(cmd *exec.Cmd) {
|
|
|
|
|
+ cmd.Env = append(cmd.Env, "GOBIN="+GOBIN)
|
|
|
for _, e := range os.Environ() {
|
|
for _, e := range os.Environ() {
|
|
|
if strings.HasPrefix(e, "GOBIN=") || strings.HasPrefix(e, "CC=") {
|
|
if strings.HasPrefix(e, "GOBIN=") || strings.HasPrefix(e, "CC=") {
|
|
|
continue
|
|
continue
|
|
@@ -514,7 +516,7 @@ func doDebianSource(cmdline []string) {
|
|
|
gobundle := downloadGoSources(*cachedir)
|
|
gobundle := downloadGoSources(*cachedir)
|
|
|
|
|
|
|
|
// Download all the dependencies needed to build the sources and run the ci script
|
|
// Download all the dependencies needed to build the sources and run the ci script
|
|
|
- srcdepfetch := goTool("install", "-n", "./...")
|
|
|
|
|
|
|
+ srcdepfetch := goTool("mod", "download")
|
|
|
srcdepfetch.Env = append(os.Environ(), "GOPATH="+filepath.Join(*workdir, "modgopath"))
|
|
srcdepfetch.Env = append(os.Environ(), "GOPATH="+filepath.Join(*workdir, "modgopath"))
|
|
|
build.MustRun(srcdepfetch)
|
|
build.MustRun(srcdepfetch)
|
|
|
|
|
|