Repository navigation
feat: read podspecs with real Ruby (alpha.8, plan 1) - #37
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Read podspecs with real Ruby (alpha.8, plan 1)
The
rn-spmstep now reads every library's podspec with the system Ruby, through a shim of CocoaPods' DSL and React Native's podspec helpers, so a podspec gives the same fields on Linux as under CocoaPods on a Mac. Without a usable Ruby, the reduced reader of earlier releases reads it, and the build says so.Design:
docs/design/specs/2026-11-06-alpha-8-fail-early-design.md(A, with its 2026-11-09 amendments). Plan:docs/design/plans/2026-11-06-alpha-8-plan-1-podspec-reader.md.What users get
install_modules_dependencies,defined?andrespond_to?answer as under React Native's Podfile, and a library's own Ruby andnodescripts run: react-native-gesture-handler 3.3.0 getsRNGH_USE_WORKLETS=1beside react-native-worklets, and react-native-webview 14.0.1 takes itsinstall_modules_dependenciesbranch.pod ipc specis no longer run.iosattributes apply.s.ios.exclude_files,ss.ios.dependencyand the like are merged over the spec and each subspec the scaffold uses; other platforms' attributes are never read.rubyonPATH, by its absolute path, so a version manager's shim cannot switch Ruby per folder; in the podspec's folder; withPATH,HOME,LANG,RCT_NEW_ARCH_ENABLED=1andRCT_HERMES_V1_ENABLED=1only; for at most 120 s.rn-spmwith the podspec, its line and the reason, also when autolinking reads it for header search paths, on React Native 0.88 and in the copy used for 0.85–0.87 and Expo SDK 57. A gap of the reader, a timeout, a Ruby that ends without a result, rn-xtool's own failure to run the read and akey not foundfromENV.fetchend with the escape:RN_XTOOL_PODSPEC_READER=reducedreads with the reduced reader for one run, and a⚠line names it.spm_dependencyis refused by name; one that setsscript_phases,prepare_command,info_plistormodule_mapgets a!line.doctorandsetup.✔ ruby — 3.3.8, or a⚠with the reason. The install command (sudo apt install ruby) is given when Ruby is missing or older than 2.7; for another reason (nojson, a Ruby that cannot run the reader, the shim missing) the line names it and links the troubleshooting page.setupnever installs Ruby.Package.swiftnames its reader; thepatchesstep warns about a persisted scaffold the other reader wrote.doctor --reporthasruby:,podspec reader:and, when a podspec read environment variables,podspec ENV:.Upgrading from 0.1.0-alpha.7
sudo apt install ruby) before the first build with this release.patcheswith the stale-patch message: the bundled react-native patch changed (a newscripts/spm/read-podspec-shim.rb, a rewrittenscripts/spm/read-podspec.js). Runrm -rf node_modules/react-native && npm install, then build again.How it was proven
The reader sweep (
tests/podspecReaderSweep.test.ts): 77 library and React Native pairs, 82 podspecs (the 30 most-downloaded libraries with an iOS podspec, the trial's failing versions, the Expo SDK 57 and 58 templates' and the reference apps' libraries, and gesture-handler 3.3.0 with worklets installed beside it), each read with Ruby and with the reduced reader against a reviewed golden. About a minute locally with every tarball cached.The shim's tests run on Ruby 2.7 in CI (
shim-ruby-floor), and a drift test checks the shim'smin_ios_version_supportedand folly values against every cached React Native line.Build-only runs of the reference apps with the new reader (no device), total time and the
rn-spmstep's share:RN_XTOOL_PODSPEC_READER=reduced: 262 s (38 s), exactly one⚠line, every markerreduced.No reader stop, every read
ok, markersrubyand revision 8 everywhere; Ruby costs about 64 ms per podspec.Without Ruby,
rn-xtool doctoranddoctor --projectprint the⚠ ruby — not foundline.npm test: 2676 passed, 6 skipped (environment: real slots, a device, the e2e app, the CI-only check);npm run lintandnpm run scan:privateare clean.Merge gate
shim-ruby-floor.Maintainer notes
docs/RELEASING.mdthat regenerates the 0.88 patches now gives a new file's header thea/side patch-package reads (before, patch-package refused the whole patch), and runs the main reversepatchwith--no-backup-if-mismatch, so no.origfile lands in the diff.tests/tarballs.json:RN_XTOOL_FETCH_HEAVY=1 node scripts/fetch-test-tarballs.mjsfetches them, the sweep skips skia with a named reason without them, and CI does not fetch them.../app-goldenbeside the repo (orRN_XTOOL_REF_APP).tests/mentions.test.tschecks the tracked Markdown; the Mentions workflow checks a pull request's description, andnpm run check:mentions -- <file>checks a draft like this one.