Skip to content

Commit

Permalink
Force DEV=0 when cross compiling for darwin/amd64.
Browse files Browse the repository at this point in the history
  • Loading branch information
cmacknz committed Jul 8, 2022
1 parent 14929ce commit 420c9e4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion dev-tools/mage/crossbuild.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,13 +311,19 @@ func (b GolangCrossBuilder) Build() error {
args = append(args, "-v", hostDir+":/go/pkg/mod:ro")
}

if b.Platform == "darwin/amd64" {
fmt.Printf(">> %v: Forcing DEV=0 for %s: https://github.com/elastic/golang-crossbuild/issues/217\n", b.Target, b.Platform)
args = append(args, "--env", "DEV=0")
} else {
args = append(args, "--env", fmt.Sprintf("DEV=%v", DevBuild))
}

args = append(args,
"--rm",
"--env", "GOFLAGS=-mod=readonly",
"--env", "MAGEFILE_VERBOSE="+verbose,
"--env", "MAGEFILE_TIMEOUT="+EnvOr("MAGEFILE_TIMEOUT", ""),
"--env", fmt.Sprintf("SNAPSHOT=%v", Snapshot),
"--env", fmt.Sprintf("DEV=%v", DevBuild),
"-v", repoInfo.RootDir+":"+mountPoint,
"-w", workDir,
image,
Expand Down

0 comments on commit 420c9e4

Please sign in to comment.