Skip to content

[iOS] pod install silently falls back to building from source when the prebuilt-artifact probe fails transiently (curl error / HTTP 000) #60198

Open

Description

@kazuhiro-ando

Description

When the artifact probe in pod install cannot reach Maven (curl exit != 0 / HTTP 000, e.g. a transient DNS or network hiccup), React Native treats the result the same as "the artifact does not exist" and silently falls back to building from source. pod install still succeeds; the only signal is one log line per component:

[ReactNativeDependencies] No prebuilt artifacts found, reverting to building from source.
[ReactNativeCore] No prebuilt artifacts found, reverting to building from source.
[Hermes] Using the latest commit from 250829098.0.0-stable.

Relevant code (0.88.1):

  • scripts/cocoapods/utils.rb ReactNativePodsUtils.artifact_exists? returns false when !$?.success? || http_code == "000" (it intentionally does not cache that result, but the caller still gets false).
  • scripts/cocoapods/rncore.rb / rndependencies.rb: @@build_from_source = !use_local_xcframework && !artifacts_exists even though RCT_USE_PREBUILT_RNCORE=1 / RCT_USE_RN_DEP=1.
  • sdks/hermes-engine/hermes-utils.rb hermes_artifact_exists returns false on the same condition, so hermes_source_type returns BUILD_FROM_GITHUB_STABLE_BRANCH (250829098.0.0-stable), which is a different Hermes line from the prebuilt hermes-ios 260318099.0.5 used by 0.88.1.

Because each component probes independently, a single hiccup can produce a project where some components are prebuilt and others are built from source. In our app (Expo SDK, RN 0.88.1, Release build on the iOS simulator) we hit two kinds of broken builds this way, and both went away after re-running pod install with all probes succeeding:

  1. Crash at launch: Library not loaded: @rpath/React.framework/React.
  2. JS ran but await on an async function resolved to undefined before the callee body ran (the callee itself returned a valid value). The bundle had been compiled with the hermesc built from the stable-branch sources, while the runtime came from the prebuilt artifacts. We have not reduced this second symptom to a minimal repro, so please treat the cause as our best guess.

Neither is detectable from the pod install exit code, so CI and release builds can ship them.

Suggestion: distinguish an inconclusive probe from a definitive 404. When the user asked for prebuilt artifacts (RCT_USE_PREBUILT_RNCORE=1 / RCT_USE_RN_DEP=1, Hermes without a source override) and the probe was inconclusive, retry a few times and then abort pod install with a clear message instead of falling back. If a silent fallback must remain the default, an opt-in such as RCT_REQUIRE_PREBUILT=1 that turns the fallback into an error would already help.

As a workaround we now inject a check into the Podfile post_install that raises when ReactNativeCoreUtils.build_rncore_from_source(), ReactNativeDependenciesUtils.build_react_native_deps_from_source() is true, or when the hermes-engine root spec source is not :http.

Related but different: #58427 (artifacts were really unavailable on the server). This report is about the client-side behavior when the probe itself fails.

Steps to reproduce

  1. npx @react-native-community/cli init Repro --version 0.88.1 --skip-install and npm install.
  2. Put a fake curl first on PATH that fails only the artifact probes (-Iw), and passes everything else to the real curl:
    mkdir -p /tmp/fakebin && cat > /tmp/fakebin/curl <<'SH'
    #!/bin/bash
    for a in "$@"; do [ "$a" = "-Iw" ] && { printf 000; exit 6; }; done
    exec /usr/bin/curl "$@"
    SH
    chmod +x /tmp/fakebin/curl
  3. cd ios && rm -rf Pods && PATH=/tmp/fakebin:$PATH pod install
  4. Observe that pod install exits 0 after logging reverting to building from source for ReactNativeCore / ReactNativeDependencies and Using the latest commit from 250829098.0.0-stable for Hermes.

Expected: pod install fails (or retries) because the prebuilt artifacts were requested but their availability could not be determined.

React Native Version

0.88.1

Affected Platforms

Build - MacOS (iOS)

Output of npx @react-native-community/cli info

System:
  OS: macOS 27.0.1
  CPU: (12) arm64 Apple M6
  Shell: zsh 5.9
Binaries:
  Node: 24.22.1
  npm: 11.19.1
Managers:
  CocoaPods: 1.17.0
SDKs:
  iOS SDK: iOS 27.2
IDEs:
  Xcode: 27.2/27B52
Languages:
  Ruby: 4.0.9
npmPackages:
  react: 19.3.0
  react-native: 0.88.1
iOS:
  hermesEnabled: true

Stacktrace or Logs

[ReactNativeDependencies] No prebuilt artifacts found, reverting to building from source.
[ReactNativeDependencies] Building from source: true
[ReactNativeCore] No prebuilt artifacts found, reverting to building from source.
[ReactNativeCore] Building from source: true
[Hermes] Using the latest commit from 250829098.0.0-stable.
Pod installation complete!

MANDATORY Reproducer

The steps above need no app code: the fake curl simulates the failed probe, and a fresh init app reproduces it.

Activity

  1. react-native-bot commented on Nov 21, 2026

    @react-native-bot
    Collaborator

    Warning

    Missing reproducer: We could not detect a reproducible example in your issue report. Reproducers are mandatory and we can accept only one of those as a valid reproducer:


    You can read more about about it on our website: How to report a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: Author FeedbackNeeds: ReproThis issue could be improved with a clear list of steps to reproduce the issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions