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

Support static builds on ARM #26

Closed
danxmoran opened this issue Dec 2, 2020 · 0 comments · Fixed by #27
Closed

Support static builds on ARM #26

danxmoran opened this issue Dec 2, 2020 · 0 comments · Fixed by #27
Assignees

Comments

@danxmoran
Copy link
Contributor

We're testing a static build of InfluxDB OSS v2 on ARM, and seeing failures from pkg-config. One warning I saw in the build output was:

Unable to determine cargo target. Using the default.	{"target": "linux_arm64_static"}

This is because the logic for determining a cargo target includes cases for ARM, but only for non-static builds:

func (t Target) DetermineCargoTarget(logger *zap.Logger) string {
switch {
case t.OS == "linux" && t.Arch == "amd64" && t.Static:
return "x86_64-unknown-linux-musl"
case t.OS == "linux" && t.Arch == "amd64" && !t.Static:
return "x86_64-unknown-linux-gnu"
case t.OS == "linux" && t.Arch == "386" && !t.Static:
return "i686-unknown-linux-gnu"
case t.OS == "linux" && t.Arch == "arm" && t.Arm == "6" && !t.Static:
return "arm-unknown-linux-gnueabihf"
case t.OS == "linux" && t.Arch == "arm" && t.Arm == "7" && !t.Static:
return "armv7-unknown-linux-gnueabihf"
case t.OS == "linux" && t.Arch == "arm64" && !t.Static:
return "aarch64-unknown-linux-gnu"
case t.OS == "darwin" && t.Arch == "amd64":
return "x86_64-apple-darwin"
case t.OS == "windows" && t.Arch == "amd64":
return "x86_64-pc-windows-gnu"
default:
logger.Warn("Unable to determine cargo target. Using the default.", zap.String("target", t.String()))
return ""
}
}
.

We should add cases for static ARM builds. My best guesses for what those target should be are:

  • ARM64: aarch64-unknown-linux-musl
  • ARM 6: arm-unknown-linux-musleabihf
  • ARM 7: armv7-unknown-linux-musleabihf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant