Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use unix path separator since windows path already normalized #4825

Merged
merged 1 commit into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions frontend/dockerfile/dockerfile2llb/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -1138,10 +1138,6 @@ func dispatchCopy(d *dispatchState, cfg copyConfig) error {
return err
}

if cfg.params.DestPath == "." || cfg.params.DestPath == "" || cfg.params.DestPath[len(cfg.params.DestPath)-1] == filepath.Separator {
dest += string(filepath.Separator)
}

var copyOpt []llb.CopyOption

if cfg.chown != "" {
Expand Down Expand Up @@ -1562,9 +1558,9 @@ func pathRelativeToWorkingDir(s llb.State, p string, platform ocispecs.Platform)
}

if system.IsAbs(p, platform.OS) {
return system.NormalizePath("/", p, platform.OS, false)
return system.NormalizePath("/", p, platform.OS, true)
}
return system.NormalizePath(dir, p, platform.OS, false)
return system.NormalizePath(dir, p, platform.OS, true)
}

func addEnv(env []string, k, v string) []string {
Expand Down
2 changes: 1 addition & 1 deletion solver/llbsolver/file/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func docopy(ctx context.Context, src, dest string, action pb.FileActionCopy, u *
}
destPath, err := cleanPath(action.Dest)
if err != nil {
return errors.Wrap(err, "cleaning path")
return errors.Wrap(err, "cleaning destination path")
}
if !action.CreateDestPath {
p, err := fs.RootPath(dest, filepath.Join("/", action.Dest))
Expand Down