runningcode / gradle-doctor

The right prescription for your Gradle build.
http://runningcode.github.io/gradle-doctor
Apache License 2.0
723 stars 46 forks source link

Implement Apple Rosetta translation check #220

Closed GediminasZukas closed 1 year ago

GediminasZukas commented 1 year ago

Solves: https://github.com/runningcode/gradle-doctor/issues/209

Used sysctl.proc_translated API via bash in order to determine if process is running under Rosetta or not according to documentation: https://developer.apple.com/documentation/apple-silicon/about-the-rosetta-translation-environment#Determine-Whether-Your-App-Is-Running-as-a-Translated-Binary

Additional related thought: maybe we need to make this check more generic and compare machine CPU architecture with running JDK target architecture? Something similar to: https://github.com/runningcode/gradle-doctor/issues/209#issuecomment-1132645634 As hardware for Windows or Linux may benefit from ARM architecture in the future as well (maybe already there is some variants in the market).

runningcode commented 1 year ago

Thanks for the ping. Running tests now.

GediminasZukas commented 1 year ago

@runningcode, friendly ping. How we can proceed further with this change?

GediminasZukas commented 1 year ago

Done!

GediminasZukas commented 1 year ago

@runningcode, can we merge this?