Skip to content

Commit

Permalink
optipng won't compile on mac silicon (#5581)
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
smithellis authored May 2, 2024
1 parent 7e771b3 commit be21341
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 6 additions & 0 deletions bin/run-bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 12 additions & 0 deletions docs/hacking_howto.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down

0 comments on commit be21341

Please sign in to comment.