peachsim 0.1.2935 → 0.1.2937
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +6 -8
- package/cli/account-gate.ts +20 -3
- package/cli/app-bundle-resources.ts +66 -19
- package/cli/catalog/meta.ts +2 -106
- package/cli/command-agent.ts +7 -0
- package/cli/command-registry.ts +0 -1
- package/cli/commands/control.ts +13 -5
- package/cli/commands/daemon.ts +4 -2
- package/cli/commands/device.ts +78 -8
- package/cli/commands/do-chain.ts +11 -8
- package/cli/commands/inspect/core.ts +4 -9
- package/cli/commands/inspect/settling.ts +1 -0
- package/cli/commands/logout.ts +6 -1
- package/cli/commands/map.ts +2 -6
- package/cli/commands/package.ts +112 -57
- package/cli/commands/shell-url.ts +0 -1
- package/cli/download-auth.ts +2 -0
- package/cli/drivers/playwright-provisioning.ts +10 -38
- package/cli/github-workflow-identity.ts +8 -0
- package/cli/internal-child-contract.ts +1 -0
- package/cli/internal-child.ts +5 -0
- package/cli/main.ts +2 -10
- package/cli/outbound-endpoints.ts +26 -0
- package/detox/index.ts +227 -131
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +2 -2
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +47 -3
- package/dist-lib/bridge-contract-input.mjs +6 -6
- package/dist-lib/bridge-contract.cjs +10 -1
- package/dist-lib/bridge-contract.mjs +3 -3
- package/dist-lib/bundle-channel.cjs +12779 -9515
- package/dist-lib/capture-contract.cjs +39 -17
- package/dist-lib/capture-contract.mjs +3 -3
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +3 -3
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +2 -2
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +8 -8
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +6 -6
- package/dist-lib/detox/index.cjs +200 -132
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/esm-chunks/{acorn-Q5TRRYSO.mjs → acorn-IIBLEO25.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-UDWBTBVG.mjs → chunk-4FTPQKPT.mjs} +10 -1
- package/dist-lib/esm-chunks/chunk-4WIDTRBB.mjs +10232 -0
- package/dist-lib/esm-chunks/{chunk-LCMFYMT7.mjs → chunk-5QZOQ3NZ.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-BJ2OGUX7.mjs → chunk-CIY67HNL.mjs} +39 -17
- package/dist-lib/esm-chunks/{chunk-SKQTNQYE.mjs → chunk-CQFEMJ64.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-AXWVXRHX.mjs → chunk-CWVMCW23.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-MTALOHQR.mjs → chunk-F6DZ4DS2.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-I4R7IZRD.mjs → chunk-HJMF6O7L.mjs} +74 -46
- package/dist-lib/esm-chunks/chunk-I6T4PXJF.mjs +154 -0
- package/dist-lib/esm-chunks/{chunk-XWAUZKIA.mjs → chunk-IJU3JMWM.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-CXWUIOCH.mjs → chunk-KODEPXQC.mjs} +4 -4
- package/dist-lib/esm-chunks/{chunk-WJE5QHSD.mjs → chunk-LD4K2VBL.mjs} +155 -36
- package/dist-lib/esm-chunks/{chunk-2TSM64HI.mjs → chunk-LTE7YMEG.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-3GGOXUJA.mjs → chunk-M3CSKAJE.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-7G5UETIG.mjs → chunk-NA6DJPB6.mjs} +43 -1
- package/dist-lib/esm-chunks/{chunk-MSUHMNAI.mjs → chunk-NNAX24FS.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-VDJA4LP4.mjs → chunk-PZPJJBAS.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-UEEEJVQA.mjs → chunk-QXSTHMWN.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-S2RJB5I7.mjs → chunk-RBPVK5YI.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-VRAXNGYT.mjs → chunk-SCT5OFDV.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-T3M73LGP.mjs → chunk-U3CJGYSP.mjs} +50 -6
- package/dist-lib/esm-chunks/{chunk-SLUGTGQQ.mjs → chunk-VXTOQ522.mjs} +12 -6
- package/dist-lib/esm-chunks/{chunk-EL44SZMV.mjs → chunk-WMSVGYTH.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-FEDEPSEV.mjs → chunk-WRWINRWK.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-BNO52N2S.mjs → chunk-YZF2USRD.mjs} +1905 -8760
- package/dist-lib/esm-chunks/{chunk-TQLKYMVP.mjs → chunk-ZNHR6C3L.mjs} +1 -1
- package/dist-lib/esm-chunks/{download-auth-registry-G75MIT55.mjs → download-auth-registry-AHS5MSIB.mjs} +4 -4
- package/dist-lib/esm-chunks/{metro-layout-parser-FXLUDTYT.mjs → metro-layout-parser-24ZYK5UP.mjs} +3 -3
- package/dist-lib/esm-chunks/{swift-package-prebuilt-524D4MA2.mjs → swift-package-prebuilt-L4YNXQRD.mjs} +15 -15
- package/dist-lib/esm-chunks/{swift-sdk-app-module-EX544YJY.mjs → swift-sdk-app-module-RM652JSW.mjs} +87 -71
- package/dist-lib/esm-chunks/{swift-sdk-image-LOTMWVM7.mjs → swift-sdk-image-5PQ44UJT.mjs} +15 -15
- package/dist-lib/esm-chunks/{swift-sdk-image-producer-UO6B3M4U.mjs → swift-sdk-image-producer-GD3SM6YI.mjs} +5 -5
- package/dist-lib/esm-chunks/swift-sdk-later-data-62QYJ2KH.mjs +590 -0
- package/dist-lib/expo-swift-bundle.cjs +21037 -17896
- package/dist-lib/expo-swift-metadata.cjs +8 -2
- package/dist-lib/expo-swift-metadata.mjs +9 -8
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +22481 -18741
- package/dist-lib/host/fetch-proxy-handler.cjs +21079 -17980
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +2 -2
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +68 -38
- package/dist-lib/kotlin-host.cjs +97 -21
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +3 -3
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +3 -3
- package/dist-lib/metro-production-bundle.cjs +23 -1
- package/dist-lib/metro-production-bundle.mjs +24 -4
- package/dist-lib/native-app-identity-project.cjs +3582 -571
- package/dist-lib/native-app-identity-project.mjs +1024 -398
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +6 -6
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +3 -3
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +2 -2
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +3 -3
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +132 -116
- package/dist-lib/public-origins-lib.json +215 -173
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +2 -2
- package/dist-lib/reap-browser.cjs +17 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +6 -7
- package/dist-lib/sdk.mjs +13 -14
- package/dist-lib/skills.cjs +23216 -19650
- package/dist-lib/swift-compile.cjs +4337 -2905
- package/dist-lib/swift-compile.mjs +15 -13
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +3 -3
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +6 -6
- package/dist-lib/swift-svg-raster.cjs +1 -1
- package/dist-lib/swift-svg-raster.mjs +2 -2
- package/dist-lib/swift-toolchain.cjs +19 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vendor/@peculiar/x509.cjs +1 -1
- package/dist-lib/vendor/@ruby/prism/src/nodes.js.cjs +1 -1
- package/dist-lib/vendor/@ruby/prism/src/parsePrism.js.cjs +1 -1
- package/dist-lib/vendor/acorn.cjs +1 -1
- package/dist-lib/vendor/stream-json.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +1 -1
- package/dist-lib/vendor/sucrase.cjs +1 -1
- package/dist-lib/vendor/terser.cjs +1 -1
- package/dist-lib/vendor/valibot.cjs +1 -1
- package/dist-lib/vendor/ws.cjs +94 -32
- package/dist-lib/vendor/zod.cjs +1 -1
- package/dist-lib/worklet-executable.cjs +8 -5
- package/dist-lib/worklet-executable.mjs +9 -6
- package/dist-types/packages/peach-engine/src/canvaskit-artifact-urls.d.ts +2 -1
- package/dist-types/packages/peach-engine/src/capture/compositor-presentation-recording.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/generated/canvaskit-artifact-hashes.d.ts +26 -0
- package/dist-types/packages/peach-engine/src/engine/guest-scene-inspect.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/engine/inspect-info.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/metalTypes.d.ts +32 -2
- package/dist-types/packages/peach-engine/src/engine/portalContract.d.ts +24 -0
- package/dist-types/packages/peach-engine/src/engine/remote-display-protocol.d.ts +12 -2
- package/dist-types/packages/peach-engine/src/guest/http-cookie-storage.d.ts +73 -0
- package/dist-types/packages/peach-engine/src/guest/native-evaluation-lease.d.ts +5 -0
- package/dist-types/packages/peach-engine/src/guest/nitro-jsi-host.d.ts +3 -1
- package/dist-types/packages/peach-engine/src/ios/apps/canvas-map-data.d.ts +225 -9
- package/dist-types/packages/peach-engine/src/ios/chrome-metrics.d.ts +4 -1
- package/dist-types/packages/peach-engine/src/ios/duo-vertical-bar-geometry.d.ts +0 -1
- package/dist-types/packages/peach-engine/src/native-preview-bundle.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/remote-stream/canvas-display-compositor.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/remote-stream/canvas-display-contract.d.ts +44 -10
- package/dist-types/packages/peach-engine/src/remote-stream/cloud-display.d.ts +4 -3
- package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +2 -4
- package/dist-types/packages/peach-engine/src/render-worker/metro-bundle-metadata.d.ts +2 -0
- package/dist-types/packages/peach-engine/src/render-worker/native-widgetContract.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +15 -27
- package/dist-types/packages/peach-engine/src/render-worker/reanimated-readiness.d.ts +2 -6
- package/dist-types/packages/peach-engine/src/render-worker/shell-protocol.d.ts +11 -3
- package/dist-types/packages/peach-engine/src/settings/devices.d.ts +3 -1
- package/dist-types/packages/peach-engine/src/settings/duo-fold.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/webview-automation-host.d.ts +1 -1
- package/dist-types/packages/peach-globals/src/app-bundle-resources.d.ts +10 -0
- package/dist-types/packages/peach-globals/src/compositorBridgeContract.d.ts +1 -1
- package/dist-types/packages/peach-globals/src/hostStorageBridgeContract.d.ts +1 -0
- package/dist-types/packages/peach-globals/src/index.d.ts +2 -2
- package/dist-types/packages/peach-globals/src/lockstepCaptureBridgeContract.d.ts +9 -6
- package/dist-types/packages/peach-globals/src/nodeContract.d.ts +11 -0
- package/dist-types/packages/peach-globals/src/oneWidgetContract.d.ts +28 -0
- package/package.json +2 -2
- package/runtime-companion.json +1 -1
- package/sdk/ios/System/Library/Frameworks/CoreHaptics.framework/Headers/CoreHaptics.h +251 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INImage.h +14 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INIntent.h +18 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INIntentIdentifiers.h +30 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INIntentResponse.h +12 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INInteraction.h +35 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INObjectCollection.h +0 -7
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INObjectSection.h +0 -7
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INOutgoingMessageType.h +7 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INPerson.h +36 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INPersonHandle.h +22 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INSendMessageIntent+UserNotifications.h +6 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INSendMessageIntent.h +33 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INSpeakableString.h +24 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/Intents.h +11 -7
- package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMailComposeViewController.h +1 -1
- package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMessageComposeViewController.h +1 -1
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLRenderCommandEncoder.h +0 -8
- package/sdk/ios/System/Library/Frameworks/MetalTypes.framework/Headers/MetalTypes.h +8 -0
- package/sdk/ios/System/Library/Frameworks/Social.framework/Headers/SLServiceTypes.h +9 -0
- package/sdk/ios/System/Library/Frameworks/Social.framework/Headers/Social.h +1 -0
- package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotification.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationAction.h +2 -2
- package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationAttachment.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationCategory.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationContent.h +2 -2
- package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationRequest.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationResponse.h +2 -2
- package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationSound.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationTrigger.h +5 -5
- package/sdk/ios/usr/lib/swift/UIKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +4 -0
- package/sdk/ios/wasm/include/unistd.h +1 -0
- package/src/acorn-program.ts +3 -0
- package/src/audio-codec-archives.ts +141 -0
- package/src/bridge-contract-input.ts +61 -1
- package/src/bridge-contract.ts +45 -4
- package/src/bundle-channel.mjs +44 -30
- package/src/capture-contract.ts +57 -39
- package/src/conformance-comparison-contract.ts +2 -0
- package/src/expo-discovery-cache.ts +0 -2
- package/src/expo-macro-host.ts +8 -3
- package/src/expo-native-compiler-digest.ts +0 -1
- package/src/expo-native-prebuilt.ts +1 -1
- package/src/expo-native-workspace.ts +83 -45
- package/src/expo-pod-prebuilt.ts +1 -0
- package/src/expo-swift-host.ts +158 -77
- package/src/expo-swift-legacy-runtime-source.ts +12 -1
- package/src/expo-swift-view-source.ts +51 -20
- package/src/expo-workspace-exclusion.ts +7 -1
- package/src/expoSwiftContract.ts +10 -1
- package/src/ffmpeg-source-build.ts +123 -59
- package/src/genrule-archives.ts +7 -2
- package/src/genrule-library-builds.ts +101 -18
- package/src/host/bridge-host.ts +10 -1
- package/src/installed-native-libraries.ts +147 -23
- package/src/installed-package-versions.ts +30 -0
- package/src/ios-rn-bundle-request.ts +3 -1
- package/src/ios-rn-bundle.ts +38 -27
- package/src/ios-rn-compile.ts +23 -6
- package/src/ios-rn-startup.ts +2 -1
- package/src/java-module-abi.ts +4 -3
- package/src/kotlin-host.ts +4 -4
- package/src/kotlin-library-sources.ts +8 -5
- package/src/metro-production-bundle.ts +24 -0
- package/src/native-firebase-config.ts +2 -0
- package/src/native-framework-compiler.ts +5 -0
- package/src/native-package-slice-build.ts +3 -0
- package/src/native-package-slice.ts +15 -10
- package/src/native-preparation.ts +4 -1
- package/src/native-static-libraries.ts +107 -33
- package/src/nativeRuntimePackageIndex.ts +1 -4
- package/src/nitro-adapter.lock.json +286 -286
- package/src/nitro-app-providers.ts +20 -8
- package/src/nitro-compile.ts +131 -37
- package/src/nitro-dependencies.ts +42 -8
- package/src/nitro-source.ts +40 -36
- package/src/nitro-superset.lock.json +4 -4
- package/src/nitroAdapterContract.ts +32 -7
- package/src/nitroContract.ts +21 -37
- package/src/one-direct-host-source.ts +247 -140
- package/src/one-fabric.ts +129 -0
- package/src/one-native-controls-package.ts +95 -21
- package/src/one-native-controls-release.ts +147 -14
- package/src/one-native-source.ts +4 -1
- package/src/one-nitro-inputs.ts +1 -1
- package/src/one-nitro-source.ts +45 -1
- package/src/one-sdk/source.ts +10 -41
- package/src/one-widget-metadata.ts +2 -2
- package/src/one-widget-package.ts +1 -1
- package/src/oneSdkContract.ts +3 -0
- package/src/playwright-browser-paths.ts +30 -0
- package/src/pods-install.ts +6 -2
- package/src/pods-post-install.ts +2 -2
- package/src/pods-project.ts +10 -0
- package/src/podspec-ruby-stdlib.ts +73 -0
- package/src/podspec-ruby.ts +1 -1
- package/src/podspec-sources.ts +31 -13
- package/src/process-group.ts +135 -5
- package/src/published-swift-sdk.ts +25 -1
- package/src/react-native-bridge-modules.ts +35 -3
- package/src/react-native-core-build.ts +14 -2
- package/src/react-native-core.ts +12 -2
- package/src/rive-runtime-dependencies.ts +178 -40
- package/src/serverDiscoveryContract.ts +1 -1
- package/src/storageSnapshotContract.ts +1 -1
- package/src/swift-app-data-store.ts +35 -0
- package/src/swift-compile.ts +403 -121
- package/src/swift-compiler-digest.ts +4 -0
- package/src/swift-darwin-records.ts +6 -0
- package/src/swift-distribution-mirror.ts +10 -1
- package/src/swift-distribution.lock.json +19 -18
- package/src/swift-distribution.ts +17 -1
- package/src/swift-entry-module.ts +1 -0
- package/src/swift-guest-compile.ts +8 -1
- package/src/swift-host.ts +79 -23
- package/src/swift-installed-targets.ts +51 -20
- package/src/swift-objc-standin.ts +60 -8
- package/src/swift-packages.ts +104 -24
- package/src/swift-project-user.ts +2 -1
- package/src/swift-reproducible.ts +99 -1
- package/src/swift-root-lock.ts +52 -46
- package/src/swift-sdk-app-module.ts +65 -13
- package/src/swift-sdk-image-producer.ts +2 -1
- package/src/swift-sdk-image.ts +23 -8
- package/src/swift-sdk-later-data.ts +294 -44
- package/src/swift-sdk-surface.ts +233 -55
- package/src/swift-shared-sdk.ts +7 -0
- package/src/swift-standin-builtin-behavior.ts +18 -0
- package/src/swift-standin-emit.ts +242 -54
- package/src/swift-standins.ts +184 -38
- package/src/swift-startup-split.ts +19 -9
- package/src/swift-toolchain.ts +18 -0
- package/src/swift-wasm-prune.ts +179 -9
- package/src/swift-xcframework.ts +16 -0
- package/src/swiftContract.ts +4 -1
- package/src/swiftSdkLinkContract.ts +2 -0
- package/src/swiftTargetContract.ts +1 -0
- package/src/turbo-bundle.ts +6 -3
- package/src/turbo-codegen-intake.ts +106 -16
- package/src/turbo-compile.ts +89 -68
- package/src/turbo-fabric-app.ts +287 -23
- package/src/turbo-provider-host.ts +122 -31
- package/src/turbo-runtime.lock.json +26 -26
- package/src/turbo-source.ts +374 -157
- package/src/vite-plugin.ts +48 -112
- package/src/wasm-binary-sections.ts +40 -0
- package/src/wasm-code-immediates.ts +35 -5
- package/src/widget-extension-bundle.ts +15 -1
- package/src/worklet-executable.ts +2 -1
- package/src/worklet-kernel.ts +5 -3
- package/src/worklets-babel.ts +2 -1
- package/src/xcode-project.ts +151 -53
- package/src/xcode-scheme-actions.ts +104 -0
- package/cli/commands/canvas.ts +0 -1204
- package/dist-lib/esm-chunks/chunk-B5QD2KEV.mjs +0 -2787
- package/dist-lib/vendor/magic-string.cjs +0 -1693
- package/dist-types/packages/peach-compat/src/stubs/native-seams/react-native-cookies.d.ts +0 -127
- package/src/appBundleResourcesContract.ts +0 -51
- package/src/canvas-groups.ts +0 -28
- package/src/canvas-map-layout.ts +0 -161
- package/src/oneWidgetContract.ts +0 -134
package/src/swift-packages.ts
CHANGED
|
@@ -18,7 +18,12 @@ import { promisify } from 'node:util'
|
|
|
18
18
|
import { UNATTENDED_GIT_ENV, withoutGitRepositoryEnv } from './git-repo-env'
|
|
19
19
|
import { requireNativeGit } from './native-git'
|
|
20
20
|
import { tryAcquireNumberedLock } from './numbered-lock'
|
|
21
|
-
import {
|
|
21
|
+
import {
|
|
22
|
+
buildRiveRuntimeDependencies,
|
|
23
|
+
RIVE_RUNTIME_REPOSITORY,
|
|
24
|
+
RIVE_RUNTIME_SOURCES,
|
|
25
|
+
type RiveRuntimeSource,
|
|
26
|
+
} from './rive-runtime-dependencies'
|
|
22
27
|
import { resolveSwiftPackageRequirementsAsync } from './swift-distribution'
|
|
23
28
|
import {
|
|
24
29
|
isSwiftNativeTranslationUnit,
|
|
@@ -49,6 +54,7 @@ import { shippedBinaryDiffers } from './swift-shipped-binaries'
|
|
|
49
54
|
import { swiftCacheDir } from './swift-toolchain'
|
|
50
55
|
import type { GenruleArchiveDeclaration } from './genrule-archives'
|
|
51
56
|
import type { SwiftSourceLinkGraph } from './swiftContract'
|
|
57
|
+
import type { XcodeAppTarget } from './xcode-project'
|
|
52
58
|
|
|
53
59
|
// which machine a package target is built for
|
|
54
60
|
type BuildSide = 'guest' | 'host'
|
|
@@ -192,11 +198,32 @@ export const SWIFT_PLACEHOLDER_PACKAGES: ReadonlyMap<string, string> = new Map<
|
|
|
192
198
|
const placeholderPackage = (pkg: LoadedPackage) =>
|
|
193
199
|
SWIFT_PLACEHOLDER_PACKAGES.get(swiftPackageIdentity(pkg.manifest.dir))
|
|
194
200
|
|
|
201
|
+
type SourceFramework = SwiftPackages['sourceFrameworks'][number]
|
|
202
|
+
type SourceFrameworkRecipe = Omit<SourceFramework, 'packageTarget'> & { revision: string }
|
|
203
|
+
|
|
204
|
+
const riveRuntimeProject = {
|
|
205
|
+
project: 'RiveRuntime.xcodeproj',
|
|
206
|
+
target: 'RiveRuntime',
|
|
207
|
+
module: 'RiveRuntime',
|
|
208
|
+
configuration: 'Release',
|
|
209
|
+
machOType: 'mh_dylib',
|
|
210
|
+
} satisfies Omit<SourceFrameworkRecipe, 'revision'>
|
|
211
|
+
|
|
212
|
+
function riveRuntimeRecipe(source: RiveRuntimeSource): SourceFrameworkRecipe {
|
|
213
|
+
return {
|
|
214
|
+
...riveRuntimeProject,
|
|
215
|
+
revision: source.revision,
|
|
216
|
+
prepare: (checkout, moduleRoot) =>
|
|
217
|
+
buildRiveRuntimeDependencies(checkout, moduleRoot, source),
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
const riveRuntime6204 = riveRuntimeRecipe(RIVE_RUNTIME_SOURCES.v6204)
|
|
222
|
+
const riveRuntime6211 = riveRuntimeRecipe(RIVE_RUNTIME_SOURCES.v6211)
|
|
223
|
+
const riveRuntime6281 = riveRuntimeRecipe(RIVE_RUNTIME_SOURCES.v6281)
|
|
224
|
+
|
|
195
225
|
// each archive is bound to the source revision and xcode target used by its release.
|
|
196
|
-
const sourceFrameworkRecipes = new Map<
|
|
197
|
-
string,
|
|
198
|
-
Omit<SwiftPackages['sourceFrameworks'][number], 'packageTarget'> & { revision: string }
|
|
199
|
-
>([
|
|
226
|
+
const sourceFrameworkRecipes = new Map<string, SourceFrameworkRecipe>([
|
|
200
227
|
[
|
|
201
228
|
'438de2c5afb7dde20b640af35dd841961aa2aa4d2719e40c92d48bd2aa5dca56',
|
|
202
229
|
{
|
|
@@ -231,20 +258,75 @@ const sourceFrameworkRecipes = new Map<
|
|
|
231
258
|
machOType: 'mh_dylib',
|
|
232
259
|
},
|
|
233
260
|
],
|
|
261
|
+
['660bb765c3ac35a6b427b9e03a37fe16eb40b88c735078cd5a35b8c1a36e9976', riveRuntime6204],
|
|
262
|
+
['2b326bbdd4bf36494f1fd1f063c9ba46e23d193dc51c30f6956450dc06ab2b32', riveRuntime6211],
|
|
234
263
|
[
|
|
235
264
|
'b571537569a087d3637f26d416502dbdbb6f0bdc7b8f329379b40f696b093406',
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
265
|
+
riveRuntimeRecipe(RIVE_RUNTIME_SOURCES.v6280),
|
|
266
|
+
],
|
|
267
|
+
['6912ebf2cb6b5b99cac9a255f7d205cf8edf59a22fbdacd561a36d3820cc9baa', riveRuntime6281],
|
|
268
|
+
])
|
|
269
|
+
|
|
270
|
+
// CocoaPods pins the specification of the same binary release.
|
|
271
|
+
const sourceFrameworkPods = new Map<
|
|
272
|
+
string,
|
|
273
|
+
{ location: string; recipe: SourceFrameworkRecipe }
|
|
274
|
+
>([
|
|
275
|
+
[
|
|
276
|
+
'f99ddd1d4b6a420dea5943ff52502e8f92ae7a92',
|
|
277
|
+
{ location: RIVE_RUNTIME_REPOSITORY, recipe: riveRuntime6204 },
|
|
278
|
+
],
|
|
279
|
+
[
|
|
280
|
+
'b762bd437b7de47d34d0f8e670112d0b9143f8d6',
|
|
281
|
+
{ location: RIVE_RUNTIME_REPOSITORY, recipe: riveRuntime6211 },
|
|
282
|
+
],
|
|
283
|
+
[
|
|
284
|
+
'cc622dc68db440baf0b425c36d6aa068e36f5050',
|
|
285
|
+
{ location: RIVE_RUNTIME_REPOSITORY, recipe: riveRuntime6281 },
|
|
245
286
|
],
|
|
246
287
|
])
|
|
247
288
|
|
|
289
|
+
export function installedSourceFrameworkRecipe(
|
|
290
|
+
sandbox: XcodeAppTarget['cocoapods'],
|
|
291
|
+
archive: string,
|
|
292
|
+
) {
|
|
293
|
+
if (!sandbox) return undefined
|
|
294
|
+
const [pod, file, ...nested] = path
|
|
295
|
+
.relative(path.dirname(sandbox.manifestLock), archive)
|
|
296
|
+
.split(path.sep)
|
|
297
|
+
if (!pod || file !== `${pod}.xcframework` || nested.length > 0) return undefined
|
|
298
|
+
const match = sourceFrameworkPods.get(sandbox.specChecksums[pod] ?? '')
|
|
299
|
+
return match?.recipe.module === pod ? match : undefined
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
function sourceFramework(
|
|
303
|
+
{ revision: _revision, project, ...target }: SourceFrameworkRecipe,
|
|
304
|
+
checkout: string,
|
|
305
|
+
packageTarget: string,
|
|
306
|
+
): SourceFramework {
|
|
307
|
+
return { ...target, packageTarget, project: path.join(checkout, project) }
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
export async function resolveInstalledSourceFrameworks(
|
|
311
|
+
app: Pick<XcodeAppTarget, 'rootDir' | 'binaryFrameworks' | 'cocoapods'>,
|
|
312
|
+
): Promise<SourceFramework[]> {
|
|
313
|
+
const selected = app.binaryFrameworks.flatMap(({ path: archive }) => {
|
|
314
|
+
const match = archive && installedSourceFrameworkRecipe(app.cocoapods, archive)
|
|
315
|
+
return match ? [{ ...match, archive }] : []
|
|
316
|
+
})
|
|
317
|
+
if (selected.length === 0) return []
|
|
318
|
+
const checkouts = remoteSwiftCheckouts(app.rootDir)
|
|
319
|
+
fs.mkdirSync(checkouts, { recursive: true })
|
|
320
|
+
return Promise.all(
|
|
321
|
+
selected.map(async ({ recipe, location, archive }) => {
|
|
322
|
+
const pin = { location, revision: recipe.revision }
|
|
323
|
+
const identity = `${recipe.module}-${recipe.revision}`
|
|
324
|
+
await fetchCheckout(checkouts, identity, pin, undefined)
|
|
325
|
+
return sourceFramework(recipe, fetchedCheckout(checkouts, identity, pin), archive)
|
|
326
|
+
}),
|
|
327
|
+
)
|
|
328
|
+
}
|
|
329
|
+
|
|
248
330
|
/** dependency checkouts belong to peach, isolated by the canonical app root. */
|
|
249
331
|
// assembly requires its own target lowering; objective-c keeps its original bodies.
|
|
250
332
|
const UNSUPPORTED_NATIVE = /\.(s|S)$/
|
|
@@ -992,16 +1074,14 @@ export function resolveSwiftPackages(options: {
|
|
|
992
1074
|
? sourceFrameworkRecipes.get(target.checksum)
|
|
993
1075
|
: undefined
|
|
994
1076
|
if (recipe && pkg.revision === recipe.revision && name === recipe.module) {
|
|
995
|
-
sourceFrameworks.set(
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
prepare: recipe.prepare,
|
|
1004
|
-
})
|
|
1077
|
+
sourceFrameworks.set(
|
|
1078
|
+
key,
|
|
1079
|
+
sourceFramework(
|
|
1080
|
+
recipe,
|
|
1081
|
+
pkg.manifest.dir,
|
|
1082
|
+
path.join(pkg.manifest.dir, '#target', name),
|
|
1083
|
+
),
|
|
1084
|
+
)
|
|
1005
1085
|
providedTargets.delete(name)
|
|
1006
1086
|
return true
|
|
1007
1087
|
}
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
statSync,
|
|
11
11
|
} from 'node:fs'
|
|
12
12
|
import path from 'node:path'
|
|
13
|
+
import { SWIFT_PROVIDED_MODULES_PREFIX } from './swiftTargetContract'
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* the unprivileged user the compilers that read project sources run as, and
|
|
@@ -109,7 +110,7 @@ export function removeProjectLinks(root: string): void {
|
|
|
109
110
|
for (const entry of readdirSync(directory, { withFileTypes: true })) {
|
|
110
111
|
const full = path.join(directory, entry.name)
|
|
111
112
|
if (directory === root && entry.name === '.build') continue
|
|
112
|
-
if (directory === root && entry.name.startsWith(
|
|
113
|
+
if (directory === root && entry.name.startsWith(SWIFT_PROVIDED_MODULES_PREFIX)) {
|
|
113
114
|
rmSync(full, { recursive: true, force: true })
|
|
114
115
|
} else if (entry.isSymbolicLink()) rmSync(full)
|
|
115
116
|
else if (entry.isDirectory()) pending.push(full)
|
|
@@ -1,7 +1,105 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { spawnSync } from 'node:child_process'
|
|
2
|
+
import {
|
|
3
|
+
existsSync,
|
|
4
|
+
mkdtempSync,
|
|
5
|
+
readFileSync,
|
|
6
|
+
realpathSync,
|
|
7
|
+
rmSync,
|
|
8
|
+
writeFileSync,
|
|
9
|
+
} from 'node:fs'
|
|
2
10
|
import os from 'node:os'
|
|
3
11
|
import path from 'node:path'
|
|
4
12
|
|
|
13
|
+
export function expandSwiftCompileArguments(
|
|
14
|
+
args: string[],
|
|
15
|
+
cwd: string,
|
|
16
|
+
active = new Set<string>(),
|
|
17
|
+
): string[] {
|
|
18
|
+
return args.flatMap((arg) => {
|
|
19
|
+
if (!arg.startsWith('@')) return [arg]
|
|
20
|
+
const file = path.resolve(cwd, arg.slice(1))
|
|
21
|
+
if (active.has(file)) throw new Error(`recursive compiler response file: ${file}`)
|
|
22
|
+
const tokens: string[] = []
|
|
23
|
+
let token = '',
|
|
24
|
+
quote = '',
|
|
25
|
+
present = false
|
|
26
|
+
const text = readFileSync(file, 'utf8')
|
|
27
|
+
for (let i = 0; i < text.length; i++) {
|
|
28
|
+
const char = text[i]!
|
|
29
|
+
if (char === '\\') {
|
|
30
|
+
if (++i === text.length) throw new Error(`unfinished escape in ${file}`)
|
|
31
|
+
token += text[i]
|
|
32
|
+
present = true
|
|
33
|
+
} else if (quote) {
|
|
34
|
+
if (char === quote) quote = ''
|
|
35
|
+
else token += char
|
|
36
|
+
} else if (char === '"' || char === "'") {
|
|
37
|
+
quote = char
|
|
38
|
+
present = true
|
|
39
|
+
} else if (/\s/.test(char)) {
|
|
40
|
+
if (present) tokens.push(token)
|
|
41
|
+
token = ''
|
|
42
|
+
present = false
|
|
43
|
+
} else {
|
|
44
|
+
token += char
|
|
45
|
+
present = true
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (quote) throw new Error(`unfinished quote in ${file}`)
|
|
49
|
+
if (present) tokens.push(token)
|
|
50
|
+
return expandSwiftCompileArguments(tokens, cwd, new Set([...active, file]))
|
|
51
|
+
})
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function runSwiftSourceFrontend([root, frontend, ...rawArgs]: string[]): number {
|
|
55
|
+
if (!root || !frontend) throw new Error('missing Swift frontend root or executable')
|
|
56
|
+
const args = expandSwiftCompileArguments(rawArgs, root)
|
|
57
|
+
const relative = (value: string) =>
|
|
58
|
+
value.startsWith(root + path.sep) && value.endsWith('.swift')
|
|
59
|
+
? path.relative(root, value)
|
|
60
|
+
: value
|
|
61
|
+
let scratch: string | undefined
|
|
62
|
+
const temporary = () =>
|
|
63
|
+
(scratch ??= mkdtempSync(path.join(os.tmpdir(), 'swift-sources-')))
|
|
64
|
+
try {
|
|
65
|
+
for (let i = 0; i < args.length; i++) {
|
|
66
|
+
const flag = args[i]!
|
|
67
|
+
if (flag === '-filelist' || flag === '-primary-filelist') {
|
|
68
|
+
const input = args[++i]
|
|
69
|
+
if (!input) throw new Error(`missing ${flag} input`)
|
|
70
|
+
const output = path.join(temporary(), `${i}.txt`)
|
|
71
|
+
writeFileSync(
|
|
72
|
+
output,
|
|
73
|
+
readFileSync(input, 'utf8').split('\n').map(relative).join('\n'),
|
|
74
|
+
)
|
|
75
|
+
args[i] = output
|
|
76
|
+
} else if (
|
|
77
|
+
flag === '-supplementary-output-file-map' ||
|
|
78
|
+
flag === '-output-file-map'
|
|
79
|
+
) {
|
|
80
|
+
const input = args[++i]
|
|
81
|
+
if (!input) throw new Error(`missing ${flag} input`)
|
|
82
|
+
const map: Record<string, unknown> = JSON.parse(readFileSync(input, 'utf8'))
|
|
83
|
+
const output = path.join(temporary(), `${i}.json`)
|
|
84
|
+
writeFileSync(
|
|
85
|
+
output,
|
|
86
|
+
JSON.stringify(
|
|
87
|
+
Object.fromEntries(
|
|
88
|
+
Object.entries(map).map(([key, value]) => [relative(key), value]),
|
|
89
|
+
),
|
|
90
|
+
),
|
|
91
|
+
)
|
|
92
|
+
args[i] = output
|
|
93
|
+
} else args[i] = relative(flag)
|
|
94
|
+
}
|
|
95
|
+
const result = spawnSync(frontend, args, { cwd: root, stdio: 'inherit' })
|
|
96
|
+
if (result.error) throw result.error
|
|
97
|
+
return result.status ?? 1
|
|
98
|
+
} finally {
|
|
99
|
+
if (scratch) rmSync(scratch, { recursive: true, force: true })
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
5
103
|
function canonicalHomeDir(): string {
|
|
6
104
|
const home = os.homedir()
|
|
7
105
|
// agent profiles set HOME to a subdirectory whose ~/.peach symlinks into the
|
package/src/swift-root-lock.ts
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
import { AsyncLocalStorage } from 'node:async_hooks'
|
|
2
|
-
import {
|
|
3
|
-
spawn,
|
|
4
|
-
type ChildProcess,
|
|
5
|
-
type ChildProcessByStdio,
|
|
6
|
-
type SpawnOptions,
|
|
7
|
-
} from 'node:child_process'
|
|
8
2
|
import { createHash, randomUUID } from 'node:crypto'
|
|
9
3
|
import {
|
|
10
4
|
closeSync,
|
|
@@ -20,9 +14,17 @@ import {
|
|
|
20
14
|
} from 'node:fs'
|
|
21
15
|
import { homedir } from 'node:os'
|
|
22
16
|
import path from 'node:path'
|
|
23
|
-
import {
|
|
17
|
+
import {
|
|
18
|
+
killOrphanedProcessGroup,
|
|
19
|
+
spawnOwnedProcessGroup,
|
|
20
|
+
terminateProcessGroup,
|
|
21
|
+
} from './process-group'
|
|
24
22
|
import { readProcessTable, type ProcessRow } from './process-table.ts'
|
|
25
|
-
import type {
|
|
23
|
+
import type {
|
|
24
|
+
ChildProcess,
|
|
25
|
+
ChildProcessWithoutNullStreams,
|
|
26
|
+
SpawnOptions,
|
|
27
|
+
} from 'node:child_process'
|
|
26
28
|
|
|
27
29
|
const POLL_MS = 250
|
|
28
30
|
const INSPECT_ATTEMPTS = 5
|
|
@@ -33,6 +35,7 @@ const START_TOLERANCE_MS = 2_000
|
|
|
33
35
|
interface Identity {
|
|
34
36
|
pid: number
|
|
35
37
|
start: number
|
|
38
|
+
monitored?: boolean
|
|
36
39
|
}
|
|
37
40
|
|
|
38
41
|
interface Generation {
|
|
@@ -103,7 +106,11 @@ function parseIdentity(text: string): Identity {
|
|
|
103
106
|
'start' in value &&
|
|
104
107
|
typeof value.start === 'number'
|
|
105
108
|
)
|
|
106
|
-
return {
|
|
109
|
+
return {
|
|
110
|
+
pid: value.pid,
|
|
111
|
+
start: value.start,
|
|
112
|
+
monitored: 'monitored' in value && value.monitored === true,
|
|
113
|
+
}
|
|
107
114
|
throw new Error(`swift root lock record is not a process identity: ${text}`)
|
|
108
115
|
}
|
|
109
116
|
|
|
@@ -151,17 +158,24 @@ function readGeneration(directory: string, number: number): Generation | null {
|
|
|
151
158
|
// reading them after the holder is seen dead lists every one it started.
|
|
152
159
|
function readChildren(directory: string, number: number): Identity[] {
|
|
153
160
|
const prefix = name(number, 'child.')
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
161
|
+
const children: Identity[] = []
|
|
162
|
+
for (const entry of readdirSync(directory)) {
|
|
163
|
+
if (!entry.startsWith(prefix)) continue
|
|
164
|
+
try {
|
|
165
|
+
children.push(parseIdentity(readFileSync(path.join(directory, entry), 'utf8')))
|
|
166
|
+
} catch (error) {
|
|
167
|
+
if (errorCode(error) !== 'ENOENT') throw error
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
return children
|
|
157
171
|
}
|
|
158
172
|
|
|
159
173
|
// a child leads its own session, so its group is its pid; a group id stays
|
|
160
174
|
// taken while any member lives, so a leader started later is another process.
|
|
161
|
-
function
|
|
175
|
+
function liveGroupMember(table: ProcessRow[], leader: Identity): ProcessRow | undefined {
|
|
162
176
|
const row = table.find((candidate) => candidate.pid === leader.pid)
|
|
163
|
-
if (row && !sameProcess(row, leader)) return
|
|
164
|
-
return table.
|
|
177
|
+
if (row && !sameProcess(row, leader)) return
|
|
178
|
+
return table.find((candidate) => candidate.pgid === leader.pid && !candidate.zombie)
|
|
165
179
|
}
|
|
166
180
|
|
|
167
181
|
/** compiler processes whose lifetime the root lock covers. */
|
|
@@ -174,8 +188,8 @@ export interface SwiftRootLease {
|
|
|
174
188
|
args: string[],
|
|
175
189
|
options: SpawnOptions,
|
|
176
190
|
companion?: SwiftRootLease,
|
|
177
|
-
):
|
|
178
|
-
register(child: ChildProcess): void
|
|
191
|
+
): ChildProcessWithoutNullStreams
|
|
192
|
+
register(child: ChildProcess, monitored?: boolean): void
|
|
179
193
|
}
|
|
180
194
|
|
|
181
195
|
function linuxMountPath(existing: string): string {
|
|
@@ -394,15 +408,21 @@ export async function withSwiftRootLock<T>(
|
|
|
394
408
|
const children = readChildren(directory, newest)
|
|
395
409
|
if (children.length) {
|
|
396
410
|
const table = await processTableWithRetry(undefined, signal)
|
|
397
|
-
const orphaned =
|
|
411
|
+
const orphaned: number[] = []
|
|
412
|
+
const denied: number[] = []
|
|
413
|
+
for (const child of children) {
|
|
414
|
+
const member = liveGroupMember(table, child)
|
|
415
|
+
if (!member) continue
|
|
416
|
+
orphaned.push(child.pid)
|
|
417
|
+
// the monitor must reach the detached frontends before the driver dies.
|
|
418
|
+
if (!child.monitored && !killOrphanedProcessGroup(child.pid, member.pid))
|
|
419
|
+
denied.push(child.pid)
|
|
420
|
+
}
|
|
398
421
|
if (orphaned.length) {
|
|
399
|
-
// nothing reads a dead holder's compiler output, so its groups only
|
|
400
|
-
// keep the root from the next build. the root stays held until they
|
|
401
|
-
// are gone, and a group that refuses the kill keeps it held.
|
|
402
|
-
for (const child of orphaned) killOrphanedProcessGroup(child.pid)
|
|
403
422
|
if (!wait) return undefined
|
|
404
423
|
await waiting(
|
|
405
|
-
`stopping compiler groups ${orphaned.
|
|
424
|
+
`stopping compiler groups ${orphaned.join(', ')} left by dead pid ${identity.pid}` +
|
|
425
|
+
(denied.length ? ` (signal denied for ${denied.join(', ')})` : ''),
|
|
406
426
|
)
|
|
407
427
|
continue
|
|
408
428
|
}
|
|
@@ -436,40 +456,26 @@ export async function withSwiftRootLock<T>(
|
|
|
436
456
|
}
|
|
437
457
|
const children: ChildProcess[] = []
|
|
438
458
|
const lease: SwiftRootLease = {
|
|
439
|
-
register(child) {
|
|
459
|
+
register(child, monitored) {
|
|
440
460
|
const index = children.push(child)
|
|
441
461
|
if (child.pid === undefined) throw new Error('could not register compiler process')
|
|
442
462
|
// a long hold outlives the pid space, so a pid can name two children.
|
|
443
463
|
const childPending = `${pending}.child.${index}`
|
|
444
464
|
try {
|
|
445
|
-
writeFileSync(
|
|
465
|
+
writeFileSync(
|
|
466
|
+
childPending,
|
|
467
|
+
JSON.stringify({ ...ownIdentity(child.pid), monitored }),
|
|
468
|
+
)
|
|
446
469
|
linkSync(childPending, path.join(directory, name(held, `child.${index}`)))
|
|
447
470
|
} finally {
|
|
448
471
|
rmSync(childPending, { force: true })
|
|
449
472
|
}
|
|
450
473
|
},
|
|
451
474
|
spawn(command, args, options, companion) {
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
['-c', 'IFS= read -r go || exit 1; exec "$@" </dev/null', 'sh', command, ...args],
|
|
457
|
-
{ ...options, detached: true, stdio: ['pipe', 'pipe', 'pipe'] },
|
|
458
|
-
)
|
|
459
|
-
child.stdin!.on('error', () => {})
|
|
460
|
-
if (child.pid === undefined) {
|
|
461
|
-
child.stdin!.destroy()
|
|
462
|
-
return child
|
|
463
|
-
}
|
|
464
|
-
try {
|
|
465
|
-
lease.register(child)
|
|
466
|
-
companion?.register(child)
|
|
467
|
-
} catch (error) {
|
|
468
|
-
child.stdin!.destroy()
|
|
469
|
-
throw error
|
|
470
|
-
}
|
|
471
|
-
child.stdin!.end('go\n')
|
|
472
|
-
return child
|
|
475
|
+
return spawnOwnedProcessGroup(command, args, options, (child) => {
|
|
476
|
+
lease.register(child, true)
|
|
477
|
+
companion?.register(child, true)
|
|
478
|
+
})
|
|
473
479
|
},
|
|
474
480
|
}
|
|
475
481
|
try {
|
|
@@ -49,6 +49,7 @@ import {
|
|
|
49
49
|
passiveSegments,
|
|
50
50
|
wasmReader,
|
|
51
51
|
wasmSections,
|
|
52
|
+
type SwiftSdkInterface,
|
|
52
53
|
} from './swift-sdk-image-wasm'
|
|
53
54
|
import {
|
|
54
55
|
guestWasmSymbols,
|
|
@@ -172,7 +173,12 @@ export async function buildSwiftAppModule(options: {
|
|
|
172
173
|
: {}),
|
|
173
174
|
...(options.sourceModules.length ? { sourceModules: options.sourceModules } : {}),
|
|
174
175
|
})
|
|
175
|
-
|
|
176
|
+
const { swiftAppDataPieces } = await import('./swift-sdk-later-data')
|
|
177
|
+
return {
|
|
178
|
+
...binding,
|
|
179
|
+
appLink,
|
|
180
|
+
appData: swiftAppDataPieces(link.map, readFileSync(link.linked), link.linkage.data),
|
|
181
|
+
}
|
|
176
182
|
}
|
|
177
183
|
|
|
178
184
|
export function swiftAppModuleThunkSection(
|
|
@@ -517,13 +523,20 @@ export async function linkSwiftAppModule(options: {
|
|
|
517
523
|
const lazy = options.lazyFunctions ?? []
|
|
518
524
|
const lazyExports = path.join(work, 'lazy-exports.rsp')
|
|
519
525
|
writeFileSync(lazyExports, guestLazyExports(lazy))
|
|
526
|
+
const linkObjects = path.join(work, 'app-objects.rsp')
|
|
527
|
+
writeFileSync(
|
|
528
|
+
linkObjects,
|
|
529
|
+
objects.map((file) => JSON.stringify(file)).join('\n') + '\n',
|
|
530
|
+
)
|
|
520
531
|
const linked = path.join(work, 'app.wasm')
|
|
532
|
+
// the map and relocations also give the app's data pieces for deferring its own data
|
|
533
|
+
const map = options.layoutMap ?? path.join(work, 'app.map')
|
|
521
534
|
await run(
|
|
522
535
|
path.join(toolchainBin, 'wasm-ld'),
|
|
523
536
|
[
|
|
524
537
|
'-m',
|
|
525
538
|
'wasm64',
|
|
526
|
-
|
|
539
|
+
`@${linkObjects}`,
|
|
527
540
|
'--import-memory',
|
|
528
541
|
'--shared-memory',
|
|
529
542
|
'--max-memory=4294967296',
|
|
@@ -547,7 +560,7 @@ export async function linkSwiftAppModule(options: {
|
|
|
547
560
|
'--gc-sections',
|
|
548
561
|
'--keep-section=target_features',
|
|
549
562
|
'--error-limit=0',
|
|
550
|
-
|
|
563
|
+
`--Map=${map}`,
|
|
551
564
|
'-o',
|
|
552
565
|
linked,
|
|
553
566
|
],
|
|
@@ -569,6 +582,8 @@ export async function linkSwiftAppModule(options: {
|
|
|
569
582
|
linkage,
|
|
570
583
|
staticEnd,
|
|
571
584
|
globalValues,
|
|
585
|
+
map,
|
|
586
|
+
linked,
|
|
572
587
|
async lower() {
|
|
573
588
|
await lowerWasm(module, options.output, {
|
|
574
589
|
optimize,
|
|
@@ -1245,17 +1260,47 @@ function expandSdkRelocations(
|
|
|
1245
1260
|
])
|
|
1246
1261
|
}
|
|
1247
1262
|
|
|
1263
|
+
function assertSwiftSdkBindings(
|
|
1264
|
+
linkage: SwiftSdkAppLinkage,
|
|
1265
|
+
sdk: SwiftSdkInterface,
|
|
1266
|
+
key: string,
|
|
1267
|
+
names?: ReadonlyMap<string, string>,
|
|
1268
|
+
) {
|
|
1269
|
+
const { functions, signatures, data, tls } = sdk
|
|
1270
|
+
const label = (name: string) => names?.get(name) ?? name
|
|
1271
|
+
const problems = new Set<string>()
|
|
1272
|
+
for (const { name, signature } of linkage.functions) {
|
|
1273
|
+
if (functions[name] === undefined)
|
|
1274
|
+
problems.add(`missing function ${label(name)} (${signature})`)
|
|
1275
|
+
else if (signatures[name] !== signature)
|
|
1276
|
+
problems.add(
|
|
1277
|
+
`changed signature for ${label(name)}: expected ${signature}, got ${signatures[name]}`,
|
|
1278
|
+
)
|
|
1279
|
+
}
|
|
1280
|
+
const projection = linkage.replayProjection
|
|
1281
|
+
const optional =
|
|
1282
|
+
projection && projection.sdk !== key ? new Set(projection.lookupValues) : undefined
|
|
1283
|
+
for (const [index, { kind, name }] of linkage.values.entries()) {
|
|
1284
|
+
const symbol =
|
|
1285
|
+
kind === 'function' ? functions[name] : kind === 'address' ? data[name] : tls[name]
|
|
1286
|
+
if (symbol === undefined && !optional?.has(index))
|
|
1287
|
+
problems.add(`missing ${kind} symbol ${label(name)}`)
|
|
1288
|
+
else if (symbol !== undefined && kind === 'tls' && tls.errno === undefined)
|
|
1289
|
+
problems.add('missing TLS base symbol errno')
|
|
1290
|
+
}
|
|
1291
|
+
if (problems.size)
|
|
1292
|
+
throw new Error(
|
|
1293
|
+
`Swift SDK linkage mismatch (${problems.size}):\n ${[...problems].join('\n ')}`,
|
|
1294
|
+
)
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1248
1297
|
export function bindSwiftAppModule(
|
|
1249
1298
|
linkage: SwiftSdkAppLinkage,
|
|
1250
1299
|
sdk: SwiftSdkImage,
|
|
1251
1300
|
): Uint8Array {
|
|
1252
|
-
|
|
1253
|
-
const
|
|
1254
|
-
|
|
1255
|
-
if (slot === undefined || signatures[name] !== signature)
|
|
1256
|
-
throw new Error(`SDK image has no compatible function ${name}`)
|
|
1257
|
-
return slot
|
|
1258
|
-
})
|
|
1301
|
+
assertSwiftSdkBindings(linkage, sdk.sdkInterface, sdk.key)
|
|
1302
|
+
const { functions, data, tls } = sdk.sdkInterface
|
|
1303
|
+
const slots = Uint32Array.from(linkage.functions, ({ name }) => functions[name]!)
|
|
1259
1304
|
const projection =
|
|
1260
1305
|
linkage.replayProjection?.sdk === sdk.key ? undefined : linkage.replayProjection
|
|
1261
1306
|
const optional = projection && new Set(projection.lookupValues)
|
|
@@ -1263,8 +1308,8 @@ export function bindSwiftAppModule(
|
|
|
1263
1308
|
const value =
|
|
1264
1309
|
kind === 'function' ? functions[name] : kind === 'address' ? data[name] : tls[name]
|
|
1265
1310
|
if (value === undefined && optional?.has(index)) return 0n
|
|
1266
|
-
if (value === undefined
|
|
1267
|
-
throw new Error(`
|
|
1311
|
+
if (value === undefined)
|
|
1312
|
+
throw new Error(`missing bound Swift SDK ${kind} symbol ${name}`)
|
|
1268
1313
|
return BigInt(value + addend - (kind === 'tls' ? tls.errno! : 0))
|
|
1269
1314
|
})
|
|
1270
1315
|
const fixups = projection
|
|
@@ -2139,7 +2184,14 @@ export async function rebindSwiftSdkAppLink(
|
|
|
2139
2184
|
distribution,
|
|
2140
2185
|
link.scopedLookups,
|
|
2141
2186
|
link.sdkFrameworkImports,
|
|
2142
|
-
{
|
|
2187
|
+
{
|
|
2188
|
+
requiredGuestSymbols,
|
|
2189
|
+
sourceModules: link.sourceModules,
|
|
2190
|
+
dev,
|
|
2191
|
+
devBase,
|
|
2192
|
+
verifyLinkage: (key, sdk, names) =>
|
|
2193
|
+
assertSwiftSdkBindings(linkage, sdk, key, names),
|
|
2194
|
+
},
|
|
2143
2195
|
)
|
|
2144
2196
|
const sdkMs = Math.round(performance.now() - started)
|
|
2145
2197
|
return { sdk, sdkMs, binding: replaySwiftSdkBinding(link, sdk) }
|
|
@@ -281,6 +281,7 @@ export async function produceSwiftSdkImage(input: {
|
|
|
281
281
|
renameSync(next, current)
|
|
282
282
|
const admitted = windowAdmission()?.cores ?? Number(process.env.TM_EXEC_CPU_CORES)
|
|
283
283
|
const cores = swiftSdkProducerCores(admitted)
|
|
284
|
+
// a build job, not an agent: hidden from chat lists and plain `tm list` like `tm exec` and deploy canaries
|
|
284
285
|
const launched = await run(
|
|
285
286
|
'tm',
|
|
286
287
|
[
|
|
@@ -304,7 +305,7 @@ export async function produceSwiftSdkImage(input: {
|
|
|
304
305
|
input.frameworkKey,
|
|
305
306
|
process.env.CONTRAST_LAND_CHECK === '1' ? '1' : '',
|
|
306
307
|
],
|
|
307
|
-
{ cwd: repo },
|
|
308
|
+
{ cwd: repo, env: { ...process.env, TM_ROSTER_HIDDEN: '1' } },
|
|
308
309
|
)
|
|
309
310
|
if (!launched.stdout.trim())
|
|
310
311
|
throw new Error(`Swift SDK producer launch was not confirmed: ${directory}`)
|