Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

Don't use protocjar in mill. #2162

Merged
merged 1 commit into from
Mar 30, 2021
Merged

Don't use protocjar in mill. #2162

merged 1 commit into from
Mar 30, 2021

Conversation

sequencer
Copy link
Member

@sequencer sequencer commented Mar 30, 2021

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

  • Did you add Scaladoc to every public function/method?
  • Did you update the FIRRTL spec to include every new feature/behavior?
  • Did you add at least one test demonstrating the PR?
  • Did you delete any extraneous printlns/debugging code?
  • Did you specify the type of improvement?
  • Did you state the API impact?
  • Did you specify the code generation impact?
  • Did you request a desired merge strategy?
  • Did you add text to be included in the Release Notes for this change?

Type of Improvement

  • bug fix

API Impact

None

Backend Code Generation Impact

None

Desired Merge Strategy

  • Rebase: You will rebase the PR onto master and it will be merged with a merge commit.

Release Notes

Compile with protoc directly in mill.

Reviewer Checklist (only modified by reviewer)

  • Did you add the appropriate labels?
  • Did you mark the proper milestone (1.2.x, 1.3.0, 1.4.0) ?
  • Did you review?
  • Did you check whether all relevant Contributor checkboxes have been checked?
  • Did you mark as Please Merge?

Comment on lines +140 to +155
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.")
Copy link
Member Author

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

Copy link
Contributor

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 🤷

Copy link
Contributor

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 (?!)

Copy link
Contributor

@jackkoenig jackkoenig Mar 30, 2021

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.

Copy link
Contributor

@jackkoenig jackkoenig Mar 30, 2021

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in #2165

@sequencer sequencer added this to the 1.5.0 milestone Mar 30, 2021
@jackkoenig
Copy link
Contributor

Need to apply this to SBT as well which is still using protoc 3.5.1

@jackkoenig jackkoenig merged commit 9f6ed17 into master Mar 30, 2021
@jackkoenig jackkoenig mentioned this pull request Mar 30, 2021
11 tasks
@sequencer sequencer deleted the no_more_protoc-jar branch April 29, 2021 04:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants