google / prefab

Prefab is a tool for generating build system integrations for prebuilt C/C++ libraries.
https://google.github.io/prefab/
Apache License 2.0
210 stars 32 forks source link

[FR] Request ability to build prefab on apple silicon: fail to get a suitable JDK #166

Closed dneto0 closed 1 year ago

dneto0 commented 1 year ago

Is your feature request related to a problem? Please describe. I can't build prefab on Apple silicon.

this is the output I get:

$ ./gradlew installDist
Starting a Gradle Daemon, 2 incompatible Daemons could not be reused, use --status for details

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':cli:installDist'.
> Could not resolve all dependencies for configuration ':cli:runtimeClasspath'.
   > Failed to calculate the value of task ':cli:compileJava' property 'javaCompiler'.
      > Unable to download toolchain matching these requirements: {languageVersion=8, vendor=any, implementation=vendor-specific}
         > Unable to download toolchain. This might indicate that the combination (version, architecture, release/early access, ...) for the requested JDK is not available.
            > Could not read 'https://api.adoptopenjdk.net/v3/binary/latest/8/ga/mac/aarch64/jdk/hotspot/normal/adoptopenjdk' as it does not exist.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 4s

I have tried with various JDK versions, including openjdk 20.0.1 installed via "brew install openjdk"

Describe the solution you'd like I'd like the build to work.

Describe alternatives you've considered I have tried building with openjdk installed via "brew install openjdk"

Additional context

Seems to be the similar to https://youtrack.jetbrains.com/issue/KTIJ-24695/Default-Kotlin-project-can-not-be-synced-on-Mac-M1 and maybe also https://youtrack.jetbrains.com/issue/KTIJ-25475/Up-kotlin-jvmToolchain-to-11-and-higher-only-for-aarch64

DanAlbert commented 1 year ago

Can cherry-pick https://github.com/google/prefab/pull/167 if you want the fix before someone has a chance to review.