jbake: JBake fails to run or build on Apple Silicon
Hi there
Thank you for JBake – I have been using it since June 2015 (that is when I get the urge to write something pithy at Code is Mandatory)
Recently I started using a MacBook Air (with Apple M1 Silicon) for processing and unfortunately JBake does not run or build on Apple M1 Silicon. It works fine on Apple Intel.
Exceptions and references to the underlying issue are listed below.
Digging in it is appears to be an issue with OrientDB.
As a result of nosing around and to solve this itch, I have started work on removing the dependency of OrientDB and using JDBC and Groovy Sql with the implementation done in SQLite.
The work is ongoing on a “Prototype PR” type branch that is really rough as guts at the moment.
Exceptions caused trying to run
$ jbake -b
JBake v2.7.0-rc.2 (2021-05-24 22:30:41[GMT+01:00] 045c61c#) [http://jbake.org]
14:02:31.341 INFO org.jbake.app.Oven - Baking has started...
Warning: Nashorn engine is planned to be removed from a future JDK release
14:02:31.485 INFO c.o.common.jna.ONative - Default limit of open files (512) will be used.
14:02:31.518 INFO c.o.common.jna.ONative - 17179869184 B/16384 MB/16 GB of physical memory were detected on machine
14:02:31.518 INFO c.o.common.jna.ONative - Detected memory limit for current process is 17179869184 B/16384 MB/16 GB
14:02:31.519 INFO c.o.o.c.e.OMemoryAndLocalPaginatedEnginesInitializer - JVM can use maximum 4096MB of heap memory
14:02:31.519 INFO c.o.o.c.e.OMemoryAndLocalPaginatedEnginesInitializer - Because OrientDB is running outside a container 12% of memory will be left unallocated according to the setting 'memory.leftToOS' not taking into account heap memory
14:02:31.519 INFO com.orientechnologies - OrientDB auto-config DISKCACHE=10,321MB (heap=4,096MB os=16,384MB)
14:02:31.519 INFO c.o.o.c.e.l.OEngineLocalPaginated - System is started under an effective user : `mark`
14:02:31.520 INFO c.o.o.c.e.l.OEngineLocalPaginated - Allocation of 156879 pages.
14:02:31.529 ERROR jbake - An unexpected error occurred: /private/var/folders/43/bt5j2vf520v6n9gnx968cs840000gn/T/jna-3344077/jna5212213165608407388.tmp: dlopen(/private/var/folders/43/bt5j2vf520v6n9gnx968cs840000gn/T/jna-3344077/jna5212213165608407388.tmp, 1): no suitable image found. Did find:
/private/var/folders/43/bt5j2vf520v6n9gnx968cs840000gn/T/jna-3344077/jna5212213165608407388.tmp: no matching architecture in universal wrapper
/private/var/folders/43/bt5j2vf520v6n9gnx968cs840000gn/T/jna-3344077/jna5212213165608407388.tmp: no matching architecture in universal wrapper
mhbmacxiv jbake (master) $
Exceptions caused trying to run tests
GroovyTemplateEngineRenderingTest > renderTags FAILED
org.gradle.internal.exceptions.DefaultMultiCauseException: Multiple Failures (3 failures)
java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.Native
java.lang.NullPointerException: Can't set default locale to NULL
Related Git Hub Issues
Test failures on Apple silicon (aarch64) #1323 Add darwin-aarch64 support #1297 Enable building jna for Darwin arm64 #1238 Support for Apple silicon #20 Fix variadic arguments on arm64 darwin ABI #577 Enable Strict Type Enforcement for Dynamic Method Dispatching
Software environment
# uname -a
Darwin mhbmacxiv 20.5.0 Darwin Kernel Version 20.5.0: Sat May 8 05:10:31 PDT 2021; root:xnu-7195.121.3~9/RELEASE_ARM64_T8101 arm64
# sw_vers
ProductName: macOS
ProductVersion: 11.4
BuildVersion: 20F71
# java --full-version
openjdk 11.0.11+9-LTS
# jbake version (running lastest snapshot)
JBake v2.7.0-rc.2 (2021-05-24 22:30:41[GMT+01:00] 045c61c#) [http://jbake.org]
# jbake version (trying to build)
$ git log | head
commit 109b7c1379b907172acfee7815d945d3c1c5c51b
Merge: 045c61c 5829541
Author: Jonathan Bullock <jonbullock@gmail.com>
Date: Tue Jun 8 22:48:33 2021 +0100
Merge pull request #707 from jonbullock/fix/692-template-folders
Fix to allow templates to be stored in folders
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 48 (8 by maintainers)
Commits related to this issue
- Update to OrientDB 3.1.16 to support Apple Silicon https://github.com/orientechnologies/orientdb/pull/9762 This closes #709 — committed to kwin/jbake by kwin 2 years ago
- Fixes #709 Upgraded OrientDB to 3.1.20. Updated tests as OrientDB v3.1.x doesn't allow DB name to be a path. Groovy template test was flaky, so removed override which made it more reliable. — committed to jonbullock/jbake by jonbullock 2 years ago
Ok, I got maven plugin to work as well by using
<dependencies>section of the plugin to upgrade JNA to the latest versionComplete project that works on Apple Silicon available here: https://github.com/flowlogix/jbake-maven-plugin-example
I’ve replaced OrientDB with ArcadeDB in the PR https://github.com/jbake-org/jbake/pull/745. It was easy and quick, the SQL is the same, just a little change in the API.
Hi. In reply to about whether it is more or less usable, it builds (using SQLite) on M1, Intel, Linux and Windows.
I use it mainly on M1. Once I unzip the installaiton and set path, it works building my blog and the JBake website.
But to get it polished and merged back into master/main will require some tidying up and and deciding on what to do for the future.
Currently the work on the Prototype/PR branch includes the following