From be21341d9a49baf632169702b221bd5fbd61987d Mon Sep 17 00:00:00 2001 From: smith Date: Thu, 2 May 2024 17:14:02 -0400 Subject: [PATCH] optipng won't compile on mac silicon (#5581) - create a Make option 'init-mac' to account for it - allow run-boostrap.sh to process the new --optipng-fix flag Open to better ideas (yes, move to linux is valid) - Determining if you are on Apple silicon from run-bootstrap directly appeared to be problematic since it is running in a container - Doing it prior in the make call seemed to make sense - change nothing for exisitng processes but add a simpler way forward for Mac folk --- Makefile | 3 +++ bin/run-bootstrap.sh | 6 ++++++ docs/hacking_howto.md | 12 ++++++++++++ 3 files changed, 21 insertions(+) diff --git a/Makefile b/Makefile index fb716c763e0..5a284e7c786 100644 --- a/Makefile +++ b/Makefile @@ -47,6 +47,9 @@ run: start init: .docker-build ${DC} run web bin/run-bootstrap.sh +init-mac: .docker-build + ${DC} run web bin/run-bootstrap.sh --optipng-fix + shell: .docker-build ${DC} run web bash diff --git a/bin/run-bootstrap.sh b/bin/run-bootstrap.sh index 15fe1c795ce..67bca9953d8 100755 --- a/bin/run-bootstrap.sh +++ b/bin/run-bootstrap.sh @@ -5,6 +5,12 @@ set -ex # Install and setup localization ./scripts/l10n-fetch-lint-compile.sh +# If flag --optipng-fix is passed +if [[ $* == *--optipng-fix* ]]; then + # Install fix for optipng on mac silicon + export CPPFLAGS=-DPNG_ARM_NEON_OPT=0 +fi + # Collect the JavaScript catalog files. python manage.py compilejsi18n diff --git a/docs/hacking_howto.md b/docs/hacking_howto.md index 2e422c5dd42..30499997ace 100644 --- a/docs/hacking_howto.md +++ b/docs/hacking_howto.md @@ -26,9 +26,21 @@ and follow the following steps. ``` 3. Pull base Kitsune Docker images, install node packages and build the Webpack bundle, and create your database. + On non-Apple silicon: ``` make init + ``` + + On Apple silicon (M1, M2): + + ``` + make init-mac + ``` + + Then: + + ``` make build ```