Skip to content

Commit d8c588e

Browse files
SaadnajmiCopilot
andcommitted
fix(hermes): skip absent inspector headers when packaging Apple framework
Newer Hermes tags remove the legacy inspector header directories while retaining the other packaged API surfaces. Guard the top-level and chrome globs independently in both Apple packaging paths. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 211fa7f commit d8c588e

1 file changed

Lines changed: 18 additions & 10 deletions

File tree

‎packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh‎

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,15 @@ function build_apple_framework {
163163
mkdir -p destroot/include/hermes/cdp
164164
cp API/hermes/cdp/*.h destroot/include/hermes/cdp
165165

166-
mkdir -p destroot/include/hermes/inspector
167-
cp API/hermes/inspector/*.h destroot/include/hermes/inspector
168-
169-
mkdir -p destroot/include/hermes/inspector/chrome
170-
cp API/hermes/inspector/chrome/*.h destroot/include/hermes/inspector/chrome
166+
# [macOS] Newer Hermes tags removed the legacy inspector headers; copy only when present.
167+
if compgen -G "API/hermes/inspector/*.h" > /dev/null; then
168+
mkdir -p destroot/include/hermes/inspector
169+
cp API/hermes/inspector/*.h destroot/include/hermes/inspector
170+
fi
171+
if compgen -G "API/hermes/inspector/chrome/*.h" > /dev/null; then
172+
mkdir -p destroot/include/hermes/inspector/chrome
173+
cp API/hermes/inspector/chrome/*.h destroot/include/hermes/inspector/chrome
174+
fi
171175

172176
mkdir -p destroot/include/jsi
173177
cp "$JSI_PATH"/jsi/*.h destroot/include/jsi
@@ -193,11 +197,15 @@ function prepare_dest_root_for_ci {
193197
mkdir -p destroot/include/hermes/cdp
194198
cp API/hermes/cdp/*.h destroot/include/hermes/cdp
195199

196-
mkdir -p destroot/include/hermes/inspector
197-
cp API/hermes/inspector/*.h destroot/include/hermes/inspector
198-
199-
mkdir -p destroot/include/hermes/inspector/chrome
200-
cp API/hermes/inspector/chrome/*.h destroot/include/hermes/inspector/chrome
200+
# [macOS] Newer Hermes tags removed the legacy inspector headers; copy only when present.
201+
if compgen -G "API/hermes/inspector/*.h" > /dev/null; then
202+
mkdir -p destroot/include/hermes/inspector
203+
cp API/hermes/inspector/*.h destroot/include/hermes/inspector
204+
fi
205+
if compgen -G "API/hermes/inspector/chrome/*.h" > /dev/null; then
206+
mkdir -p destroot/include/hermes/inspector/chrome
207+
cp API/hermes/inspector/chrome/*.h destroot/include/hermes/inspector/chrome
208+
fi
201209

202210
mkdir -p destroot/include/jsi
203211
cp "$JSI_PATH"/jsi/*.h destroot/include/jsi

0 commit comments

Comments
 (0)