From eac2e2c42d4b6325e506c0cf7c178fe0c41368a6 Mon Sep 17 00:00:00 2001 From: Nashwan Azhari Date: Wed, 24 Jul 2024 17:22:09 +0300 Subject: [PATCH] Override @parcel/watcher version for portal:v2.6.3. Signed-off-by: Nashwan Azhari --- v2.6.3/harbor-portal/rockcraft.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/v2.6.3/harbor-portal/rockcraft.yaml b/v2.6.3/harbor-portal/rockcraft.yaml index 1238699..bff2606 100644 --- a/v2.6.3/harbor-portal/rockcraft.yaml +++ b/v2.6.3/harbor-portal/rockcraft.yaml @@ -64,6 +64,7 @@ parts: source-tag: v2.6.3 source-depth: 1 build-packages: + - g++ - python3-yaml build-snaps: - node/16/stable @@ -83,6 +84,17 @@ parts: cd "$OUTDIR" mkdir -p "$OUTDIR/dist" + + # HACK(aznashwan): add override for listed parcel/watcher which fails to build on ARM64. + # Sadly 2.1.0 also shows the same issue, with 2.2.0 being the earliest + # release available on NPM which actually works... + # https://github.com/parcel-bundler/watcher/issues/156#issuecomment-1762236540 + if [ "$CRAFT_TARGET_ARCH" == "arm64" ]; then + PACKAGE_JSON="$OUTDIR/package.json" + python3 -c 'import sys, json; p=json.loads(sys.stdin.read()); p["overrides"] = {"@parcel/watcher": "2.2.0"}; print(json.dumps(p, indent=4))' < "$PACKAGE_JSON" > "$PACKAGE_JSON.new" + mv "$PACKAGE_JSON.new" "$PACKAGE_JSON" + fi + npm install --unsafe-perm npm run generate-build-timestamp