-
Notifications
You must be signed in to change notification settings - Fork 177
Conversation
val protocBinary = | ||
if (isMac) | ||
if (aarch_64) "osx-x86_64" | ||
else throw new Exception("mill cannot detect your architecture of your Mac") | ||
else if (isLinux) | ||
if (aarch_64) "linux-aarch_64" | ||
else if (ppcle_64) "linux-ppcle_64" | ||
else if (s390x) "linux-s390x" | ||
else if (x86_32) "linux-x86_32" | ||
else if (x86_64) "linux-x86_64" | ||
else throw new Exception("mill cannot detect your architecture of your Linux") | ||
else if (isWindows) | ||
if (x86_32) "win32" | ||
else if (x86_64) "win64" | ||
else throw new Exception("mill cannot detect your architecture of your Windows") | ||
else throw new Exception("mill cannot detect your operation system.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Support all architecture in protobuf release: https://github.com/protocolbuffers/protobuf/releases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is nicer than using that rando jar to download protoc. I do wish we could share this code between SBT and Mill but oh well 🤷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sequencer @jackkoenig Wait if I read this correctly, if (aarch_64) "osx-x86_64"
says that ARM 64-bit uses x86_64 (?!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not ARM 64-bit, MacOS ARM 64-bit which still supports x86_64 binaries via Rosetta 2. Most projects don't create native binaries for M1 yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That being said, this isn't supporting x86_64 Macs lol so need to fix that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in #2165
Need to apply this to SBT as well which is still using protoc 3.5.1 |
https://github.com/os72/protoc-jar is a third-party repackage of protoc, last update was 13 months ago.
Latest jar was 3.11.4, however current version is 3.15.6 now.
This also fix a bug mentioned in #2160.
This PR fix this, and download binary based on the operation system directly.
Notice this PR is souce incompatible, should not be backported.
Contributor Checklist
Type of Improvement
API Impact
None
Backend Code Generation Impact
None
Desired Merge Strategy
Release Notes
Compile with protoc directly in mill.
Reviewer Checklist (only modified by reviewer)
Please Merge
?