PaperMC / paperweight

Gradle build system plugin for Paper and Paper forks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Incompatible with macOS AArch64

nick-botticelli opened this issue · comments

I get the following error with paperweight on the M1 MacBook Air:

> Task :generateReobfMappings FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':generateReobfMappings'.
> Error while evaluating property 'launcher' of task ':generateReobfMappings'
   > Failed to query the value of task ':generateReobfMappings' property 'launcher'.
      > Unable to download toolchain matching these requirements: {languageVersion=16, vendor=ADOPTOPENJDK, 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/16/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

This is because the file at that URL gives the error message {"errorMessage":"No releases match the request"} since there is currently no AArch64 build for AdoptOpenJDK. Currently, I am using Zulu JDK since it does have an AArch64 release.

vendor.set(JvmVendorSpec.ADOPTOPENJDK)

only headache of that line is I question what it does in environments with non-standard JDK, as ideally we wanna prefer adopt when it's available given the headaches non-standard JDKs have given us in the past, but, don't get in the way of those where it's not viable, guess we drop and tell people that it's their issue if they have a non-standard setup? (or, special case for macOS on arm? o.O)

While this does seem to be a problem, it should work fine if you install Java 16 on your system yourself. I'm assuming you either have 11 installed or installed Zulu as you mentioned after the given error.

While this does seem to be a problem, it should work fine if you install Java 16 on your system yourself. I'm assuming you either have 11 installed or installed Zulu as you mentioned after the given error.

I had installed Azul (Zulu) JDK 16 prior to this, so unfortunately until I cloned this repo and manually changed the JvmVendorSpec.ADOPTOPENJDK to JvmVendorSpec.AZUL, I was not able to use paperweight.

maybe we can expose that option somehow

I guess we can just drop it, Gradle should choose a reasonable option available I think. I just threw that in there to make double sure we standardize what everyone is building against, but I hadn't considered that AdoptOpenJDK didn't support Apple Silicon yet.

I think most of us would agree we'd prefer to use adopt though.
So yeah let's check in the build.gradle.kts file, if it's mac & arm, use Zulu. Otherwise, use Adopt. In any case this isn't an issue in paperweight - this can be overridden in Paper: https://github.com/PaperMC/Paper/blob/master/build.gradle.kts#L11-L15

The only difference is we need to change that from being in a subprojects block to allprojects since what paperweight is querying in the link @electronicboy posted is on the root project.

I have the same problem. Is there already a workaround to compile paper (applyPatches) on macOS AArch64?

There is, described in my pervious comment. I will try to push a fix soon if I am able, but not able to promise anything.

Yeah, that would be awesome

The Issue has been fIxed in [eaadb4a]