Skip to content

Commit 7eacac7

Browse files
Saadnajmiclaude
andcommitted
fix: add CLI subcommands and simplify get_architecture
Address review feedback: - Add build_hermesc and prepare_dest_root CLI subcommands so CI can execute the script directly instead of sourcing it - Simplify get_architecture from 5 branches to 2 - Update usage comment to document new subcommands - Remove redundant chmod +x calls (script is already 755 in git) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 68dde91 commit 7eacac7

4 files changed

Lines changed: 13 additions & 21 deletions

File tree

.github/workflows/build-apple-slices-hermes.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ jobs:
4747
4848
echo "[HERMES] Building Hermes for $SLICE"
4949
50-
chmod +x ./utils/build-apple-framework.sh
5150
BUILD_TYPE="${{ matrix.flavor }}" ./utils/build-apple-framework.sh "$SLICE"
5251
5352
echo "Moving from build_$SLICE to $FINAL_PATH"

.github/workflows/build-hermes-macos.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,12 @@ jobs:
5353
mv build_xrsimulator_${{ matrix.flavor }} build_xrsimulator
5454
- name: Prepare destroot folder
5555
shell: bash
56-
run: |
57-
chmod +x ./utils/build-apple-framework.sh
58-
source ./utils/build-apple-framework.sh
59-
prepare_dest_root_for_ci
56+
run: ./utils/build-apple-framework.sh prepare_dest_root
6057
- name: Create universal xcframework
6158
shell: bash
6259
run: |
6360
echo "[HERMES] Creating the universal framework"
64-
chmod +x ./utils/build-apple-framework.sh
6561
./utils/build-apple-framework.sh build_framework
66-
6762
chmod +x ./destroot/bin/hermesc
6863
- name: Package the Hermes Apple frameworks
6964
shell: bash

.github/workflows/build-hermesc-apple.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ jobs:
1212
uses: ./.github/actions/setup-xcode
1313
- name: Build HermesC Apple
1414
shell: bash
15-
run: |
16-
source ./utils/build-apple-framework.sh
17-
build_host_hermesc_if_needed
15+
run: ./utils/build-apple-framework.sh build_hermesc
1816
- name: Upload HermesC Artifact
1917
uses: actions/upload-artifact@v4.3.4
2018
with:

utils/build-apple-framework.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@
88
# Mac Catalyst) and combines them into a single universal xcframework.
99
#
1010
# Usage:
11-
# ./build-apple-framework.sh # build all platforms + universal xcframework
12-
# ./build-apple-framework.sh <platform> # build a single platform (e.g. macosx, iphoneos)
13-
# ./build-apple-framework.sh build_framework # combine already-built slices into xcframework
11+
# ./build-apple-framework.sh # build all platforms + universal xcframework
12+
# ./build-apple-framework.sh <platform> # build a single platform (e.g. macosx, iphoneos)
13+
# ./build-apple-framework.sh build_framework # combine already-built slices into xcframework
14+
# ./build-apple-framework.sh build_hermesc # build host hermesc compiler
15+
# ./build-apple-framework.sh prepare_dest_root # assemble destroot from pre-built slices
1416

1517
if [ "$CI" ]; then
1618
set -x
@@ -75,15 +77,9 @@ function get_release_version {
7577
# Given a specific target, retrieve the right architecture for it
7678
# $1 the target you want to build. Allowed values: iphoneos, iphonesimulator, catalyst, macosx, xros, xrsimulator, appletvos, appletvsimulator
7779
function get_architecture {
78-
if [[ $1 == "iphoneos" || $1 == "xros" ]]; then
80+
if [[ $1 == "iphoneos" || $1 == "xros" || $1 == "appletvos" ]]; then
7981
echo "arm64"
80-
elif [[ $1 == "iphonesimulator" || $1 == "xrsimulator" ]]; then
81-
echo "x86_64;arm64"
82-
elif [[ $1 == "appletvos" ]]; then
83-
echo "arm64"
84-
elif [[ $1 == "appletvsimulator" ]]; then
85-
echo "x86_64;arm64"
86-
elif [[ $1 == "catalyst" || $1 == "macosx" ]]; then
82+
elif [[ $1 == "iphonesimulator" || $1 == "xrsimulator" || $1 == "appletvsimulator" || $1 == "catalyst" || $1 == "macosx" ]]; then
8783
echo "x86_64;arm64"
8884
else
8985
echo "Error: unknown architecture passed $1"
@@ -318,6 +314,10 @@ if [[ -z $1 ]]; then
318314
create_framework
319315
elif [[ $1 == "build_framework" ]]; then
320316
build_universal_framework
317+
elif [[ $1 == "build_hermesc" ]]; then
318+
build_host_hermesc_if_needed
319+
elif [[ $1 == "prepare_dest_root" ]]; then
320+
prepare_dest_root_for_ci
321321
else
322322
build_framework "$1"
323323
fi

0 commit comments

Comments
 (0)