Skip to content
Merged
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
22 changes: 20 additions & 2 deletions magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -1333,7 +1333,7 @@ func collectPackageDependencies(platforms []string, packageVersion string, packa
}
}
} else {
archivePath = movePackagesToArchive(dropPath, platforms, packageVersion, nil)
archivePath = movePackagesToArchive(dropPath, platforms, packageVersion, dependencies)
Comment thread
pkoutsovasilis marked this conversation as resolved.
}
return archivePath, dropPath
}
Expand Down Expand Up @@ -1875,7 +1875,10 @@ func movePackagesToArchive(dropPath string, platforms []string, packageVersion s
}

// Platform-independent packages need to be placed in the archive sub-folders for all platforms, copy instead of moving
if isPlatformIndependentPackage(f, packageVersion, nil) {
if isPlatformIndependentPackage(f, packageVersion, dependencies) {
if mg.Verbose() {
log.Printf("copying %s to %s as it is a platform independent package", f, packageVersion)
}
if err := copyFile(f, targetPath); err != nil {
panic(fmt.Errorf("failed copying file: %w", err))
}
Expand Down Expand Up @@ -1922,13 +1925,28 @@ func copyFile(src, dst string) error {

func isPlatformIndependentPackage(f string, packageVersion string, dependencies []packaging.BinarySpec) bool {
fileBaseName := filepath.Base(f)
if mg.Verbose() {
log.Printf("isPlatformIndependentPackage(%s, %s, %v)", f, packageVersion, dependencies)
}
for _, spec := range dependencies {
if mg.Verbose() {
log.Printf("evaluating if %s is a platform independent package", f)
}
packageName := spec.GetPackageName(packageVersion, "")
// as of now only python wheels packages are platform-independent
if mg.Verbose() {
log.Printf("checking expected package name %s against actual file name %s", packageName, fileBaseName)
}
if spec.PythonWheel && (fileBaseName == packageName || fileBaseName == packageName+sha512FileExt) {
if mg.Verbose() {
log.Printf("%s is a platform independent package", f)
}
return true
}
}
if mg.Verbose() {
log.Printf("%s is NOT a platform independent package", f)
}
return false
}

Expand Down