From b247c6251f96d8dae100c86ab2884c7b559522b7 Mon Sep 17 00:00:00 2001 From: Bodhi <3882561+BodhiHu@users.noreply.github.com> Date: Tue, 18 Jul 2023 22:46:59 +0800 Subject: [PATCH] fix libz.so.1 missing error when running "npm install" on Linux/ARM64 (on a Macbook M1) (#23935) * fix libz.so.1 missing error when running "npm install" on Linux/ARM64 * fix typo * update changes --------- Co-authored-by: Mattermost Build --- webapp/Makefile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/webapp/Makefile b/webapp/Makefile index d47f3b5e55..9c5928897d 100644 --- a/webapp/Makefile +++ b/webapp/Makefile @@ -4,6 +4,13 @@ include config.mk # The CI environment variable is set automatically in CircleCI and GitLab CI CI ?= false +# Detect Linux/ARM64 and set a flag to fix the issue with optipng-bin on it: +# please see optipng-bin Linux arm64 support issue (https://github.com/imagemin/optipng-bin/issues/118) for details: +ifeq ($(shell uname)/$(shell uname -m),Linux/aarch64) + LINUX_ARM64 = true + CPPFLAGS = "-DPNG_ARM_NEON_OPT=0" +endif + .PHONY: run run: node_modules ## Runs app @echo Running Mattermost Web App for development @@ -61,7 +68,7 @@ node_modules: package.json $(wildcard package-lock.json) @echo Getting dependencies using npm ifeq ($(CI),false) - npm install + CPPFLAGS=$(CPPFLAGS) npm install else # This runs in CI with NODE_ENV=production which skips devDependencies without this flag npm ci --include=dev