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

generateSite not working on Mac M1 #1289

Closed
cgoguyer opened this issue Nov 9, 2023 · 5 comments
Closed

generateSite not working on Mac M1 #1289

cgoguyer opened this issue Nov 9, 2023 · 5 comments

Comments

@cgoguyer
Copy link

cgoguyer commented Nov 9, 2023

Hello,
generateSite is not working on Mac M1 although generatePDF and generateHTML works fine.
I'm using native openJDK:

openjdk 17.0.9 2023-10-17
OpenJDK Runtime Environment Homebrew (build 17.0.9+0)
OpenJDK 64-Bit Server VM Homebrew (build 17.0.9+0, mixed mode, sharing)
> Task :generateSite
> Task :bake FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':bake'.
> A failure occurred while executing org.jbake.gradle.impl.JBakeWorkAction
   > /private/var/folders/nd/y6kkpjl13_gdb60t_mh24v600000gn/T/jna-1941716187/jna16761405974260304138.tmp: dlopen(/private/var/folders/nd/y6kkpjl13_gdb60t_mh24v600000gn/T/jna-1941716187/jna16761405974260304138.tmp, 0x0001): tried: '/private/var/folders/nd/y6kkpjl13_gdb60t_mh24v600000gn/T/jna-1941716187/jna16761405974260304138.tmp' (fat file, but missing compatible architecture (have 'i386,x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/private/var/folders/nd/y6kkpjl13_gdb60t_mh24v600000gn/T/jna-1941716187/jna16761405974260304138.tmp' (no such file), '/private/var/folders/nd/y6kkpjl13_gdb60t_mh24v600000gn/T/jna-1941716187/jna16761405974260304138.tmp' (fat file, but missing compatible architecture (have 'i386,x86_64', need 'arm64'))

* 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 21s
5 actionable tasks: 3 executed, 2 up-to-date
@PacoVK
Copy link
Collaborator

PacoVK commented Nov 9, 2023

Thanks for reporting! This is a known issue (see) I think we should try out either upgrade to latest release candidate of jbake or downgrade (see)

@PacoVK
Copy link
Collaborator

PacoVK commented Nov 15, 2023

While revising the issue i came across #1082 (comment) which is a bummer, because that literally means no fix as of now, because we would loose JDK11 support

@rdmueller
Copy link
Member

So, the fix is to start the rosetta emulator via arch -x86_64 /bin/bash and install the doctoolchain jdk within the emulator ./dtcw local getJava or with the new version of dtcw ./dtcw local install java. After this you can exit the emulator bash and use docToolchain as usual.

docToolchain will detect and use the local JDK (installed to $USER/.doctoolchain). Since it is not the native apple silicon one, it will start rosetta in the background and run dtc with the x86 JDK. Within this JDK, jBake runs without flaw.

Hope this helps

@PacoVK
Copy link
Collaborator

PacoVK commented Nov 20, 2023

thanks, i can confirm on my M1 it works with the steps outlined by @rdmueller

Edit: I also verified that the latest Jbake-rc does not work. Hence, upgrade is currently no option and we need to use the aforementioned workaround

@cgoguyer
Copy link
Author

cgoguyer commented Dec 5, 2023

Thx, it works with this tip.

@PacoVK PacoVK closed this as completed Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants