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

Add support for Apple M1 #235

Closed
wangjia184 opened this issue Mar 13, 2021 · 5 comments
Closed

Add support for Apple M1 #235

wangjia184 opened this issue Mar 13, 2021 · 5 comments

Comments

@wangjia184
Copy link

I tried both version 0.99 and 1.0

Also I tried to configure local protoc

// Use a locally provided protoc (in 1.x):
PB.protocExecutable := file("/Users/jerry/protoc-3.11.4-osx-aarch_64.exe")

// For sbt-protoc < 1.0 only:
PB.runProtoc := (args => Process("/Users/jerry/protoc-3.11.4-osx-aarch_64.exe", args)!)

Can it be fixed?

[error] java.lang.RuntimeException: error occurred while compiling protobuf files: Unsupported platform: protoc-3.11.4-osx-aarch_64.exe
[error] 	at sbtprotoc.ProtocPlugin$.executeProtoc(ProtocPlugin.scala:293)
[error] 	at sbtprotoc.ProtocPlugin$.compile(ProtocPlugin.scala:341)
[error] 	at sbtprotoc.ProtocPlugin$.compileProto$1(ProtocPlugin.scala:431)
[error] 	at sbtprotoc.ProtocPlugin$.$anonfun$sourceGeneratorTask$10(ProtocPlugin.scala:438)
[error] 	at sbt.util.FileFunction$.$anonfun$cached$1(FileFunction.scala:73)
[error] 	at sbt.util.FileFunction$.$anonfun$cached$4(FileFunction.scala:146)
[error] 	at sbt.util.Difference.apply(Tracked.scala:323)
[error] 	at sbt.util.Difference.apply(Tracked.scala:303)
[error] 	at sbt.util.FileFunction$.$anonfun$cached$3(FileFunction.scala:142)
[error] 	at sbt.util.Difference.apply(Tracked.scala:323)
[error] 	at sbt.util.Difference.apply(Tracked.scala:298)
[error] 	at sbt.util.FileFunction$.$anonfun$cached$2(FileFunction.scala:141)
[error] 	at sbtprotoc.ProtocPlugin$.$anonfun$sourceGeneratorTask$4(ProtocPlugin.scala:443)
[error] 	at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error] 	at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
[error] 	at sbt.std.Transform$$anon$4.work(Transform.scala:67)
[error] 	at sbt.Execute.$anonfun$submit$2(Execute.scala:281)
[error] 	at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:19)
[error] 	at sbt.Execute.work(Execute.scala:290)
[error] 	at sbt.Execute.$anonfun$submit$1(Execute.scala:281)
[error] 	at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
[error] 	at sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
[error] 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error] 	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
[error] 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error] 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
[error] 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
[error] 	at java.base/java.lang.Thread.run(Thread.java:831)

Neither works on Mac OS M1 ARM64

@thesamet
Copy link
Owner

Closing as duplicate of scalapb/ScalaPB/issues/1024

@thesamet thesamet reopened this Mar 13, 2021
@thesamet
Copy link
Owner

Re-opening since a locally provided protoc should work. Given the error message you are seeing, it looks like PB.protocExecutable is being ignored. Can you provide a full build.sbt?

@wangjia184
Copy link
Author

Hi @thesamet
build.sbt file is basing on here: https://github.com/rchain/rchain/blob/dev/build.sbt

but I tried the following code and it does not work, although they are not commited

// Use a locally provided protoc (in 1.x):
PB.protocExecutable := file("/Users/jerry/protoc-3.11.4-osx-aarch_64.exe")

// For sbt-protoc < 1.0 only:
PB.runProtoc := (args => Process("/Users/jerry/protoc-3.11.4-osx-aarch_64.exe", args)!)

@thesamet
Copy link
Owner

@wangjia184 - let's try making it work on a sample project first. Can you try

sbt new scalapb/scalapb-template.g8

and then make the modifications in build.sbt?

@thesamet
Copy link
Owner

Closing due to inactivity. I believe a locally compiled protoc should work.

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

No branches or pull requests

2 participants