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

[build] Support Apple ARM64 Silicon (M1) #608

Closed
2 of 4 tasks
kensipe opened this issue Dec 15, 2021 · 6 comments
Closed
2 of 4 tasks

[build] Support Apple ARM64 Silicon (M1) #608

kensipe opened this issue Dec 15, 2021 · 6 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@kensipe
Copy link

kensipe commented Dec 15, 2021

Builds on Apple M1 machines fail based on lack of dependency support.

* What went wrong:
Execution failed for task ':jreleaser-tool-provider:compileJava'.
> Failed to calculate the value of task ':jreleaser-tool-provider:compileJava' property 'javaCompiler'.
   > Unable to download toolchain matching these requirements: {languageVersion=9, 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/9/ga/mac/aarch64/jdk/hotspot/normal/adoptopenjdk' as it does not exist.

Task List

  • Steps to reproduce provided
  • Stacktrace (if present) provided
  • Example that reproduces the problem (link to git repository is ideal)
  • Full description of the issue provided (see below)

Steps to Reproduce

  1. Buy an Apple MBP Pro / Max with Apple Silicon instead of your car or child's first year of tuition in college
  2. Setup with Java 11 (support via Azul is pretty awesome: https://www.azul.com/downloads/?version=java-11-lts&os=macos&architecture=arm-64-bit&package=jdk)
  3. Build: ./gradlew test

Expected Behaviour

Successful build

Actual Behaviour

Bad things

Environment Information

  • Operating System: Mac OS Monterey 12.0.1
  • JReleaser Version: Tip of Main
  • JDK Version: Azul JDK 11

Please paste stacktraces from [out|build|target]/jreleaser/trace.log.

@kensipe kensipe added the bug Something isn't working label Dec 15, 2021
@kensipe
Copy link
Author

kensipe commented Dec 15, 2021

This is likely an upstream issue to resolve... Adding for awareness and prioritization.

@aalmiray
Copy link
Member

@kensipe this is a problem when building JReleaser from source. The build requires Gradle 6.9 which is setup to work with Java 8 up to 15.

Do you need an osx-aarch64 build? we have one for the CLI ready for testing https://github.com/jreleaser/jreleaser/releases/tag/early-access

@aalmiray
Copy link
Member

I see where the problem may be

tasks.withType(JavaCompile) { JavaCompile c ->
c.sourceCompatibility = JavaVersion.VERSION_1_9
c.targetCompatibility = JavaVersion.VERSION_1_9
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(9)
}
}

This instructs Gradle to download Java 9 which uses AdoptOpenJDK by default. Perhaps it will be better to switch to Java 11 compatibility and use Azul as vendor.

@aalmiray aalmiray self-assigned this Dec 15, 2021
@aalmiray aalmiray added this to the 0.10.0 milestone Dec 15, 2021
@aalmiray aalmiray changed the title Support Apple ARM64 Silicon (M1) [build] Support Apple ARM64 Silicon (M1) Dec 15, 2021
@aalmiray
Copy link
Member

Update: 4362c41

@kensipe
Copy link
Author

kensipe commented Dec 16, 2021

great turn around! I was planning on jumping on the contribution train and was looking for a way to build it. But I also wanted to use the new Mac... thank you! that fix was too easy... no I hang my head in shame :) Great stuff! thanks again.

@aalmiray
Copy link
Member

Thanks @kensipe, we've got plenty of opportunities for contributions. Specifically M1 support would be great given that I've yet to get my hands on one of those puppies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants