Skip to content

Commit

Permalink
fix: python/venv not created properly on debian
Browse files Browse the repository at this point in the history
  • Loading branch information
afterthought authored Feb 18, 2022
1 parent 4ca6203 commit 0a7f423
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/build/build_step.go
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,7 @@ func buildLinksOfType(state *core.BuildState, target *core.BuildTarget, prefix s
srcDir := path.Join(core.RepoRoot, target.OutDir())
for _, out := range target.Outputs() {
if direct {
fs.LinkIfNotExists(path.Join(srcDir, out), destDir, f)
fs.LinkDestination(path.Join(srcDir, out), destDir, f)
} else {
fs.LinkIfNotExists(path.Join(srcDir, out), path.Join(destDir, out), f)
}
Expand Down
14 changes: 14 additions & 0 deletions src/fs/copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,17 @@ func LinkIfNotExists(src, dest string, f LinkFunc) {
return nil
})
}

func LinkDestination(src, dest string, f LinkFunc) {
Walk(src, func(name string, isDir bool) error {
if !isDir {
fullDest := path.Join(dest, name[len(src):])
if err := EnsureDir(fullDest); err != nil {
log.Warning("Failed to create directory for %s: %s", fullDest, err)
} else if err := f(name, fullDest); err != nil && !os.IsExist(err) {
log.Warning("Failed to create %s: %s", fullDest, err)
}
}
return nil
})
}

0 comments on commit 0a7f423

Please sign in to comment.