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 build to work on Apple M1 machines #1036

Merged
merged 1 commit into from
Feb 13, 2022
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
14 changes: 13 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,19 @@ lazy val zincPersistCore = (project in internalPath / "zinc-persist-core")
exportJars := true,
ProtobufConfig / version := "3.11.4", // sync version w/ plugins.sbt
ProtobufConfig / protobufRunProtoc := { args =>
Protoc.runProtoc(s"-v${(ProtobufConfig / version).value}" +: args.toArray)
// as per https://github.com/os72/protoc-jar/issues/93 , this is needed
// to work around the lack of support for Apple M1 architecture.
// (there is an upstream fix, but as of February 2022 there is no
// protoc-jar release containing the fix)
val workaround =
System.getProperty("os.name") == "Mac OS X" &&
System.getProperty("os.arch") == "aarch64"
try {
if (workaround)
System.setProperty("os.arch", "x86_64")
Protoc.runProtoc(s"-v${(ProtobufConfig / version).value}" +: args.toArray)
} finally if (workaround)
System.setProperty("os.arch", "aarch64")
},
publish / skip := true,
assembly / assemblyShadeRules := Seq(
Expand Down