Skip to content

Commit

Permalink
fix alpine
Browse files Browse the repository at this point in the history
  • Loading branch information
steebchen committed Jun 21, 2023
1 parent adec5d7 commit a68a9ce
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
4 changes: 0 additions & 4 deletions binaries/platform/platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ func BinaryPlatformNameDynamic() string {

distro := getLinuxDistro()

if distro == "alpine" {
return fmt.Sprintf("linux-static-%s", arch)
}

ssl := getOpenSSL()

name := fmt.Sprintf("%s-openssl-%s", distro, ssl)
Expand Down
13 changes: 13 additions & 0 deletions generator/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ func generateBinaries(input *Root) error {
logger.Debug.Printf("swapping 'native' binary target with '%s'", name)
}

name = TransformBinaryTarget(name)

// first, ensure they are actually downloaded
if err := binaries.FetchEngine(binaries.GlobalCacheDir(), "query-engine", name); err != nil {
return fmt.Errorf("failed fetching binaries: %w", err)
Expand All @@ -204,6 +206,8 @@ func generateQueryEngineFiles(binaryTargets []string, pkg, outputDir string) err
name = platform.BinaryPlatformNameStatic()
}

name = TransformBinaryTarget(name)

enginePath := binaries.GetEnginePath(binaries.GlobalCacheDir(), "query-engine", name)

filename := fmt.Sprintf("query-engine-%s_gen.go", name)
Expand All @@ -228,3 +232,12 @@ func add(list []string, item string) []string {
}
return list
}

func TransformBinaryTarget(name string) string {
// TODO this is a temp fix as the exact alpine libraries are not working
if name == "linux" || strings.Contains(name, "musl") {
name = "linux-static-x64"
logger.Debug.Printf("overriding binary name with '%s' due to linux or musl", name)
}
return name
}

0 comments on commit a68a9ce

Please sign in to comment.