Add Apple Silicon build workaround#131
Open
chrisrueger wants to merge 1 commit into
Open
Conversation
Document a local workaround for building on MacOS Apple Silicon and add a Gradle flag to enable it. README.md shows running ./gradlew -Pfreemarker.skipJavaMRJSourceSets=true jar to avoid MR-JAR toolchain errors when JDK9/16 are unavailable. build.gradle.kts adds the skipJavaMRJSourceSets property, conditionally omits configuring the core9/core16 MR-JAR source sets, and updates the Eclipse classpath assembly to avoid referencing those configurations when skipped.
bae00b7 to
83bf98e
Compare
Contributor
|
But then the resulting jar won't support the Java 9 and 16 features (will miss What if instead you add an option to use Java 11 instead of 9, and Java 17 instead of 16? Maybe those Java version are available for Mac. In principle all you have to do is replacing the 2nd argument to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a local-only hack / workaround for building on MacOS Apple Silicon and add a Gradle flag to enable it.
Problem was:
On my Macbook M3 I had trouble building freemarker.
Can't remember exactly but AIs of this world recommended Azul somehow.
I managed to get an old Azul JDK 1.8 and 16, but could not find a Azul JDK 9 (https://www.azul.com/downloads/?package=jdk#zulu) .
So I started commenting out some sections in
build.gradle.kts.But then I decided to make a PR and introduce a property so other could use that too if needed.
Use this to avoid MR-JAR toolchain errors when JDK9/16 are unavailable. build.gradle.kts adds the skipJavaMRJSourceSets property, conditionally omits configuring the core9/core16 MR-JAR source sets, and updates the Eclipse classpath assembly to avoid referencing those configurations when skipped.
@ddekany That might not be optimal, but if anything it is an idea / base for discussion. Feel free to reject it. I am open for ideas. It is just what I did locally, as I want to try out and idea for another PR.