Skip to content

Commit

Permalink
[crossbuild] Fix path separators (#3310)
Browse files Browse the repository at this point in the history
* Fix path separators

* Use filepath.ToSlash
  • Loading branch information
ycombinator authored Sep 5, 2023
1 parent f65ee06 commit c3dc575
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dev-tools/mage/crossbuild.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,11 @@ func (b GolangCrossBuilder) Build() error {
return fmt.Errorf("failed to determine mage-linux-%s relative path: %w", builderArch, err)
}

// 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 ensure that all path separators are `/`.
buildCmd = filepath.ToSlash(buildCmd)

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

0 comments on commit c3dc575

Please sign in to comment.