Skip to content

Commit

Permalink
Fix path separators
Browse files Browse the repository at this point in the history
  • Loading branch information
ycombinator committed Aug 29, 2023
1 parent 98913e1 commit 7da31ac
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions dev-tools/mage/crossbuild.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,13 @@ func (b GolangCrossBuilder) Build() error {
return errors.Wrap(err, "failed to determine mage-linux-"+builderArch+" relative path")
}

// If we're running this mage target on Windows, the path separator used in
// buildCmd will be `\`. But the buildCmd is executed inside a Linux Docker
// container. So we replace all `\` path separators with `/`.
if GOOS == "windows" {
buildCmd = strings.ReplaceAll(buildCmd, "\\", "/")
}

dockerRun := sh.RunCmd("docker", "run")
image, err := b.ImageSelector(b.Platform)
if err != nil {
Expand Down

0 comments on commit 7da31ac

Please sign in to comment.