peachsim 0.1.1674 → 0.1.1692
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/cli/commands/control.ts +13 -1
- package/cli/commands/coverage-swift.ts +150 -27
- package/cli/commands/coverage.ts +219 -20
- package/cli/commands/detect.ts +10 -6
- package/cli/commands/inspect/actions.ts +1 -0
- package/cli/commands/inspect/core.ts +2 -0
- package/cli/commands/inspect/wait-ready.ts +7 -0
- package/cli/commands/screenshot.ts +12 -0
- package/cli/outbound-endpoints.ts +12 -0
- package/detox/index.ts +11 -1
- package/detox/jest-environment.cjs +14 -0
- 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 +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/bundle-channel.cjs +4833 -2432
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +1 -1
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +1 -1
- package/dist-lib/detox/index.cjs +6 -4
- package/dist-lib/detox/jest-environment.cjs +14 -0
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +3785 -1737
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +4253 -2205
- package/dist-lib/host/fetch-proxy-handler.cjs +20 -7
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +2065 -796
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/jump-to-source-native.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +6325 -4287
- package/dist-lib/native-app-identity-project.cjs +192 -55
- package/dist-lib/native-app-identity-project.mjs +235 -86
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +1 -1
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +27 -23
- package/dist-lib/public-origins-lib-static.json +1 -1
- package/dist-lib/public-origins-lib.json +156 -87
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/reap-browser.cjs +2 -2
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +3 -2
- package/dist-lib/sdk.mjs +3 -2
- package/dist-lib/skills.cjs +5036 -2833
- package/dist-lib/swift-compile.cjs +2937 -437
- package/dist-lib/swift-compile.mjs +2932 -435
- package/dist-lib/swift-package.cjs +137 -49
- package/dist-lib/swift-package.mjs +132 -49
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +1 -1
- package/dist-lib/swift-toolchain.cjs +26 -11
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +6005 -1725
- package/dist-lib/vite.cjs +1911 -776
- package/dist-lib/worklet-executable.cjs +7 -4
- package/dist-lib/worklet-executable.mjs +7 -4
- package/dist-types/packages/peach-engine/src/engine/canvaskit-api.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/engine/clipboardContract.d.ts +24 -2
- package/dist-types/packages/peach-engine/src/preview/upload-protocol.d.ts +11 -3
- package/dist-types/packages/peach-engine/src/webview-automation-host.d.ts +6 -0
- package/dist-types/packages/peach-globals/src/clipboardBridgeContract.d.ts +8 -0
- package/dist-types/packages/peach-globals/src/index.d.ts +1 -1
- package/dist-types/packages/peach-globals/src/nodeContract.d.ts +3 -2
- package/dist-types/packages/peach-kit/src/capabilities.d.ts +1 -0
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h +60 -2
- package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLAvailability.h +22 -0
- package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLBackgroundActivitySession.h +145 -0
- package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLBeaconIdentityCondition.h +113 -0
- package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLBeaconIdentityConstraint.h +34 -0
- package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLBeaconRegion.h +225 -0
- package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLBody.h +26 -0
- package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLCircularGeographicCondition.h +59 -0
- package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLCircularRegion.h +64 -0
- package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLCondition.h +48 -0
- package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLError.h +52 -0
- package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLErrorDomain.h +24 -0
- package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLGeocoder.h +55 -0
- package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLHeading.h +117 -0
- package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocation.h +9 -0
- package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocationManager+CLVisitExtensions.h +45 -0
- package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocationManager.h +877 -0
- package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocationManagerDelegate.h +225 -0
- package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocationPushServiceError.h +33 -0
- package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocationPushServiceExtension.h +28 -0
- package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocationUpdater.h +250 -0
- package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLMonitor.h +140 -0
- package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLMonitorConfiguration.h +77 -0
- package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLMonitoringEvent.h +184 -0
- package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLMonitoringRecord.h +57 -0
- package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLPlacemark.h +98 -0
- package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLRegion.h +123 -0
- package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLServiceSession.h +211 -0
- package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLVisit.h +66 -0
- package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CoreLocation.h +46 -0
- package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Modules/module.modulemap +7 -0
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h +117 -2
- package/sdk/ios/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceBase.h +52 -0
- package/sdk/ios/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceObjC.h +240 -0
- package/sdk/ios/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceRef.h +474 -0
- package/sdk/ios/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceTypes.h +66 -0
- package/sdk/ios/System/Library/Frameworks/IOSurface.framework/Modules/module.modulemap +10 -0
- package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFComposeAssistantViewController.h +29 -0
- package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMailComposeControllerDeferredAction.h +14 -0
- package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMailComposeViewController.h +162 -0
- package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMailDraft.h +24 -0
- package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMessageComposeViewController+UPI.h +31 -0
- package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMessageComposeViewController.h +169 -0
- package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MessageUI.h +13 -0
- package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Modules/module.modulemap +11 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4AccelerationStructure.h +9 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4Archive.h +16 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4ArgumentTable.h +17 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4BinaryFunction.h +13 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4BinaryFunctionDescriptor.h +14 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4BufferRange.h +79 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4CommandAllocator.h +15 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4CommandBuffer.h +17 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4CommandEncoder.h +16 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4CommandQueue.h +19 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4CommitFeedback.h +15 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4Compiler.h +13 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4CompilerTask.h +13 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4ComputeCommandEncoder.h +19 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4ComputePipeline.h +13 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4Counters.h +19 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4FunctionDescriptor.h +13 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4LibraryDescriptor.h +13 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4LibraryFunctionDescriptor.h +13 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4LinkingDescriptor.h +13 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4MachineLearningCommandEncoder.h +17 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4MachineLearningPipeline.h +13 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4MeshRenderPipeline.h +13 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4PipelineDataSetSerializer.h +13 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4PipelineState.h +13 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4RenderCommandEncoder.h +17 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4RenderPass.h +17 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4RenderPipeline.h +13 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4SpecializedFunctionDescriptor.h +13 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4StitchedFunctionDescriptor.h +13 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4TileRenderPipeline.h +13 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLAccelerationStructure.h +1212 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLAccelerationStructureCommandEncoder.h +322 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLAccelerationStructureTypes.h +224 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLAllocation.h +22 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLArgument.h +279 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLArgumentEncoder.h +199 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLBinaryArchive.h +142 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLBlitCommandEncoder.h +266 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLBlitPass.h +82 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLBuffer.h +94 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLCaptureManager.h +113 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLCaptureScope.h +43 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLCommandBuffer.h +449 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLCommandEncoder.h +148 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLCommandQueue.h +102 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLComputeCommandEncoder.h +350 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLComputePass.h +90 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLComputePipeline.h +274 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLCounters.h +225 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLDataType.h +232 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLDefines.h +39 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLDepthStencil.h +93 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLDevice.h +1122 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLDeviceCertification.h +29 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLDrawable.h +36 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLDynamicLibrary.h +81 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLEvent.h +79 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLFence.h +22 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLFunctionConstantValues.h +30 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLFunctionDescriptor.h +95 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLFunctionHandle.h +29 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLFunctionLog.h +37 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLFunctionStitching.h +131 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLGPUAddress.h +19 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLHeap.h +284 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLIOCommandBuffer.h +10 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLIOCommandQueue.h +11 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLIOCompressor.h +10 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLIndirectCommandBuffer.h +157 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLIndirectCommandEncoder.h +110 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLIntersectionFunctionTable.h +186 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLLibrary.h +549 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLLinkedFunctions.h +57 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLLogState.h +65 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLParallelRenderCommandEncoder.h +77 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLPipeline.h +57 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLPixelFormat.h +342 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLRasterizationRate.h +323 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLRenderCommandEncoder.h +1068 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLRenderPass.h +411 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLRenderPipeline.h +788 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLResidencySet.h +141 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLResource.h +307 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLResourceStateCommandEncoder.h +125 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLResourceStatePass.h +85 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLResourceViewPool.h +22 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLSampler.h +252 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLStageInputOutputDescriptor.h +158 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLTensor.h +17 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLTexture.h +460 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLTextureViewPool.h +18 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLTypes.h +125 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLVertexDescriptor.h +153 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLVisibleFunctionTable.h +45 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/Metal.h +94 -0
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Modules/module.modulemap +6 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h +10 -0
- package/sdk/ios/System/Library/Frameworks/UniformTypeIdentifiers.framework/Headers/UTDefines.h +35 -0
- package/sdk/ios/System/Library/Frameworks/UniformTypeIdentifiers.framework/Headers/UTTagClass.h +33 -0
- package/sdk/ios/System/Library/Frameworks/UniformTypeIdentifiers.framework/Headers/UTType.h +504 -0
- package/sdk/ios/System/Library/Frameworks/_LocationEssentials.framework/Headers/CLEssentialsAvailability.h +14 -0
- package/sdk/ios/System/Library/Frameworks/_LocationEssentials.framework/Headers/CLLocationEssentials.h +444 -0
- package/sdk/ios/System/Library/Frameworks/_LocationEssentials.framework/Headers/LocationEssentials.h +14 -0
- package/sdk/ios/System/Library/Frameworks/_LocationEssentials.framework/Modules/module.modulemap +14 -0
- package/sdk/ios/usr/include/arm/param.h +151 -0
- package/sdk/ios/usr/include/complex.h +167 -0
- package/sdk/ios/usr/include/dispatch/dispatch.h +8 -0
- package/sdk/ios/usr/include/dlfcn.h +1 -2
- package/sdk/ios/usr/include/mach/mach_types.h +1 -0
- package/sdk/ios/usr/include/machine/param.h +42 -0
- package/sdk/ios/usr/include/math.h +835 -2
- package/sdk/ios/usr/include/net/if.h +1 -2
- package/sdk/ios/usr/include/peach/pthread.h +4 -4
- package/sdk/ios/usr/include/pthread/qos.h +304 -0
- package/sdk/ios/usr/include/sys/_types/_fd_clr.h +31 -0
- package/sdk/ios/usr/include/sys/_types/_fd_copy.h +31 -0
- package/sdk/ios/usr/include/sys/_types/_fd_def.h +121 -0
- package/sdk/ios/usr/include/sys/_types/_fd_isset.h +31 -0
- package/sdk/ios/usr/include/sys/_types/_fd_set.h +31 -0
- package/sdk/ios/usr/include/sys/_types/_fd_setsize.h +31 -0
- package/sdk/ios/usr/include/sys/_types/_fd_zero.h +31 -0
- package/sdk/ios/usr/include/sys/cdefs.h +3 -1
- package/sdk/ios/usr/include/sys/param.h +235 -0
- package/sdk/ios/usr/include/sys/proc.h +1 -0
- package/sdk/ios/usr/include/sys/qos.h +151 -12
- package/sdk/ios/wasm/include/__typedef_sigset_t.h +7 -0
- package/sdk/ios/wasm/include/fcntl.h +11 -0
- package/sdk/ios/wasm/include/mach/machine/boolean.h +2 -0
- package/sdk/ios/wasm/include/mach/machine/exception.h +5 -0
- package/sdk/ios/wasm/include/mach/machine/kern_return.h +2 -0
- package/sdk/ios/wasm/include/mach/machine/processor_info.h +2 -0
- package/sdk/ios/wasm/include/mach/machine/rpc.h +2 -0
- package/sdk/ios/wasm/include/mach/machine/thread_state.h +3 -0
- package/sdk/ios/wasm/include/mach/machine/thread_status.h +3 -0
- package/sdk/ios/wasm/include/mach/machine/vm_param.h +3 -0
- package/sdk/ios/wasm/include/mach/machine/vm_types.h +18 -0
- package/sdk/ios/wasm/include/machine/_types.h +153 -0
- package/sdk/ios/wasm/include/machine/endian.h +2 -0
- package/sdk/ios/wasm/include/machine/limits.h +2 -0
- package/sdk/ios/wasm/include/machine/types.h +30 -0
- package/sdk/ios/wasm/include/poll.h +8 -0
- package/sdk/ios/wasm/include/pthread.h +50 -0
- package/sdk/ios/wasm/include/signal.h +72 -0
- package/sdk/ios/wasm/include/stdlib.h +3 -0
- package/sdk/ios/wasm/include/string.h +10 -0
- package/sdk/ios/wasm/include/sys/_pthread/_pthread_attr_t.h +7 -0
- package/sdk/ios/wasm/include/sys/_pthread/_pthread_t.h +7 -0
- package/sdk/ios/wasm/include/sys/mman.h +122 -0
- package/sdk/ios/wasm/include/sys/select.h +37 -0
- package/sdk/ios/wasm/include/sys/signal.h +259 -0
- package/sdk/ios/wasm/include/sys/socket.h +8 -0
- package/sdk/ios/wasm/include/sys/types.h +14 -0
- package/sdk/ios/wasm/include/sys/ucontext.h +1 -0
- package/sdk/ios/wasm/include/sys/uio.h +11 -0
- package/sdk/ios/wasm/include/sys/wait.h +89 -0
- package/sdk/ios/wasm/include/time.h +8 -0
- package/sdk/ios/wasm/include/unistd.h +17 -0
- package/src/bridge-contract.ts +2 -0
- package/src/chromium-admission.ts +10 -5
- package/src/device-catalog.ts +4 -4
- package/src/generated/swift-c-predefines.json +1988 -0
- package/src/host/fetch-proxy-handler.ts +20 -0
- package/src/metro-plugin.ts +5 -2
- package/src/nitro-adapter.lock.json +6 -6
- package/src/nitro-bundle.ts +1 -0
- package/src/nitro-compile.ts +67 -2
- package/src/nitroContract.ts +18 -2
- package/src/numbered-lock.ts +72 -0
- package/src/react-native-coverage/capability-reference-resolution.ts +62 -5
- package/src/react-native-coverage/capability-source-references.ts +50 -13
- package/src/react-native-coverage/native-source-credit.ts +126 -0
- package/src/react-native-coverage/native-source-ranges-file.ts +38 -0
- package/src/react-native-coverage/native-surface.ts +49 -0
- package/src/react-native-coverage/verified-reach.ts +22 -2
- package/src/runtime-assets.ts +17 -0
- package/src/swift-compile.ts +530 -97
- package/src/swift-coverage/indexing.ts +17 -1
- package/src/swift-coverage/package.ts +3 -1
- package/src/swift-coverage/sdk.ts +71 -0
- package/src/swift-coverage/source.ts +74 -2
- package/src/swift-coverage/types.ts +6 -0
- package/src/swift-coverage/xcode-assets.ts +62 -2
- package/src/swift-coverage/xcode-packages.ts +11 -6
- package/src/swift-distribution.lock.json +12 -12
- package/src/swift-host.ts +457 -62
- package/src/swift-objc-compile.ts +26 -26
- package/src/swift-objc-metadata.ts +2 -8
- package/src/swift-objc-platform.ts +53 -0
- package/src/swift-objc-standin.ts +66 -12
- package/src/swift-package-manifest.ts +196 -28
- package/src/swift-package.ts +186 -60
- package/src/swift-packages.ts +298 -88
- package/src/swift-source-file.ts +10 -15
- package/src/swift-source-pods.ts +288 -0
- package/src/swift-standins.ts +87 -13
- package/src/swift-submit.ts +5 -0
- package/src/swift-toolchain.ts +32 -10
- package/src/swiftContract.ts +160 -75
- package/src/target-matcher.ts +15 -2
- package/src/vite-plugin-one.ts +5 -4
- package/src/worker-system-chunks.ts +7 -1
- package/src/worklet-executable.ts +7 -3
- package/src/xcode-json-project.ts +14 -2
- package/src/xcode-project.ts +193 -69
package/src/swift-packages.ts
CHANGED
|
@@ -12,6 +12,7 @@ import { createHash } from 'node:crypto'
|
|
|
12
12
|
import fs from 'node:fs'
|
|
13
13
|
import path from 'node:path'
|
|
14
14
|
import { cacheDir } from './home-paths'
|
|
15
|
+
import { tryAcquireNumberedLock } from './numbered-lock'
|
|
15
16
|
import {
|
|
16
17
|
swiftImplicitResourcePaths,
|
|
17
18
|
swiftPackageIdentity,
|
|
@@ -20,17 +21,22 @@ import {
|
|
|
20
21
|
} from './swift-package'
|
|
21
22
|
import {
|
|
22
23
|
swiftPackageManifest,
|
|
24
|
+
swiftProductDependency,
|
|
23
25
|
swiftTargetFiles,
|
|
24
26
|
type SwiftManifestSetting,
|
|
27
|
+
type SwiftManifestTarget,
|
|
25
28
|
type SwiftPackageManifest,
|
|
26
29
|
} from './swift-package-manifest'
|
|
27
30
|
|
|
31
|
+
// which machine a package target is built for
|
|
32
|
+
type BuildSide = 'guest' | 'host'
|
|
33
|
+
|
|
28
34
|
/** where a linked product comes from, as the project names it. */
|
|
29
35
|
export type SwiftPackageSource =
|
|
30
36
|
| { kind: 'local'; dir: string }
|
|
31
37
|
| { kind: 'remote'; url: string }
|
|
32
|
-
/** a product xcode finds by name among the
|
|
33
|
-
| { kind: 'unnamed' }
|
|
38
|
+
/** a product xcode finds by name among the packages the workspace references. */
|
|
39
|
+
| { kind: 'unnamed'; remoteUrls: string[] }
|
|
34
40
|
|
|
35
41
|
export interface SwiftLinkedProduct {
|
|
36
42
|
product: string
|
|
@@ -44,9 +50,14 @@ export interface SwiftPackageSourceTarget extends SwiftPackageTarget {
|
|
|
44
50
|
/** the package directory, so a manifest edit reaches the compile. */
|
|
45
51
|
packageDir: string
|
|
46
52
|
remote: boolean
|
|
53
|
+
/** the iOS version its package declares, which actool compiles the target's catalogs for. */
|
|
54
|
+
iosDeployment: string | null
|
|
47
55
|
/** the conditions its manifest defines, before a build configuration picks them. */
|
|
48
56
|
packageDefines: SwiftManifestSetting[]
|
|
49
57
|
packageLibraries: SwiftManifestSetting[]
|
|
58
|
+
packageExperimentalFeatures: SwiftManifestSetting[]
|
|
59
|
+
packageUpcomingFeatures: SwiftManifestSetting[]
|
|
60
|
+
packageSwiftFlags: SwiftManifestTarget['swiftFlags']
|
|
50
61
|
}
|
|
51
62
|
|
|
52
63
|
/** why a product or module does not compile, and where it comes from. */
|
|
@@ -57,6 +68,13 @@ export interface SwiftPackageGap {
|
|
|
57
68
|
|
|
58
69
|
export interface SwiftPackages {
|
|
59
70
|
targets: SwiftPackageSourceTarget[]
|
|
71
|
+
/** packages whose original graph builds both guest libraries and host macros. */
|
|
72
|
+
nativePackages: {
|
|
73
|
+
manifest: SwiftPackageManifest
|
|
74
|
+
remote: boolean
|
|
75
|
+
guestTargets: SwiftManifestTarget[]
|
|
76
|
+
}[]
|
|
77
|
+
nativeProducts: { name: string; packageDir: string; source: string }[]
|
|
60
78
|
/** linked products peach cannot compile. */
|
|
61
79
|
unavailable: Map<string, SwiftPackageGap>
|
|
62
80
|
/** every module a reached package declares that does not compile. */
|
|
@@ -106,38 +124,71 @@ interface Pin {
|
|
|
106
124
|
revision: string
|
|
107
125
|
}
|
|
108
126
|
|
|
127
|
+
interface ResolvedPin extends Pin {
|
|
128
|
+
identity: string
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// a Package.resolved's pins in any of swiftpm's three lockfile generations:
|
|
132
|
+
// v1 nests them under `object` with the package name and repository url, and
|
|
133
|
+
// the identity is derived from the url as swiftpm derives it; v2 and v3 list
|
|
134
|
+
// them at the top level with their explicit identity and location. entries
|
|
135
|
+
// without a usable revision are skipped, as today.
|
|
136
|
+
function resolvedPins(data: unknown): ResolvedPin[] | null {
|
|
137
|
+
if (!data || typeof data !== 'object') return null
|
|
138
|
+
const version =
|
|
139
|
+
'version' in data && typeof data.version === 'number' ? data.version : null
|
|
140
|
+
// swiftpm fails a lockfile with no version or one it does not know, and
|
|
141
|
+
// each generation decodes its own pin shape: v1 carries repositoryURL,
|
|
142
|
+
// v2 and v3 carry location.
|
|
143
|
+
if (version !== 1 && version !== 2 && version !== 3) return null
|
|
144
|
+
const top = 'pins' in data && Array.isArray(data.pins) ? data.pins : null
|
|
145
|
+
const nested =
|
|
146
|
+
'object' in data &&
|
|
147
|
+
data.object &&
|
|
148
|
+
typeof data.object === 'object' &&
|
|
149
|
+
'pins' in data.object &&
|
|
150
|
+
Array.isArray(data.object.pins)
|
|
151
|
+
? data.object.pins
|
|
152
|
+
: null
|
|
153
|
+
const v1 = version === 1
|
|
154
|
+
const pins = v1 ? nested : top
|
|
155
|
+
if (!pins) return null
|
|
156
|
+
const out: ResolvedPin[] = []
|
|
157
|
+
for (const pin of pins) {
|
|
158
|
+
const location = v1 ? pin?.repositoryURL : pin?.location
|
|
159
|
+
const identity =
|
|
160
|
+
v1 && typeof location === 'string' ? swiftPackageIdentity(location) : pin?.identity
|
|
161
|
+
const revision = pin?.state?.revision
|
|
162
|
+
if (
|
|
163
|
+
typeof identity === 'string' &&
|
|
164
|
+
typeof location === 'string' &&
|
|
165
|
+
typeof revision === 'string'
|
|
166
|
+
)
|
|
167
|
+
out.push({ identity, location, revision })
|
|
168
|
+
}
|
|
169
|
+
return out
|
|
170
|
+
}
|
|
171
|
+
|
|
109
172
|
function readPins(resolved: readonly string[]): Map<string, Pin> {
|
|
110
173
|
const out = new Map<string, Pin>()
|
|
111
174
|
const owners = new Map<string, string>()
|
|
112
175
|
for (const file of resolved) {
|
|
113
176
|
const data: unknown = JSON.parse(fs.readFileSync(file, 'utf8'))
|
|
114
|
-
const pins =
|
|
115
|
-
data && typeof data === 'object' && 'pins' in data && Array.isArray(data.pins)
|
|
116
|
-
? data.pins
|
|
117
|
-
: null
|
|
177
|
+
const pins = resolvedPins(data)
|
|
118
178
|
if (!pins) throw new Error(`${file} has no pins; resolve packages in a current Xcode`)
|
|
119
|
-
for (const
|
|
120
|
-
const
|
|
121
|
-
const
|
|
122
|
-
const revision = pin?.state?.revision
|
|
179
|
+
for (const { identity, location, revision } of pins) {
|
|
180
|
+
const previous = out.get(identity)
|
|
181
|
+
const repository = (url: string) => url.replace(/(?:\.git)?\/?$/, '')
|
|
123
182
|
if (
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
)
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
if (
|
|
131
|
-
previous &&
|
|
132
|
-
(previous.revision !== revision ||
|
|
133
|
-
repository(previous.location) !== repository(location))
|
|
183
|
+
previous &&
|
|
184
|
+
(previous.revision !== revision ||
|
|
185
|
+
repository(previous.location) !== repository(location))
|
|
186
|
+
)
|
|
187
|
+
throw new Error(
|
|
188
|
+
`conflicting Package.resolved pins for ${identity}: ${owners.get(identity)} pins ${previous.location} at ${previous.revision}; ${file} pins ${location} at ${revision}`,
|
|
134
189
|
)
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
)
|
|
138
|
-
out.set(identity, { location, revision })
|
|
139
|
-
owners.set(identity, file)
|
|
140
|
-
}
|
|
190
|
+
out.set(identity, { location, revision })
|
|
191
|
+
owners.set(identity, file)
|
|
141
192
|
}
|
|
142
193
|
}
|
|
143
194
|
return out
|
|
@@ -150,26 +201,64 @@ function checkout(checkouts: string, identity: string, pin: Pin): string {
|
|
|
150
201
|
const dir = path.join(checkouts, identity)
|
|
151
202
|
const key = `${dir}\0${pin.revision}`
|
|
152
203
|
if (verified.has(key)) return dir
|
|
153
|
-
const git = (...args: string[]) =>
|
|
154
|
-
execFileSync('git', ['-C',
|
|
204
|
+
const git = (cwd: string, ...args: string[]) =>
|
|
205
|
+
execFileSync('git', ['-C', cwd, ...args], {
|
|
155
206
|
encoding: 'utf8',
|
|
156
207
|
stdio: ['ignore', 'pipe', 'pipe'],
|
|
157
208
|
}).trim()
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
fs.
|
|
161
|
-
fs.mkdirSync(dir, { recursive: true })
|
|
209
|
+
// an interrupted clone leaves a .git without a HEAD commit, which counts as no checkout
|
|
210
|
+
const head = (at = dir) => {
|
|
211
|
+
if (!fs.existsSync(path.join(at, '.git'))) return ''
|
|
162
212
|
try {
|
|
163
|
-
git('
|
|
164
|
-
|
|
165
|
-
|
|
213
|
+
return git(at, 'rev-parse', 'HEAD')
|
|
214
|
+
} catch {
|
|
215
|
+
return ''
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
if (head() !== pin.revision) {
|
|
219
|
+
// staging dirs of killed runs are never reused
|
|
220
|
+
for (const name of fs.readdirSync(checkouts)) {
|
|
221
|
+
if (!name.startsWith(`${identity}.tmp-`)) continue
|
|
222
|
+
const stale = path.join(checkouts, name)
|
|
223
|
+
try {
|
|
224
|
+
if (Date.now() - fs.statSync(stale).mtimeMs > 24 * 3600_000)
|
|
225
|
+
fs.rmSync(stale, { recursive: true, force: true })
|
|
226
|
+
} catch {}
|
|
227
|
+
}
|
|
228
|
+
// fetch beside the final path and rename, so a killed run never leaves a partial dir
|
|
229
|
+
const staging = `${dir}.tmp-${process.pid}-${Date.now()}`
|
|
230
|
+
fs.rmSync(staging, { recursive: true, force: true })
|
|
231
|
+
fs.mkdirSync(staging, { recursive: true })
|
|
232
|
+
try {
|
|
233
|
+
git(staging, 'init', '-q')
|
|
234
|
+
git(staging, 'fetch', '-q', '--depth', '1', pin.location, pin.revision)
|
|
235
|
+
git(staging, 'checkout', '-q', 'FETCH_HEAD')
|
|
236
|
+
// the final dir changes only under a per-package lock, so the head check
|
|
237
|
+
// and the replacement are one step: a tree published by another run is
|
|
238
|
+
// kept as is and a stale publisher never removes it
|
|
239
|
+
let release = tryAcquireNumberedLock(`${dir}.lock`)
|
|
240
|
+
while (!release) {
|
|
241
|
+
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, 25)
|
|
242
|
+
release = tryAcquireNumberedLock(`${dir}.lock`)
|
|
243
|
+
}
|
|
244
|
+
try {
|
|
245
|
+
if (head() !== pin.revision) {
|
|
246
|
+
const aside = `${dir}.tmp-old-${process.pid}-${Date.now()}`
|
|
247
|
+
if (fs.existsSync(dir)) fs.renameSync(dir, aside)
|
|
248
|
+
fs.renameSync(staging, dir)
|
|
249
|
+
fs.rmSync(aside, { recursive: true, force: true })
|
|
250
|
+
}
|
|
251
|
+
} finally {
|
|
252
|
+
release()
|
|
253
|
+
}
|
|
166
254
|
} catch (error) {
|
|
167
|
-
fs.rmSync(dir, { recursive: true, force: true })
|
|
168
255
|
const stderr =
|
|
169
256
|
error instanceof Error && 'stderr' in error ? String(error.stderr).trim() : ''
|
|
170
257
|
throw new Error(
|
|
171
258
|
`could not fetch ${pin.location} at ${pin.revision}${stderr ? `: ${stderr}` : ''}`,
|
|
172
259
|
)
|
|
260
|
+
} finally {
|
|
261
|
+
fs.rmSync(staging, { recursive: true, force: true })
|
|
173
262
|
}
|
|
174
263
|
}
|
|
175
264
|
verified.add(key)
|
|
@@ -183,6 +272,22 @@ interface LoadedPackage {
|
|
|
183
272
|
manifest: SwiftPackageManifest
|
|
184
273
|
}
|
|
185
274
|
|
|
275
|
+
/**
|
|
276
|
+
* fetch every pinned checkout, as xcode's package resolution does before a
|
|
277
|
+
* build. run script phases read checkouts from disk, so they need them
|
|
278
|
+
* before the resolver runs for the compile.
|
|
279
|
+
*/
|
|
280
|
+
export function prefetchSwiftCheckouts(
|
|
281
|
+
rootDir: string,
|
|
282
|
+
resolved: readonly string[],
|
|
283
|
+
): void {
|
|
284
|
+
const pins = resolved.length > 0 ? readPins(resolved) : null
|
|
285
|
+
if (!pins) return
|
|
286
|
+
const checkouts = remoteSwiftCheckouts(rootDir)
|
|
287
|
+
fs.mkdirSync(checkouts, { recursive: true })
|
|
288
|
+
for (const [identity, pin] of pins) checkout(checkouts, identity, pin)
|
|
289
|
+
}
|
|
290
|
+
|
|
186
291
|
/**
|
|
187
292
|
* resolves `products` to the source targets that build them. products named
|
|
188
293
|
* in `provided` are peach modules and link as those instead. without
|
|
@@ -204,6 +309,8 @@ export function resolveSwiftPackages(options: {
|
|
|
204
309
|
const provided = options.provided ?? new Set<string>()
|
|
205
310
|
const result: SwiftPackages = {
|
|
206
311
|
targets: [],
|
|
312
|
+
nativePackages: [],
|
|
313
|
+
nativeProducts: [],
|
|
207
314
|
unavailable: new Map(),
|
|
208
315
|
modules: new Map(),
|
|
209
316
|
binaries: [],
|
|
@@ -240,7 +347,60 @@ export function resolveSwiftPackages(options: {
|
|
|
240
347
|
return loaded
|
|
241
348
|
}
|
|
242
349
|
|
|
350
|
+
const dependencyPackage = (
|
|
351
|
+
pkg: LoadedPackage,
|
|
352
|
+
dependency: Extract<SwiftTargetDependency, { kind: 'product' }>,
|
|
353
|
+
manifest = pkg.manifest,
|
|
354
|
+
) =>
|
|
355
|
+
swiftProductDependency(manifest, dependency, (source) =>
|
|
356
|
+
'dir' in source
|
|
357
|
+
? load({ kind: 'local', dir: source.dir })
|
|
358
|
+
: options.provided
|
|
359
|
+
? load({ kind: 'remote', url: source.url })
|
|
360
|
+
: undefined,
|
|
361
|
+
)
|
|
362
|
+
|
|
243
363
|
const targets = new Map<string, SwiftPackageSourceTarget>()
|
|
364
|
+
const nativePackages = new Map<string, LoadedPackage>()
|
|
365
|
+
const nativeTargets = new Set<string>()
|
|
366
|
+
const hostPlatform = process.platform === 'darwin' ? 'macos' : 'linux'
|
|
367
|
+
// guest targets build for the simulated device from the declared manifest;
|
|
368
|
+
// host targets (macros) build for the machine running the compiler.
|
|
369
|
+
const manifestFor = (pkg: LoadedPackage, side: BuildSide) =>
|
|
370
|
+
side === 'guest' ? pkg.manifest : swiftPackageManifest(pkg.manifest.dir, hostPlatform)
|
|
371
|
+
const preservePackage = (
|
|
372
|
+
pkg: LoadedPackage,
|
|
373
|
+
roots: readonly string[],
|
|
374
|
+
side: BuildSide,
|
|
375
|
+
): string[] => {
|
|
376
|
+
nativePackages.set(pkg.manifest.dir, pkg)
|
|
377
|
+
const manifest = manifestFor(pkg, side)
|
|
378
|
+
return blockers(
|
|
379
|
+
roots.map((name) => {
|
|
380
|
+
const key = `${manifest.dir}\0${name}\0${side}`
|
|
381
|
+
if (nativeTargets.has(key)) return []
|
|
382
|
+
nativeTargets.add(key)
|
|
383
|
+
const target = manifest.targets.get(name)
|
|
384
|
+
if (!target) return [`${manifest.name} declares no target ${name}`]
|
|
385
|
+
if (target.type === 'macro' && side === 'guest')
|
|
386
|
+
return preservePackage(pkg, [name], 'host')
|
|
387
|
+
return blockers(
|
|
388
|
+
target.dependencies.map((dependency) => {
|
|
389
|
+
if (dependency.kind === 'target')
|
|
390
|
+
return preservePackage(pkg, [dependency.name], side)
|
|
391
|
+
const nested = dependencyPackage(pkg, dependency, manifest)
|
|
392
|
+
if (!nested) return []
|
|
393
|
+
if (typeof nested === 'string') return [nested]
|
|
394
|
+
const nestedManifest = manifestFor(nested, side)
|
|
395
|
+
const roots = nestedManifest.products.get(dependency.name)
|
|
396
|
+
return roots
|
|
397
|
+
? preservePackage(nested, roots, side)
|
|
398
|
+
: [`${nestedManifest.name} has no library ${dependency.name}`]
|
|
399
|
+
}),
|
|
400
|
+
)
|
|
401
|
+
}),
|
|
402
|
+
)
|
|
403
|
+
}
|
|
244
404
|
// every reason each target cannot compile; empty once it can
|
|
245
405
|
const targetOutcomes = new Map<string, string[]>()
|
|
246
406
|
const resolveTarget = (pkg: LoadedPackage, name: string): string[] => {
|
|
@@ -253,24 +413,26 @@ export function resolveSwiftPackages(options: {
|
|
|
253
413
|
const target = pkg.manifest.targets.get(name)
|
|
254
414
|
if (!target)
|
|
255
415
|
return [`${path.basename(pkg.manifest.dir)} declares no target ${name}`]
|
|
416
|
+
if (target.type === 'macro') return preservePackage(pkg, [name], 'host')
|
|
256
417
|
const files =
|
|
257
418
|
target.type === 'regular' || target.type === 'system'
|
|
258
419
|
? swiftTargetFiles(pkg.manifest, target)
|
|
259
420
|
: []
|
|
260
421
|
const gap = options.binaryGaps?.get(name)
|
|
422
|
+
const assembly = files.filter((file) => UNSUPPORTED_NATIVE.test(file))
|
|
261
423
|
const ownReason =
|
|
262
424
|
target.type === 'binary'
|
|
263
425
|
? `${name} ${BINARY}${gap ? `; ${gap}` : ''}`
|
|
264
426
|
: target.type !== 'regular' && target.type !== 'system'
|
|
265
427
|
? `${name} is a ${target.type} target`
|
|
266
|
-
:
|
|
267
|
-
? `${name} is an assembly target${gap ? `; ${gap}` : ''}`
|
|
428
|
+
: assembly.length > 0
|
|
429
|
+
? `${name} is an assembly target with no wasm32 lowering: ${assembly.map((file) => path.relative(pkg.manifest.dir, file)).join(', ')}${gap ? `; ${gap}` : ''}`
|
|
268
430
|
: null
|
|
269
431
|
// every dependency resolves, so a failing one never hides the rest
|
|
270
432
|
// of the closure from the compile or from the report
|
|
271
433
|
const reasons = target.dependencies.map((dependency) => {
|
|
272
434
|
if (dependency.kind === 'target') return resolveTarget(pkg, dependency.name)
|
|
273
|
-
const nested = resolveDependencyProduct(pkg, dependency
|
|
435
|
+
const nested = resolveDependencyProduct(pkg, dependency)
|
|
274
436
|
return nested.map((reason) => `${dependency.name}: ${reason}`)
|
|
275
437
|
})
|
|
276
438
|
const blocked = blockers([ownReason ? [ownReason] : [], ...reasons])
|
|
@@ -283,25 +445,15 @@ export function resolveSwiftPackages(options: {
|
|
|
283
445
|
files,
|
|
284
446
|
packageDir: pkg.manifest.dir,
|
|
285
447
|
remote: pkg.remote,
|
|
448
|
+
iosDeployment: pkg.manifest.iosDeployment,
|
|
286
449
|
packageDefines: target.defines,
|
|
287
450
|
packageLibraries: target.libraries,
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
const nested =
|
|
293
|
-
source &&
|
|
294
|
-
packages.get('dir' in source ? path.resolve(source.dir) : source.url)
|
|
295
|
-
return nested && typeof nested !== 'string'
|
|
296
|
-
? (nested.manifest.products.get(dependency.name) ?? []).map(
|
|
297
|
-
(name): SwiftTargetDependency => ({
|
|
298
|
-
kind: 'target',
|
|
299
|
-
name,
|
|
300
|
-
}),
|
|
301
|
-
)
|
|
302
|
-
: []
|
|
303
|
-
}),
|
|
451
|
+
packageExperimentalFeatures: target.experimentalFeatures,
|
|
452
|
+
packageUpcomingFeatures: target.upcomingFeatures,
|
|
453
|
+
packageSwiftFlags: target.swiftFlags,
|
|
454
|
+
dependencies: target.dependencies,
|
|
304
455
|
executable: false,
|
|
456
|
+
publicHeadersPath: target.publicHeadersPath,
|
|
305
457
|
...(target.type === 'system' ? { systemLibrary: true } : {}),
|
|
306
458
|
languageMode: target.languageMode,
|
|
307
459
|
mainActorIsolation: target.mainActorIsolation,
|
|
@@ -325,36 +477,48 @@ export function resolveSwiftPackages(options: {
|
|
|
325
477
|
productOutcomes.set(`${pkg.manifest.dir}\0${product}`, { pkg, reason })
|
|
326
478
|
return reason
|
|
327
479
|
}
|
|
328
|
-
// a `.product(package:)` names a dependency by identity or by its `name:`
|
|
329
480
|
const resolveDependencyProduct = (
|
|
330
481
|
pkg: LoadedPackage,
|
|
331
|
-
|
|
332
|
-
product: string,
|
|
482
|
+
dependency: Extract<SwiftTargetDependency, { kind: 'product' }>,
|
|
333
483
|
): string[] => {
|
|
334
|
-
if (provided.has(
|
|
335
|
-
const
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
}
|
|
342
|
-
if (!options.provided) return []
|
|
343
|
-
const loaded = load({ kind: 'remote', url: dependency.url })
|
|
344
|
-
return typeof loaded === 'string' ? [loaded] : resolveProduct(loaded, product)
|
|
484
|
+
if (provided.has(dependency.name)) return []
|
|
485
|
+
const loaded = dependencyPackage(pkg, dependency)
|
|
486
|
+
return typeof loaded === 'string'
|
|
487
|
+
? [loaded]
|
|
488
|
+
: loaded
|
|
489
|
+
? resolveProduct(loaded, dependency.name)
|
|
490
|
+
: []
|
|
345
491
|
}
|
|
346
492
|
|
|
347
|
-
const
|
|
348
|
-
|
|
349
|
-
|
|
493
|
+
const unnamedProducts = new Map<string, LoadedPackage | string | undefined>()
|
|
494
|
+
const unnamed = (
|
|
495
|
+
source: Extract<SwiftPackageSource, { kind: 'unnamed' }>,
|
|
496
|
+
product: string,
|
|
497
|
+
): LoadedPackage | string | undefined => {
|
|
498
|
+
const key = JSON.stringify([source, product])
|
|
499
|
+
if (unnamedProducts.has(key)) return unnamedProducts.get(key)
|
|
500
|
+
const candidates = [
|
|
501
|
+
...localDirs.map((dir) => load({ kind: 'local', dir })),
|
|
502
|
+
...(options.provided ? source.remoteUrls : []).map((url) =>
|
|
503
|
+
load({ kind: 'remote', url }),
|
|
504
|
+
),
|
|
505
|
+
]
|
|
350
506
|
.filter((pkg) => typeof pkg !== 'string')
|
|
507
|
+
.filter((pkg) => pkg.manifest.products.has(product))
|
|
508
|
+
const matches = [
|
|
509
|
+
...new Map(candidates.map((pkg) => [pkg.manifest.dir, pkg])).values(),
|
|
510
|
+
]
|
|
511
|
+
const pkg =
|
|
512
|
+
matches.length > 1
|
|
513
|
+
? `ambiguous library product ${product} is vended by ${matches.map((match) => match.source).join(', ')}`
|
|
514
|
+
: matches[0]
|
|
515
|
+
unnamedProducts.set(key, pkg)
|
|
516
|
+
return pkg
|
|
517
|
+
}
|
|
351
518
|
for (const { product, source } of products) {
|
|
352
519
|
if (provided.has(product)) continue
|
|
353
520
|
if (source.kind === 'remote' && !options.provided) continue
|
|
354
|
-
const pkg =
|
|
355
|
-
source.kind === 'unnamed'
|
|
356
|
-
? unnamed().find((candidate) => candidate.manifest.products.has(product))
|
|
357
|
-
: load(source)
|
|
521
|
+
const pkg = source.kind === 'unnamed' ? unnamed(source, product) : load(source)
|
|
358
522
|
const reason =
|
|
359
523
|
pkg === undefined
|
|
360
524
|
? ['no package the workspace references vends it']
|
|
@@ -423,15 +587,11 @@ export function resolveSwiftPackages(options: {
|
|
|
423
587
|
const key = `${pkg.manifest.dir}\0${name}`
|
|
424
588
|
if (reached.has(key)) return
|
|
425
589
|
reached.add(key)
|
|
590
|
+
if (pkg.manifest.targets.get(name)?.type === 'macro') return
|
|
426
591
|
for (const dependency of pkg.manifest.targets.get(name)?.dependencies ?? []) {
|
|
427
592
|
if (dependency.kind === 'target') reach(pkg, dependency.name)
|
|
428
593
|
else {
|
|
429
|
-
const
|
|
430
|
-
const nested =
|
|
431
|
-
source &&
|
|
432
|
-
('dir' in source
|
|
433
|
-
? packages.get(path.resolve(source.dir))
|
|
434
|
-
: packages.get(source.url))
|
|
594
|
+
const nested = dependencyPackage(pkg, dependency)
|
|
435
595
|
if (nested && typeof nested !== 'string')
|
|
436
596
|
for (const root of nested.manifest.products.get(dependency.name) ?? [])
|
|
437
597
|
reach(nested, root)
|
|
@@ -441,7 +601,7 @@ export function resolveSwiftPackages(options: {
|
|
|
441
601
|
for (const { product, source } of products) {
|
|
442
602
|
const pkg =
|
|
443
603
|
source.kind === 'unnamed'
|
|
444
|
-
? unnamed(
|
|
604
|
+
? unnamed(source, product)
|
|
445
605
|
: packages.get(source.kind === 'local' ? path.resolve(source.dir) : source.url)
|
|
446
606
|
if (!pkg || typeof pkg === 'string') continue
|
|
447
607
|
for (const root of pkg.manifest.products.get(product) ?? []) reach(pkg, root)
|
|
@@ -468,10 +628,7 @@ export function resolveSwiftPackages(options: {
|
|
|
468
628
|
for (const dependency of target.dependencies) {
|
|
469
629
|
if (dependency.kind === 'target') visit(owner, dependency.name)
|
|
470
630
|
else {
|
|
471
|
-
const
|
|
472
|
-
const nested =
|
|
473
|
-
source &&
|
|
474
|
-
packages.get('dir' in source ? path.resolve(source.dir) : source.url)
|
|
631
|
+
const nested = dependencyPackage(owner, dependency)
|
|
475
632
|
if (nested && typeof nested !== 'string')
|
|
476
633
|
for (const root of nested.manifest.products.get(dependency.name) ?? [])
|
|
477
634
|
visit(nested, root)
|
|
@@ -483,8 +640,61 @@ export function resolveSwiftPackages(options: {
|
|
|
483
640
|
visit(pkg, binary.target)
|
|
484
641
|
binary.headerDependencies = [...headers].map(([module, path]) => ({ module, path }))
|
|
485
642
|
}
|
|
643
|
+
const macroOwners = [...nativePackages.values()].filter(({ manifest }) =>
|
|
644
|
+
[...manifest.targets.values()].some(
|
|
645
|
+
(target) =>
|
|
646
|
+
target.type === 'macro' && reached.has(`${manifest.dir}\0${target.name}`),
|
|
647
|
+
),
|
|
648
|
+
)
|
|
649
|
+
nativePackages.clear()
|
|
650
|
+
nativeTargets.clear()
|
|
651
|
+
for (const pkg of macroOwners)
|
|
652
|
+
preservePackage(
|
|
653
|
+
pkg,
|
|
654
|
+
[...pkg.manifest.targets.keys()].filter((name) =>
|
|
655
|
+
reached.has(`${pkg.manifest.dir}\0${name}`),
|
|
656
|
+
),
|
|
657
|
+
'guest',
|
|
658
|
+
)
|
|
486
659
|
result.targets = [...targets.entries()]
|
|
487
|
-
.filter(([key]) => reached.has(key))
|
|
660
|
+
.filter(([key, target]) => reached.has(key) && !nativePackages.has(target.packageDir))
|
|
488
661
|
.map(([, target]) => target)
|
|
662
|
+
const byDirectory = new Map<string, LoadedPackage>()
|
|
663
|
+
for (const pkg of packages.values())
|
|
664
|
+
if (typeof pkg !== 'string') byDirectory.set(pkg.manifest.dir, pkg)
|
|
665
|
+
for (const target of result.targets) {
|
|
666
|
+
const pkg = byDirectory.get(target.packageDir)
|
|
667
|
+
if (!pkg) throw new Error(`missing resolved package ${target.packageDir}`)
|
|
668
|
+
target.dependencies = (target.dependencies ?? []).flatMap(
|
|
669
|
+
(dependency): SwiftTargetDependency[] => {
|
|
670
|
+
if (dependency.kind === 'target') return [dependency]
|
|
671
|
+
if (provided.has(dependency.name)) return []
|
|
672
|
+
const nested = dependencyPackage(pkg, dependency)
|
|
673
|
+
if (!nested || typeof nested === 'string') return []
|
|
674
|
+
if (nativePackages.has(nested.manifest.dir))
|
|
675
|
+
return [
|
|
676
|
+
{
|
|
677
|
+
kind: 'product',
|
|
678
|
+
name: dependency.name,
|
|
679
|
+
package: swiftPackageIdentity(nested.manifest.dir),
|
|
680
|
+
},
|
|
681
|
+
]
|
|
682
|
+
return (nested.manifest.products.get(dependency.name) ?? []).map((name) => ({
|
|
683
|
+
kind: 'target',
|
|
684
|
+
name,
|
|
685
|
+
}))
|
|
686
|
+
},
|
|
687
|
+
)
|
|
688
|
+
}
|
|
689
|
+
result.nativePackages = [...nativePackages.values()].map(({ manifest, remote }) => ({
|
|
690
|
+
manifest,
|
|
691
|
+
remote,
|
|
692
|
+
guestTargets: [...manifest.targets.values()].filter((target) =>
|
|
693
|
+
nativeTargets.has(`${manifest.dir}\0${target.name}\0guest`),
|
|
694
|
+
),
|
|
695
|
+
}))
|
|
696
|
+
for (const { manifest, source } of nativePackages.values())
|
|
697
|
+
for (const name of manifest.products.keys())
|
|
698
|
+
result.nativeProducts.push({ name, packageDir: manifest.dir, source })
|
|
489
699
|
return result
|
|
490
700
|
}
|
package/src/swift-source-file.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import fs from 'node:fs'
|
|
2
2
|
import path from 'node:path'
|
|
3
3
|
|
|
4
|
-
export function
|
|
5
|
-
const
|
|
6
|
-
const relative = path.relative(canonicalRoot,
|
|
4
|
+
export function packageInputPath(canonicalRoot: string, file: string): string {
|
|
5
|
+
const canonicalFile = fs.realpathSync(file)
|
|
6
|
+
const relative = path.relative(canonicalRoot, canonicalFile)
|
|
7
7
|
if (
|
|
8
8
|
relative === '..' ||
|
|
9
9
|
relative.startsWith(`..${path.sep}`) ||
|
|
@@ -11,18 +11,13 @@ export function readPackageFile(root: string, file: string, maxBytes: number): B
|
|
|
11
11
|
) {
|
|
12
12
|
throw new Error(`swift input escapes the selected package: ${file}`)
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
throw new Error(`swift input escapes the selected package: ${file}`)
|
|
22
|
-
ancestor = parent
|
|
23
|
-
}
|
|
24
|
-
const expected = fs.statSync(file)
|
|
25
|
-
const fd = fs.openSync(file, fs.constants.O_RDONLY | fs.constants.O_NOFOLLOW)
|
|
14
|
+
return canonicalFile
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function readPackageFile(root: string, file: string, maxBytes: number): Buffer {
|
|
18
|
+
const canonicalFile = packageInputPath(fs.realpathSync(root), file)
|
|
19
|
+
const expected = fs.statSync(canonicalFile)
|
|
20
|
+
const fd = fs.openSync(canonicalFile, fs.constants.O_RDONLY | fs.constants.O_NOFOLLOW)
|
|
26
21
|
try {
|
|
27
22
|
const stat = fs.fstatSync(fd)
|
|
28
23
|
if (stat.dev !== expected.dev || stat.ino !== expected.ino) {
|