peachsim 0.1.2018 → 0.1.2021
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/inspect/settling.ts +11 -6
- package/cli/commands/screenshots-capture.ts +9 -2
- package/cli/outbound-endpoints.ts +1 -1
- package/cli/telemetry.ts +19 -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 +383 -102
- 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/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +377 -96
- 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 +382 -101
- package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
- 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 +83 -18
- 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 +78 -15
- package/dist-lib/native-app-identity-project.cjs +76 -13
- package/dist-lib/native-app-identity-project.mjs +76 -12
- package/dist-lib/native-app-identity.cjs +5 -2
- package/dist-lib/native-app-identity.mjs +5 -2
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.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 +24 -24
- package/dist-lib/public-origins-lib.json +53 -53
- 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 +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +6 -4
- package/dist-lib/sdk.mjs +6 -4
- package/dist-lib/skills.cjs +389 -106
- package/dist-lib/swift-compile.cjs +101 -66
- package/dist-lib/swift-compile.mjs +100 -65
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +1 -1
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +1 -1
- package/dist-lib/swift-toolchain.cjs +26 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +376 -95
- package/dist-lib/vite.cjs +1 -1
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/components/native-ui/context-menu-types.d.ts +84 -0
- package/dist-types/packages/peach-engine/src/engine/animated.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/engine/fontDataContract.d.ts +4 -0
- package/dist-types/packages/peach-engine/src/engine/liquid-glass.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/rn-spring.d.ts +2 -2
- package/dist-types/packages/peach-engine/src/engine/scene-table.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/engine/types.d.ts +2 -1
- package/dist-types/packages/peach-engine/src/render-worker/graph-linked-value.d.ts +4 -1
- package/dist-types/packages/peach-engine/src/render-worker/native-menu-gesture.d.ts +6 -0
- package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +1 -0
- package/package.json +1 -1
- package/sdk/ios/System/Library/Frameworks/AuthenticationServices.framework/Headers/ASWebAuthenticationSession.h +1 -1
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/CoreData.h +2 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSEntityDescription.h +10 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSFetchRequest.h +28 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSManagedObject.h +1 -1
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSManagedObjectContext.h +16 -1
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSManagedObjectModel.h +3 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSPersistentStoreCoordinator.h +7 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSPersistentStoreRequest.h +3 -0
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/NSPredicate.h +1 -1
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/NSSortDescriptor.h +1 -1
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/NSURLConnection.h +1 -1
- package/sdk/ios/System/Library/Frameworks/LocalAuthentication.framework/Headers/LAContext.h +1 -1
- package/sdk/ios/System/Library/Frameworks/SafariServices.framework/Headers/SFAuthenticationSession.h +17 -0
- package/sdk/ios/System/Library/Frameworks/SafariServices.framework/Headers/SafariServices.h +1 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIInputViewController.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIPageViewController.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIPointerStyle.h +1 -6
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Modules/module.modulemap +1 -0
- package/sdk/ios/System/Library/Frameworks/UIKitTypes.framework/Headers/UIKitTypes.h +6 -0
- package/sdk/ios/System/Library/Frameworks/WatchConnectivity.framework/Headers/WCSession.h +1 -1
- package/sdk/ios/usr/include/objc/NSObject.h +1 -1
- package/sdk/ios/wasm/include/stdlib.h +1 -0
- package/src/nitro-adapter.lock.json +274 -274
- package/src/nitro-superset.lock.json +4 -4
- package/src/swift-compile.ts +70 -81
- package/src/swift-distribution.lock.json +14 -12
- package/src/swift-guest-image-ledger.ts +15 -10
- package/src/swift-guest-source-inputs.ts +6 -3
- package/src/swift-guest-source-plan.ts +5 -1
- package/src/swift-objc-compile.ts +2 -2
- package/src/swift-objc-standin.ts +197 -5
- package/src/swift-packages.ts +13 -12
- package/src/swift-shared-sdk.ts +2 -1
- package/src/swift-standin-emit.ts +43 -5
- package/src/swift-standins.ts +41 -2
- package/src/swift-toolchain.ts +24 -0
- package/src/turbo-runtime.lock.json +23 -23
- package/src/xcode-project.ts +59 -1
- package/src/xcode-target-members.ts +4 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2021 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -39,7 +39,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
39
39
|
var define_SWIFT_COVERAGE_SOURCE_DIGESTS_default;
|
|
40
40
|
var init_define_SWIFT_COVERAGE_SOURCE_DIGESTS = __esm({
|
|
41
41
|
"<define:__SWIFT_COVERAGE_SOURCE_DIGESTS__>"() {
|
|
42
|
-
define_SWIFT_COVERAGE_SOURCE_DIGESTS_default = { "swift-coverage/indexdump.ts": "0d82d8eeb96bf377f409ea7e33274c341a710c0e071f6b6e17571a23d8d92412", "swift-coverage/indexing.ts": "633ccf19eec1f382a8847d0ee1dca42a2792a3c60aafd43622ed5152b09b8272", "swift-coverage/types.ts": "5bd72edc235189d69835155cb0367a1aee14332405896366af3be606dbe8cce8", "swift-coverage/source.ts": "8b398ceb60faf4a5729842cab60f49c2e601d6fc6bbbc1faec9023ecb8141990", "swift-coverage/package.ts": "1f0068be7461fa7c5a7a891faf318f305cbed2e94c19667ba76627f7e5be260b", "swift-coverage/xcode.ts": "65a500b806ce1c3a496de27f2e0ad77287c0f6795c618342c08af647f92af1fa", "swift-coverage/xcode-assets.ts": "99e03b74c961d2449afd58c2cbc415ba91d1d469a4f89e461c137fd6c305b27c", "swift-coverage/xcode-asset-symbols.ts": "1b2a67733bc9d139b351466270205452a6172140bc25080d72619e2952c44671", "swift-coverage/xcode-bridging.ts": "33184be8c5daf6646aa5a1276a4e15531f1be27b7c26f56550e0fbb1fc678a11", "swift-coverage/xcode-packages.ts": "8e6020d17d24474150a5a50d042aca6261819ef75c79680a287a66f395909915", "swift-coverage/xcode-strings.ts": "f2dd4c7cd8ef77035184b0132909c2fa09fd20ed06b7757c2f1f960bfdde031c", "swift-coverage/reader.ts": "da559b67ecd1161dea70c980b5f98f2c55af3550f0714479100fa5e9e813625c", "swift-coverage/provenance.ts": "eb3b41ae8b58b48f6758f084800f188dfb1edb227e483abdd6b80cde66e849b9", "swift-package-manifest.ts": "4b7d4a715cdaf57468ead23f2ff9dce76d02c6a888d73d144d4baa2ae571ba3c", "swift-package.ts": "0b82b3773f9c0b27636f277d9c123b3e631b9c9980995d67d67efa6b3176df4a", "swift-source-file.ts": "93fd659ed63a27b67f54a7c229a7ceb636dc9c59e68414920ba36cff1eda1f94", "swift-toolchain.ts": "
|
|
42
|
+
define_SWIFT_COVERAGE_SOURCE_DIGESTS_default = { "swift-coverage/indexdump.ts": "0d82d8eeb96bf377f409ea7e33274c341a710c0e071f6b6e17571a23d8d92412", "swift-coverage/indexing.ts": "633ccf19eec1f382a8847d0ee1dca42a2792a3c60aafd43622ed5152b09b8272", "swift-coverage/types.ts": "5bd72edc235189d69835155cb0367a1aee14332405896366af3be606dbe8cce8", "swift-coverage/source.ts": "8b398ceb60faf4a5729842cab60f49c2e601d6fc6bbbc1faec9023ecb8141990", "swift-coverage/package.ts": "1f0068be7461fa7c5a7a891faf318f305cbed2e94c19667ba76627f7e5be260b", "swift-coverage/xcode.ts": "65a500b806ce1c3a496de27f2e0ad77287c0f6795c618342c08af647f92af1fa", "swift-coverage/xcode-assets.ts": "99e03b74c961d2449afd58c2cbc415ba91d1d469a4f89e461c137fd6c305b27c", "swift-coverage/xcode-asset-symbols.ts": "1b2a67733bc9d139b351466270205452a6172140bc25080d72619e2952c44671", "swift-coverage/xcode-bridging.ts": "33184be8c5daf6646aa5a1276a4e15531f1be27b7c26f56550e0fbb1fc678a11", "swift-coverage/xcode-packages.ts": "8e6020d17d24474150a5a50d042aca6261819ef75c79680a287a66f395909915", "swift-coverage/xcode-strings.ts": "f2dd4c7cd8ef77035184b0132909c2fa09fd20ed06b7757c2f1f960bfdde031c", "swift-coverage/reader.ts": "da559b67ecd1161dea70c980b5f98f2c55af3550f0714479100fa5e9e813625c", "swift-coverage/provenance.ts": "eb3b41ae8b58b48f6758f084800f188dfb1edb227e483abdd6b80cde66e849b9", "swift-package-manifest.ts": "4b7d4a715cdaf57468ead23f2ff9dce76d02c6a888d73d144d4baa2ae571ba3c", "swift-package.ts": "0b82b3773f9c0b27636f277d9c123b3e631b9c9980995d67d67efa6b3176df4a", "swift-source-file.ts": "93fd659ed63a27b67f54a7c229a7ceb636dc9c59e68414920ba36cff1eda1f94", "swift-toolchain.ts": "0b56e73d37142a6b639a885b178c86f440c61a0f9a2f615981ea8771ee9b74a9", "home-paths.ts": "af600a7f017474946ede726320a133d830e77e4e287b043d4fea026a945ce748", "xcode-header-search.ts": "f8c3d557b4eca5ddad32907545353eb7ad53b2ebd0969d9ed8f7275e109a13b1", "xcode-project.ts": "19ef9ddd523234d61f3937219a3845fe27e58602d4a2300510eee585f4df7ba6", "xcode-target-members.ts": "ad7589132bffab265e8a10b64e24484fe88b4a2b1cc0ee19a97f151a002eca77", "xcode-json-project.ts": "41990ebbe4b488eef34e74c4608b4b48e5a5b299ba98ca7fbcfdfa0e77be63b6", "openstep-plist.ts": "74e6ce1dac80c9c318e0e9f5e3e8cd19a898a8820c36fc160609695bcb59dcd3" };
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
45
|
|
|
@@ -6905,7 +6905,7 @@ function parseOpenStepPlist(text5) {
|
|
|
6905
6905
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
6906
6906
|
var NEVER_MEMBER = /(?:^|\/)(?:Info\.plist|[^/]+\.entitlements|[^/]+\.xcconfig|\.DS_Store)$/;
|
|
6907
6907
|
var BUNDLE_DIR = /\.(xcassets|bundle|lproj|xcdatamodeld|scnassets|spriteatlas|rcproject|storyboardc|icon)$/;
|
|
6908
|
-
function xcodePathResolver(objects, projectDir, join13) {
|
|
6908
|
+
function xcodePathResolver(objects, projectDir, join13, sourceTreeRoot) {
|
|
6909
6909
|
const parents = /* @__PURE__ */ new Map();
|
|
6910
6910
|
for (const [id, entry] of Object.entries(objects)) {
|
|
6911
6911
|
if (!isDict(entry)) continue;
|
|
@@ -6928,6 +6928,9 @@ function xcodePathResolver(objects, projectDir, join13) {
|
|
|
6928
6928
|
const parent = parents.get(id);
|
|
6929
6929
|
const base = parent ? resolve3(parent) : projectDir;
|
|
6930
6930
|
if (base !== null) result = join13(base, own);
|
|
6931
|
+
} else {
|
|
6932
|
+
const base = sourceTreeRoot?.(tree2);
|
|
6933
|
+
if (base) result = join13(base, own);
|
|
6931
6934
|
}
|
|
6932
6935
|
}
|
|
6933
6936
|
paths.set(id, result);
|
|
@@ -10740,6 +10743,24 @@ function swiftSdkOptions() {
|
|
|
10740
10743
|
var SWIFT_HOST_COMPILER_RELEASE = "swift-6.4.0-RELEASE-custom-81b2c791c27276bf";
|
|
10741
10744
|
var SWIFT_HOST_COMPILER_ID = "81b2c791c27276bf";
|
|
10742
10745
|
var compilerArchives = {
|
|
10746
|
+
"swift-6.4.0-RELEASE-custom-11345d60dca47496": {
|
|
10747
|
+
identity: "11345d60dca47496",
|
|
10748
|
+
archive: "tar.zst",
|
|
10749
|
+
hosts: {
|
|
10750
|
+
"darwin-arm64": {
|
|
10751
|
+
checksum: "3df74a95c6f3ffa45aaa412027b390c99f9af81f6f6a41bf6d58a1a3079b5b02",
|
|
10752
|
+
manifest: "8e5ed4be6adc967e4c7d955eff004c96d5dc050a589d50e1b3e694b70f9afd63"
|
|
10753
|
+
},
|
|
10754
|
+
"linux-x64": {
|
|
10755
|
+
checksum: "a80e46add069932114bacc18640dc2e6a1a8f2a3ea7306a8ea8614d5cdf6e0e7",
|
|
10756
|
+
manifest: "662d8869534f3cce827b1205973db1f9a1e1d92027005a5bdb6893f9c2a0b39d"
|
|
10757
|
+
},
|
|
10758
|
+
"linux-arm64": {
|
|
10759
|
+
checksum: "4ca69bbc284fc7d54be57c80b744b88cce997d470ff23048795db54e7a6fbcba",
|
|
10760
|
+
manifest: "85df84da2f814b6a71c264b37b83a81965ac33b5d2b465443d60c08cc7bc5dc3"
|
|
10761
|
+
}
|
|
10762
|
+
}
|
|
10763
|
+
},
|
|
10743
10764
|
"swift-6.4.0-RELEASE-custom-45bb46301c86fe73": {
|
|
10744
10765
|
identity: "45bb46301c86fe73",
|
|
10745
10766
|
archive: "tar.gz",
|
|
@@ -10954,7 +10975,12 @@ function privateSwiftDistributionRoot() {
|
|
|
10954
10975
|
const root = process.env[SWIFT_PRIVATE_DISTRIBUTION_ENV]?.trim();
|
|
10955
10976
|
return root ? import_node_path21.default.resolve(root) : null;
|
|
10956
10977
|
}
|
|
10978
|
+
function privateSwiftCompilerRelease() {
|
|
10979
|
+
return process.env.PEACH_SWIFT_PRIVATE_COMPILER_RELEASE?.trim() || null;
|
|
10980
|
+
}
|
|
10957
10981
|
function privateSwiftRelease() {
|
|
10982
|
+
const compiler = privateSwiftCompilerRelease();
|
|
10983
|
+
if (compiler) return compiler;
|
|
10958
10984
|
const root = privateSwiftDistributionRoot();
|
|
10959
10985
|
if (!root) return null;
|
|
10960
10986
|
const manifest = JSON.parse(
|
|
@@ -12198,6 +12224,9 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
12198
12224
|
const designated = (id) => (children.get(id) ?? []).some(
|
|
12199
12225
|
(member) => member.kind.identifier === "swift.init" && !unavailable(member) && !/\bconvenience\b/.test(text(member))
|
|
12200
12226
|
);
|
|
12227
|
+
const superChain = function* (id) {
|
|
12228
|
+
for (let at = superId.get(id); at && byId.has(at); at = superId.get(at)) yield at;
|
|
12229
|
+
};
|
|
12201
12230
|
const hiddenInit = (id) => `${pathOf(byId.get(id))}.init(_peachInert:)`;
|
|
12202
12231
|
const classBuilds = /* @__PURE__ */ new Map();
|
|
12203
12232
|
const classBuild = (id) => {
|
|
@@ -12467,11 +12496,15 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
12467
12496
|
const flags = new Set(
|
|
12468
12497
|
modifiers[1].trim().split(/\s+/).filter(Boolean).map((flag) => flag.replace(/\(.*/, ""))
|
|
12469
12498
|
);
|
|
12470
|
-
const
|
|
12499
|
+
const requiredInit = context.inClass && !!options.requiredInits?.has(path62);
|
|
12500
|
+
const restatesRequired = context.inClass && path62.endsWith(".init()") && [...superChain(owner.get(member.identifier.precise) ?? "")].some(
|
|
12501
|
+
(at) => options.requiredInits?.has(`${pathOf(byId.get(at))}.init()`)
|
|
12502
|
+
);
|
|
12503
|
+
const required = context.inClass && (flags.has("required") || requiredInit || restatesRequired);
|
|
12471
12504
|
const final = context.inClass && flags.has("final") ? "final " : "";
|
|
12472
12505
|
const mutating = flags.has("mutating") ? "mutating " : flags.has("nonmutating") ? "nonmutating " : "";
|
|
12473
12506
|
let core = `${flags.has("convenience") ? "convenience " : ""}${modifiers[2]}`;
|
|
12474
|
-
const override = context.inClass && !options.plain?.has(path62) && (flags.has("override") || overrides.has(member.identifier.precise) || options.forcedOverride?.has(path62) || isObjC(member) && path62.endsWith(".init()")) ? "override " : "";
|
|
12507
|
+
const override = context.inClass && !options.plain?.has(path62) && !restatesRequired && (flags.has("override") || overrides.has(member.identifier.precise) || options.forcedOverride?.has(path62) || isObjC(member) && path62.endsWith(".init()")) ? "override " : "";
|
|
12475
12508
|
const head = `${indent2}${attrs}${access(member, context.openOwner)} ${required ? "required " : ""}${final}${override}${mutating}`;
|
|
12476
12509
|
const measured = behavior.get(path62);
|
|
12477
12510
|
if (measured) used.add(path62);
|
|
@@ -12680,7 +12713,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
12680
12713
|
member,
|
|
12681
12714
|
path: path62
|
|
12682
12715
|
});
|
|
12683
|
-
else emitWitness(member, inner, path62);
|
|
12716
|
+
else emitWitness(member, inner, path62, open && isObjC(member));
|
|
12684
12717
|
}
|
|
12685
12718
|
}
|
|
12686
12719
|
if (options.inert && designated2 && classBuild(id) === "hidden")
|
|
@@ -12690,6 +12723,12 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
12690
12723
|
emit(
|
|
12691
12724
|
`${inner}public required init?(coder: NSCoder) { ${options.inert ? "return nil" : trap(`${path62}.init(coder:)`)} }`
|
|
12692
12725
|
);
|
|
12726
|
+
if (designated2 && !members2.some((member) => leaf(member) === "init()") && [...superChain(id)].some(
|
|
12727
|
+
(at) => options.requiredInits?.has(`${pathOf(byId.get(at))}.init()`)
|
|
12728
|
+
))
|
|
12729
|
+
emit(
|
|
12730
|
+
`${inner}public required init() { ${options.inert ? superInit(id) : trap(`${path62}.init()`)} }`
|
|
12731
|
+
);
|
|
12693
12732
|
emit(`${indent2}}`);
|
|
12694
12733
|
return;
|
|
12695
12734
|
}
|
|
@@ -12858,7 +12897,8 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
12858
12897
|
}
|
|
12859
12898
|
}
|
|
12860
12899
|
);
|
|
12861
|
-
const emitWitness = (member, indent2, owner2) => {
|
|
12900
|
+
const emitWitness = (member, indent2, owner2, openObjC = false) => {
|
|
12901
|
+
const visibility = openObjC ? "open" : "public";
|
|
12862
12902
|
const { 2: rest } = LEADING_ATTRS.exec(text(member));
|
|
12863
12903
|
const decl = rest.replace(/^(?:weak |unowned )/, "").replace(/^((?:static )?)let /, "$1var ");
|
|
12864
12904
|
const witness = `${owner2}.${leaf(member)}`;
|
|
@@ -12866,10 +12906,12 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
12866
12906
|
if (member.kind.identifier === "swift.property" || member.kind.identifier === "swift.type.property") {
|
|
12867
12907
|
const parsed = splitAccessors(decl);
|
|
12868
12908
|
const setter = parsed.settable ? ` ${parsed.nonmutating ? "nonmutating " : ""}set { ${body} }` : "";
|
|
12869
|
-
emit(
|
|
12909
|
+
emit(
|
|
12910
|
+
`${indent2}${visibility} ${parsed.decl} { get${parsed.effects} { ${body} }${setter} }`
|
|
12911
|
+
);
|
|
12870
12912
|
} else
|
|
12871
12913
|
emit(
|
|
12872
|
-
`${indent2}
|
|
12914
|
+
`${indent2}${member.kind.identifier === "swift.init" ? "public required " : visibility + " "}${stripDefaults(decl)} { ${body} }`
|
|
12873
12915
|
);
|
|
12874
12916
|
};
|
|
12875
12917
|
const emitNoop = scoped((member, indent2) => {
|
|
@@ -13392,6 +13434,11 @@ function objcView(surface, toolchainBin, stdlib, cacheDir5, work, original, vend
|
|
|
13392
13434
|
`this peach's Swift has no iOS simulator standard library at ${stdlib}`
|
|
13393
13435
|
);
|
|
13394
13436
|
const sdk = original ? pinnedNativeSdk().sdkPath : materializeObjcSdk(cacheDir5);
|
|
13437
|
+
const moduleCache = import_node_path24.default.join(
|
|
13438
|
+
cacheDir5,
|
|
13439
|
+
"ios-module-cache",
|
|
13440
|
+
(0, import_node_crypto8.createHash)("sha256").update([toolchainBin, stdlib, sdk].map((dir) => import_node_fs27.default.realpathSync(dir)).join("\0")).digest("hex").slice(0, 16)
|
|
13441
|
+
);
|
|
13395
13442
|
const framework = import_node_path24.default.basename(import_node_path24.default.dirname(surface.modulemap)) === "Modules";
|
|
13396
13443
|
const frameworks = import_node_path24.default.join(work, "frameworks");
|
|
13397
13444
|
const include = import_node_path24.default.join(work, "include");
|
|
@@ -13444,6 +13491,10 @@ function objcView(surface, toolchainBin, stdlib, cacheDir5, work, original, vend
|
|
|
13444
13491
|
} else {
|
|
13445
13492
|
import_node_fs27.default.copyFileSync(surface.modulemap, import_node_path24.default.join(headersDir, "module.modulemap"));
|
|
13446
13493
|
}
|
|
13494
|
+
const stagedSurface = {
|
|
13495
|
+
...surface,
|
|
13496
|
+
modulemap: framework ? import_node_path24.default.join(frameworks, `${surface.module}.framework`, "Modules/module.modulemap") : import_node_path24.default.join(headersDir, "module.modulemap")
|
|
13497
|
+
};
|
|
13447
13498
|
const dependencyOriginals = /* @__PURE__ */ new Map();
|
|
13448
13499
|
for (const dependency of surface.dependencies ?? []) {
|
|
13449
13500
|
const dir = import_node_path24.default.join(include, dependency.module);
|
|
@@ -13611,7 +13662,7 @@ function objcView(surface, toolchainBin, stdlib, cacheDir5, work, original, vend
|
|
|
13611
13662
|
...original?.flags.flatMap((flag) => ["-Xcc", flag]) ?? [],
|
|
13612
13663
|
...(surface.moduleMapFlags ?? []).flatMap((flag) => ["-Xcc", flag]),
|
|
13613
13664
|
"-module-cache-path",
|
|
13614
|
-
|
|
13665
|
+
moduleCache,
|
|
13615
13666
|
"-minimum-access-level",
|
|
13616
13667
|
// symbol graphs hide public underscored names at the public threshold.
|
|
13617
13668
|
// original clang headers remain the declaration boundary, and a swift
|
|
@@ -13718,6 +13769,7 @@ function objcView(surface, toolchainBin, stdlib, cacheDir5, work, original, vend
|
|
|
13718
13769
|
})
|
|
13719
13770
|
};
|
|
13720
13771
|
});
|
|
13772
|
+
inheritedDefaultInits(stagedSurface, graphs, toolchainBin, search, moduleCache, work);
|
|
13721
13773
|
const inheritedConformances = /* @__PURE__ */ new Map();
|
|
13722
13774
|
if (surface.interface) {
|
|
13723
13775
|
const own = new Set(
|
|
@@ -13763,7 +13815,7 @@ function objcView(surface, toolchainBin, stdlib, cacheDir5, work, original, vend
|
|
|
13763
13815
|
...search,
|
|
13764
13816
|
...(surface.moduleMapFlags ?? []).flatMap((flag) => ["-Xcc", flag]),
|
|
13765
13817
|
"-module-cache-path",
|
|
13766
|
-
|
|
13818
|
+
moduleCache,
|
|
13767
13819
|
probe
|
|
13768
13820
|
],
|
|
13769
13821
|
{ encoding: "utf8", env: swiftEnvironment() }
|
|
@@ -13822,8 +13874,16 @@ function objcView(surface, toolchainBin, stdlib, cacheDir5, work, original, vend
|
|
|
13822
13874
|
graphs,
|
|
13823
13875
|
...surface.interface ? {
|
|
13824
13876
|
inheritedConformances,
|
|
13825
|
-
|
|
13877
|
+
requiredInits: requiredInits(
|
|
13826
13878
|
surface,
|
|
13879
|
+
graphs,
|
|
13880
|
+
toolchainBin,
|
|
13881
|
+
search,
|
|
13882
|
+
moduleCache,
|
|
13883
|
+
work
|
|
13884
|
+
),
|
|
13885
|
+
protocolProperties: protocolProperties(
|
|
13886
|
+
stagedSurface,
|
|
13827
13887
|
headersDir,
|
|
13828
13888
|
graphs,
|
|
13829
13889
|
toolchainBin,
|
|
@@ -13833,7 +13893,7 @@ function objcView(surface, toolchainBin, stdlib, cacheDir5, work, original, vend
|
|
|
13833
13893
|
} : {},
|
|
13834
13894
|
...original ? {
|
|
13835
13895
|
clangAST: objcDeclarationAST(
|
|
13836
|
-
|
|
13896
|
+
stagedSurface,
|
|
13837
13897
|
framework,
|
|
13838
13898
|
toolchainBin,
|
|
13839
13899
|
search,
|
|
@@ -13842,10 +13902,134 @@ function objcView(surface, toolchainBin, stdlib, cacheDir5, work, original, vend
|
|
|
13842
13902
|
original.target
|
|
13843
13903
|
)
|
|
13844
13904
|
} : {},
|
|
13845
|
-
values: enumValues(
|
|
13905
|
+
values: enumValues(
|
|
13906
|
+
graphs,
|
|
13907
|
+
stagedSurface,
|
|
13908
|
+
framework,
|
|
13909
|
+
toolchainBin,
|
|
13910
|
+
search,
|
|
13911
|
+
work,
|
|
13912
|
+
original
|
|
13913
|
+
),
|
|
13846
13914
|
imports: [...imports2].sort()
|
|
13847
13915
|
};
|
|
13848
13916
|
}
|
|
13917
|
+
function inheritedDefaultInits(surface, graphs, toolchainBin, search, moduleCache, work) {
|
|
13918
|
+
const symbols = graphs.flatMap((graph) => graph.symbols);
|
|
13919
|
+
const classes = symbols.filter(
|
|
13920
|
+
(symbol2) => /^c:objc\(cs\)\w+$/.test(symbol2.identifier.precise) && symbol2.pathComponents.length === 1 && !symbols.some(
|
|
13921
|
+
(member) => member.pathComponents.join(".") === `${symbol2.pathComponents[0]}.init()`
|
|
13922
|
+
) && symbols.some(
|
|
13923
|
+
(member) => member.pathComponents[0] === symbol2.pathComponents[0] && member.kind.identifier === "swift.init"
|
|
13924
|
+
)
|
|
13925
|
+
);
|
|
13926
|
+
if (classes.length === 0) return;
|
|
13927
|
+
const probe = import_node_path24.default.join(work, "inherited-default-inits.swift");
|
|
13928
|
+
import_node_fs27.default.writeFileSync(
|
|
13929
|
+
probe,
|
|
13930
|
+
[
|
|
13931
|
+
`import ${surface.module}`,
|
|
13932
|
+
...classes.map(
|
|
13933
|
+
(symbol2, index) => `@MainActor func peachInherited${index}() { _ = ${surface.module}.${symbol2.pathComponents[0]}() }`
|
|
13934
|
+
)
|
|
13935
|
+
].join("\n")
|
|
13936
|
+
);
|
|
13937
|
+
const run8 = (0, import_node_child_process13.spawnSync)(
|
|
13938
|
+
import_node_path24.default.join(toolchainBin, "swift-frontend"),
|
|
13939
|
+
[
|
|
13940
|
+
"-dump-ast",
|
|
13941
|
+
"-diagnostic-style",
|
|
13942
|
+
"llvm",
|
|
13943
|
+
"-no-color-diagnostics",
|
|
13944
|
+
"-target",
|
|
13945
|
+
IOS_SDK_TARGET,
|
|
13946
|
+
...search,
|
|
13947
|
+
...(surface.moduleMapFlags ?? []).flatMap((flag) => ["-Xcc", flag]),
|
|
13948
|
+
"-module-cache-path",
|
|
13949
|
+
moduleCache,
|
|
13950
|
+
probe
|
|
13951
|
+
],
|
|
13952
|
+
{ encoding: "utf8", env: swiftEnvironment(), maxBuffer: 64 * 1024 * 1024 }
|
|
13953
|
+
);
|
|
13954
|
+
if (run8.error) throw run8.error;
|
|
13955
|
+
const rejected = /* @__PURE__ */ new Set();
|
|
13956
|
+
for (const line of run8.stderr.split("\n")) {
|
|
13957
|
+
if (!line.includes("error:")) continue;
|
|
13958
|
+
const location = line.startsWith(`${probe}:`) ? /^:(\d+):\d+: error:/.exec(line.slice(probe.length)) : null;
|
|
13959
|
+
const index = location ? Number(location[1]) - 2 : -1;
|
|
13960
|
+
if (index < 0 || index >= classes.length)
|
|
13961
|
+
throw new Error(`inherited initializer probe does not typecheck: ${line}`);
|
|
13962
|
+
rejected.add(index);
|
|
13963
|
+
}
|
|
13964
|
+
if (run8.status !== 0 && rejected.size === 0)
|
|
13965
|
+
throw new Error(
|
|
13966
|
+
`inherited initializer probe failed: ${run8.stderr || run8.signal || run8.status}`
|
|
13967
|
+
);
|
|
13968
|
+
const references = run8.stdout.split("\n").filter((line) => line.includes("declref_expr"));
|
|
13969
|
+
for (const [index, symbol2] of classes.entries()) {
|
|
13970
|
+
if (rejected.has(index)) continue;
|
|
13971
|
+
if (!references.some(
|
|
13972
|
+
(line) => line.includes(`location=${probe}:${index + 2}:`) && line.includes(`.${symbol2.pathComponents[0]}.init()@`)
|
|
13973
|
+
))
|
|
13974
|
+
continue;
|
|
13975
|
+
const id = `${symbol2.identifier.precise}(im)init`;
|
|
13976
|
+
graphs[0].symbols.push({
|
|
13977
|
+
kind: { identifier: "swift.init" },
|
|
13978
|
+
identifier: { precise: id },
|
|
13979
|
+
pathComponents: [...symbol2.pathComponents, "init()"],
|
|
13980
|
+
declarationFragments: [{ kind: "keyword", spelling: "override init()" }],
|
|
13981
|
+
accessLevel: "public"
|
|
13982
|
+
});
|
|
13983
|
+
graphs[0].relationships.push({
|
|
13984
|
+
kind: "memberOf",
|
|
13985
|
+
source: id,
|
|
13986
|
+
target: symbol2.identifier.precise
|
|
13987
|
+
});
|
|
13988
|
+
}
|
|
13989
|
+
}
|
|
13990
|
+
function requiredInits(surface, graphs, toolchainBin, search, moduleCache, work) {
|
|
13991
|
+
const classes = graphs.flatMap((graph) => graph.symbols).filter(
|
|
13992
|
+
(symbol2) => /^c:objc\(cs\)\w+$/.test(symbol2.identifier.precise) && symbol2.pathComponents.length === 1 && graphs.some(
|
|
13993
|
+
(graph) => graph.symbols.some(
|
|
13994
|
+
(member) => member.pathComponents.join(".") === `${symbol2.pathComponents[0]}.init()`
|
|
13995
|
+
)
|
|
13996
|
+
)
|
|
13997
|
+
).map((symbol2) => symbol2.pathComponents[0]);
|
|
13998
|
+
const found = /* @__PURE__ */ new Set();
|
|
13999
|
+
if (classes.length === 0) return found;
|
|
14000
|
+
const probe = import_node_path24.default.join(work, "required-inits.swift");
|
|
14001
|
+
import_node_fs27.default.writeFileSync(
|
|
14002
|
+
probe,
|
|
14003
|
+
[
|
|
14004
|
+
`import ${surface.module}`,
|
|
14005
|
+
...classes.map(
|
|
14006
|
+
(name3, index) => `class PeachRequired${index}: ${surface.module}.${name3} { init(peach: Int) { fatalError() } }`
|
|
14007
|
+
)
|
|
14008
|
+
].join("\n")
|
|
14009
|
+
);
|
|
14010
|
+
const run8 = (0, import_node_child_process13.spawnSync)(
|
|
14011
|
+
import_node_path24.default.join(toolchainBin, "swift-frontend"),
|
|
14012
|
+
[
|
|
14013
|
+
"-typecheck",
|
|
14014
|
+
"-target",
|
|
14015
|
+
IOS_SDK_TARGET,
|
|
14016
|
+
...search,
|
|
14017
|
+
...(surface.moduleMapFlags ?? []).flatMap((flag) => ["-Xcc", flag]),
|
|
14018
|
+
"-module-cache-path",
|
|
14019
|
+
moduleCache,
|
|
14020
|
+
probe
|
|
14021
|
+
],
|
|
14022
|
+
{ encoding: "utf8", env: swiftEnvironment(), maxBuffer: 64 * 1024 * 1024 }
|
|
14023
|
+
);
|
|
14024
|
+
if (run8.error) throw run8.error;
|
|
14025
|
+
const unknown2 = /error: (?:no such module|cannot find type) .*/.exec(run8.stderr);
|
|
14026
|
+
if (unknown2) throw new Error(`required init probe does not typecheck: ${unknown2[0]}`);
|
|
14027
|
+
for (const match of run8.stderr.matchAll(
|
|
14028
|
+
/error: 'required' initializer 'init\(\)' must be provided by subclass of '(?:\w+\.)?(\w+)'/g
|
|
14029
|
+
))
|
|
14030
|
+
found.add(`${match[1]}.init()`);
|
|
14031
|
+
return found;
|
|
14032
|
+
}
|
|
13849
14033
|
function clangSearchFlags(search) {
|
|
13850
14034
|
const flags = [];
|
|
13851
14035
|
for (let index = 0; index < search.length; index += 2) {
|
|
@@ -14344,7 +14528,7 @@ function swiftSharedSdkViewOptions(moduleRoot, distribution, toolchainBin, sdk)
|
|
|
14344
14528
|
const overlay = import_node_path25.default.join(swiftSharedSdkRoot(moduleRoot, distribution), "wasm/include");
|
|
14345
14529
|
const overlayFiles = (0, import_node_fs28.readdirSync)(overlay, { recursive: true, withFileTypes: true }).filter((entry) => entry.isFile()).map((entry) => import_node_path25.default.join(entry.parentPath, entry.name)).sort();
|
|
14346
14530
|
const key2 = JSON.stringify([
|
|
14347
|
-
"
|
|
14531
|
+
"v22",
|
|
14348
14532
|
toolchainBin,
|
|
14349
14533
|
sdk,
|
|
14350
14534
|
frameworks,
|
|
@@ -14400,6 +14584,7 @@ function swiftSharedSdkViewOptions(moduleRoot, distribution, toolchainBin, sdk)
|
|
|
14400
14584
|
[import_node_path25.default.join(sysroot, "darwin/System/Library/Frameworks"), frameworks],
|
|
14401
14585
|
...[
|
|
14402
14586
|
"MacTypes.h",
|
|
14587
|
+
"objc/NSObject.h",
|
|
14403
14588
|
"net/if.h",
|
|
14404
14589
|
"notify.h",
|
|
14405
14590
|
"notify.modulemap",
|
|
@@ -17353,13 +17538,18 @@ function createGuestImageLedger(input) {
|
|
|
17353
17538
|
exported.set(definition2.alias, definition2);
|
|
17354
17539
|
}
|
|
17355
17540
|
const names = [...new Set([...exported.values()].map((definition2) => definition2.name))];
|
|
17356
|
-
const
|
|
17357
|
-
|
|
17358
|
-
names.
|
|
17541
|
+
const nameOffsets = /* @__PURE__ */ new Map();
|
|
17542
|
+
let nameSize = 0;
|
|
17543
|
+
const nameContents = names.map((name3) => {
|
|
17359
17544
|
const bytes = Buffer.concat([Buffer.from(name3), Buffer.from([0])]);
|
|
17360
|
-
|
|
17361
|
-
|
|
17362
|
-
|
|
17545
|
+
nameOffsets.set(name3, nameSize);
|
|
17546
|
+
nameSize += bytes.length;
|
|
17547
|
+
return [...bytes].map((byte) => `\\${byte.toString(16).padStart(2, "0")}`).join("");
|
|
17548
|
+
}).join("");
|
|
17549
|
+
const ir = [
|
|
17550
|
+
'target triple = "wasm32-unknown-wasip1"',
|
|
17551
|
+
`@.names = private constant [${nameSize} x i8] c"${nameContents}"`
|
|
17552
|
+
];
|
|
17363
17553
|
for (const definition2 of exported.values()) {
|
|
17364
17554
|
if (definition2.kind === "function")
|
|
17365
17555
|
ir.push(
|
|
@@ -17370,7 +17560,7 @@ function createGuestImageLedger(input) {
|
|
|
17370
17560
|
ir.push(`@__peach_dyld_symbols = constant [${exported.size} x { ptr, i32, ptr }] [`);
|
|
17371
17561
|
ir.push(
|
|
17372
17562
|
[...exported.values()].map(
|
|
17373
|
-
(definition2) => ` { ptr, i32, ptr } { ptr @.
|
|
17563
|
+
(definition2) => ` { ptr, i32, ptr } { ptr getelementptr (i8, ptr @.names, i32 ${nameOffsets.get(definition2.name)}), i32 ${definition2.image}, ptr @${definition2.alias} }`
|
|
17374
17564
|
).join(",\n")
|
|
17375
17565
|
);
|
|
17376
17566
|
ir.push("]", `@__peach_dyld_symbol_count = constant i32 ${exported.size}`);
|
|
@@ -18203,7 +18393,7 @@ function guestSourceImages(graph) {
|
|
|
18203
18393
|
const type = dependency.productType;
|
|
18204
18394
|
let dynamic;
|
|
18205
18395
|
if (type.startsWith("swiftpm.target.")) {
|
|
18206
|
-
if (type !== "swiftpm.target.regular" && type !== "swiftpm.target.binary")
|
|
18396
|
+
if (type !== "swiftpm.target.regular" && type !== "swiftpm.target.binary" && type !== "swiftpm.target.system")
|
|
18207
18397
|
throw new Error(`unsupported SwiftPM target ${edge.target}`);
|
|
18208
18398
|
dynamic = false;
|
|
18209
18399
|
} else if (type.startsWith("swiftpm.library.")) {
|
|
@@ -20126,10 +20316,11 @@ function sourceGuestRuntimeLinks(options) {
|
|
|
20126
20316
|
const links = [];
|
|
20127
20317
|
const requests = [];
|
|
20128
20318
|
const optionGroups = [
|
|
20129
|
-
{ object: null, flags:
|
|
20130
|
-
|
|
20319
|
+
{ object: null, flags: image.linkerFlags, autoLinked: false },
|
|
20320
|
+
{ object: null, flags: autolink, autoLinked: true },
|
|
20321
|
+
...image.clangLinkOptions.map((options2) => ({ ...options2, autoLinked: true }))
|
|
20131
20322
|
];
|
|
20132
|
-
for (const { object: object5, flags } of optionGroups) {
|
|
20323
|
+
for (const { object: object5, flags, autoLinked } of optionGroups) {
|
|
20133
20324
|
for (let index = 0; index < flags.length; index++) {
|
|
20134
20325
|
const flag = flags[index];
|
|
20135
20326
|
const artifact = artifacts.get(flag);
|
|
@@ -20146,6 +20337,7 @@ function sourceGuestRuntimeLinks(options) {
|
|
|
20146
20337
|
if (flag === "-framework") {
|
|
20147
20338
|
const name4 = flags[++index];
|
|
20148
20339
|
const provider = name4 && frameworkAliases.get(name4);
|
|
20340
|
+
if (!provider && name4 && autoLinked) continue;
|
|
20149
20341
|
if (!provider)
|
|
20150
20342
|
throw new Error(
|
|
20151
20343
|
`source image ${image.id} has unresolved framework linkage ${name4}`
|
|
@@ -21498,13 +21690,14 @@ async function runCompiler(command, args, options, stream = false, quiet) {
|
|
|
21498
21690
|
var WASM_TRIPLE = "wasm32-unknown-wasip1";
|
|
21499
21691
|
var SWIFTPM_PROGRESS = /^\[\d+\/\d+\] /;
|
|
21500
21692
|
var SWIFTPM_NOISE = /^(?:\[\d+\/\d+\] |Building for production\.\.\.$|warning: '--build-system native' has been deprecated)/;
|
|
21501
|
-
|
|
21502
|
-
|
|
21503
|
-
|
|
21504
|
-
|
|
21505
|
-
|
|
21506
|
-
)
|
|
21507
|
-
|
|
21693
|
+
function swiftBuildJobs() {
|
|
21694
|
+
const admittedCores = windowAdmission()?.cores ?? Number(process.env.TM_EXEC_CPU_CORES);
|
|
21695
|
+
return Math.min(
|
|
21696
|
+
4,
|
|
21697
|
+
Math.max(1, Math.floor(import_node_os11.default.availableParallelism() / 2)),
|
|
21698
|
+
Number.isInteger(admittedCores) && admittedCores > 0 ? admittedCores : 4
|
|
21699
|
+
);
|
|
21700
|
+
}
|
|
21508
21701
|
var SWIFT_BUILDER_TRANSPORT_MARGIN_MS = 3e5;
|
|
21509
21702
|
var SWIFT_BUILDER_DEFAULT_COMPILE_MS = 18e5;
|
|
21510
21703
|
function swiftBuilderHopTimeoutMs(compileTimeoutMs) {
|
|
@@ -22288,9 +22481,9 @@ var executableLinkFlags = (root) => ` "-Xclang-linker", "-O0",
|
|
|
22288
22481
|
`;
|
|
22289
22482
|
var darwinRecordsRegion = (quoted) => quoted.length ? ["-Wl,--start-lib", ...quoted, "-Wl,--end-lib"] : [];
|
|
22290
22483
|
var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
22291
|
-
var MULTI_MANIFEST_VERSION =
|
|
22484
|
+
var MULTI_MANIFEST_VERSION = 68;
|
|
22292
22485
|
var SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
|
|
22293
|
-
var compilerSourceDigest = true ? "
|
|
22486
|
+
var compilerSourceDigest = true ? "0be1de6e499585bfdd605805a7b9dbaa1f1e8d69f2a1a65d693d7952343a2edb" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
|
|
22294
22487
|
function swiftArtifactHash(input, release, moduleRoot) {
|
|
22295
22488
|
const hash = (0, import_node_crypto17.createHash)("sha256");
|
|
22296
22489
|
hash.update(`swift-compile
|
|
@@ -22432,7 +22625,23 @@ function emitSwiftPackageManifest(args) {
|
|
|
22432
22625
|
const distributionLink = args.distributionLink;
|
|
22433
22626
|
if (distribution && distributionLink) {
|
|
22434
22627
|
const isProvider = (object5) => object5.startsWith(`lib/${DARWIN_RECORDS_PREFIX}`);
|
|
22435
|
-
const
|
|
22628
|
+
const sourceModules = new Set(
|
|
22629
|
+
targets.filter(
|
|
22630
|
+
(target) => args.sourceSwiftTargets?.has(target.name) && !args.native?.get(target.name)?.clang
|
|
22631
|
+
).map((target) => swiftTargetModuleName(target.name))
|
|
22632
|
+
);
|
|
22633
|
+
const product = v5.parse(
|
|
22634
|
+
swiftFrameworkProductSchema,
|
|
22635
|
+
JSON.parse(
|
|
22636
|
+
(0, import_node_fs45.readFileSync)(import_node_path42.default.join(moduleRoot, SWIFT_FRAMEWORK_PRODUCT_FILE), "utf8")
|
|
22637
|
+
)
|
|
22638
|
+
);
|
|
22639
|
+
const replacedObjects = new Set(
|
|
22640
|
+
product.objects.filter((object5) => sourceModules.has(swiftTargetModuleName(object5.target))).map((object5) => object5.path)
|
|
22641
|
+
);
|
|
22642
|
+
const available = distribution.objects.filter(
|
|
22643
|
+
(object5) => !isProvider(object5) && !replacedObjects.has(object5)
|
|
22644
|
+
);
|
|
22436
22645
|
const objects = available.filter(
|
|
22437
22646
|
(object5) => !targets.some((target) => object5.startsWith(`lib/${target.name}-`)) && [...OPTIONAL_FRAMEWORKS, "SpriteKit", "PeachBox2D"].every(
|
|
22438
22647
|
(name3) => !object5.startsWith(`lib/${name3}-`) || reachedFrameworks.has(name3)
|
|
@@ -22747,14 +22956,6 @@ function syncSwiftTree(base, files2) {
|
|
|
22747
22956
|
var DIRECTIVE = /^[ \t]*#(?:if|elseif)\b/;
|
|
22748
22957
|
var OS_IOS = /\b(?:os\(\s*iOS\s*\)|targetEnvironment\(\s*simulator\s*\))/g;
|
|
22749
22958
|
var DELEGATE_CLASS = /^class\s+[A-Za-z_]\w*\s*(?:<[^>{]*>)?\s*:[^{]*\b(?:UIApplicationDelegate|UISceneDelegate|UIWindowSceneDelegate)\b[^{]*\{/;
|
|
22750
|
-
var REUSABLE_INIT = /^override(?=\s+(?:(?:public|open|internal)\s+)?init\s*\(\s*(?:style\s*:[^,)]*,\s*reuseIdentifier|reuseIdentifier)\s*:)/;
|
|
22751
|
-
var REUSABLE_VIEW_BASES = [
|
|
22752
|
-
"UICollectionReusableView",
|
|
22753
|
-
"UICollectionViewCell",
|
|
22754
|
-
"UICollectionViewListCell"
|
|
22755
|
-
];
|
|
22756
|
-
var CLASS_BASE = /^class\s+([A-Za-z_]\w*)\s*(?:<[^>{]*>)?\s*:\s*([A-Za-z_][\w.]*)[^{]*\{/;
|
|
22757
|
-
var FRAME_INIT = /^override(?=\s+(?:(?:public|open|internal)\s+)?init\s*\(\s*frame\s*:)/;
|
|
22758
22959
|
function compiledSwiftSources(files2, targets, overlayFrameworks) {
|
|
22759
22960
|
const ordered = [...targets].sort((a, b) => b.path.length - a.path.length);
|
|
22760
22961
|
return new Map(
|
|
@@ -23534,7 +23735,7 @@ var CORE_FOUNDATION_HANDLE_IMPORTS = [
|
|
|
23534
23735
|
"import CoreGraphics"
|
|
23535
23736
|
]).join("; ");
|
|
23536
23737
|
function foundationOwnerOf(name3) {
|
|
23537
|
-
if (name3 === "
|
|
23738
|
+
if (name3 === "NSKeyValueObservedChange" || name3 === "NSKeyValueObservation")
|
|
23538
23739
|
return "PeachObjC";
|
|
23539
23740
|
if (name3 === "DispatchData") return "Dispatch";
|
|
23540
23741
|
if (FOUNDATION_NETWORKING_TYPES.has(name3)) return "FoundationNetworking";
|
|
@@ -23554,10 +23755,6 @@ function swiftSourceAsIOS(source, overlayFrameworks, swiftPackage) {
|
|
|
23554
23755
|
}).join("\n");
|
|
23555
23756
|
let out = "";
|
|
23556
23757
|
let copied = 0;
|
|
23557
|
-
const reusableViews = new Set(REUSABLE_VIEW_BASES);
|
|
23558
|
-
const reusableBodies = [];
|
|
23559
|
-
let depth = 0;
|
|
23560
|
-
let opensReusableBody = false;
|
|
23561
23758
|
const sceneLifecycleBodies = /* @__PURE__ */ new Set();
|
|
23562
23759
|
for (const at of tokens2) {
|
|
23563
23760
|
const rest = conditioned.slice(at, at + 400);
|
|
@@ -23566,21 +23763,6 @@ function swiftSourceAsIOS(source, overlayFrameworks, swiftPackage) {
|
|
|
23566
23763
|
out += conditioned.slice(copied, at + 1) + " public var _peachUsesSceneLifecycle: Bool { true };";
|
|
23567
23764
|
copied = at + 1;
|
|
23568
23765
|
}
|
|
23569
|
-
depth++;
|
|
23570
|
-
if (opensReusableBody) reusableBodies.push(depth);
|
|
23571
|
-
opensReusableBody = false;
|
|
23572
|
-
continue;
|
|
23573
|
-
}
|
|
23574
|
-
if (rest.startsWith("}")) {
|
|
23575
|
-
if (reusableBodies.at(-1) === depth) reusableBodies.pop();
|
|
23576
|
-
depth--;
|
|
23577
|
-
continue;
|
|
23578
|
-
}
|
|
23579
|
-
if (rest.startsWith("override")) {
|
|
23580
|
-
if (REUSABLE_INIT.test(rest) || reusableBodies.at(-1) === depth && FRAME_INIT.test(rest)) {
|
|
23581
|
-
out += `${conditioned.slice(copied, at)}required`;
|
|
23582
|
-
copied = at + "override".length;
|
|
23583
|
-
}
|
|
23584
23766
|
continue;
|
|
23585
23767
|
}
|
|
23586
23768
|
const imported = conditioned[at - 1] === "." ? null : /^import[ \t]+([A-Za-z_]\w*)(?:[ \t]*\.[ \t]*[A-Za-z_]\w*)+/.exec(rest);
|
|
@@ -23625,11 +23807,6 @@ function swiftSourceAsIOS(source, overlayFrameworks, swiftPackage) {
|
|
|
23625
23807
|
continue;
|
|
23626
23808
|
}
|
|
23627
23809
|
if (rest.startsWith("class")) {
|
|
23628
|
-
const declared = CLASS_BASE.exec(rest);
|
|
23629
|
-
if (declared && reusableViews.has(declared[2].split(".").pop())) {
|
|
23630
|
-
reusableViews.add(declared[1]);
|
|
23631
|
-
opensReusableBody = true;
|
|
23632
|
-
}
|
|
23633
23810
|
const modifiers = conditioned.slice(conditioned.lastIndexOf("\n", at - 1) + 1, at);
|
|
23634
23811
|
const delegateClass = DELEGATE_CLASS.exec(rest);
|
|
23635
23812
|
if (delegateClass && /\bUIApplicationDelegate\b/.test(delegateClass[0])) {
|
|
@@ -24149,7 +24326,7 @@ function swiftCodeScan(source) {
|
|
|
24149
24326
|
else top.parens--;
|
|
24150
24327
|
i++;
|
|
24151
24328
|
} else {
|
|
24152
|
-
const keyword = source.startsWith("class", i) ? "class" : source.startsWith("extension", i) ? "extension" : source.startsWith("override", i) ? "override" : source.startsWith("import", i) ? "import" : source.startsWith("func", i) ? "func" : source.startsWith("UIApplicationMain", i) ? "UIApplicationMain" : source.startsWith("
|
|
24329
|
+
const keyword = source.startsWith("class", i) ? "class" : source.startsWith("extension", i) ? "extension" : source.startsWith("override", i) ? "override" : source.startsWith("import", i) ? "import" : source.startsWith("func", i) ? "func" : source.startsWith("UIApplicationMain", i) ? "UIApplicationMain" : source.startsWith("Foundation", i) ? "Foundation" : source.startsWith("CoreFoundation", i) ? "CoreFoundation" : source.startsWith("ObjectiveC", i) ? "ObjectiveC" : source.startsWith("_LocationEssentials", i) ? "_LocationEssentials" : null;
|
|
24153
24330
|
if (keyword && !/[\w$]/.test(source[i - 1] ?? "") && !/[\w$]/.test(source[i + keyword.length] ?? "")) {
|
|
24154
24331
|
tokens2.push(i);
|
|
24155
24332
|
i += keyword.length;
|
|
@@ -25056,6 +25233,7 @@ module ${moduleName}.Swift {
|
|
|
25056
25233
|
return projectOverlayFrameworks;
|
|
25057
25234
|
}
|
|
25058
25235
|
);
|
|
25236
|
+
const libraryEntryFiles = /* @__PURE__ */ new Map();
|
|
25059
25237
|
for (const target of [...targets]) {
|
|
25060
25238
|
if (!target.executable || ![...native.values()].some((value) => value.late?.producers.includes(target.name)))
|
|
25061
25239
|
continue;
|
|
@@ -25111,7 +25289,18 @@ module ${moduleName}.Swift {
|
|
|
25111
25289
|
`mixed executable ${target.name} requires one typed Swift application entry`
|
|
25112
25290
|
);
|
|
25113
25291
|
}
|
|
25114
|
-
if (!nativeEntry)
|
|
25292
|
+
if (!nativeEntry) {
|
|
25293
|
+
compiled.set(entryFile, entrySource);
|
|
25294
|
+
if (import_node_path42.default.basename(entryFile) === "main.swift") {
|
|
25295
|
+
const libraryEntry = import_node_path42.default.posix.join(
|
|
25296
|
+
import_node_path42.default.posix.dirname(entryFile),
|
|
25297
|
+
"PeachApplicationEntry.generated.swift"
|
|
25298
|
+
);
|
|
25299
|
+
if (Object.hasOwn(input.files, libraryEntry))
|
|
25300
|
+
throw new Error(`mixed application entry conflicts with ${libraryEntry}`);
|
|
25301
|
+
libraryEntryFiles.set(entryFile, libraryEntry);
|
|
25302
|
+
}
|
|
25303
|
+
}
|
|
25115
25304
|
const name3 = `${target.name}Executable`;
|
|
25116
25305
|
if (targets.some((candidate) => candidate.name === name3))
|
|
25117
25306
|
throw new Error(`mixed application executable target conflicts with ${name3}`);
|
|
@@ -25259,7 +25448,7 @@ module ${moduleName}.Swift {
|
|
|
25259
25448
|
}
|
|
25260
25449
|
for (const [file, contents] of Object.entries(input.files)) {
|
|
25261
25450
|
if (file === "Package.swift") continue;
|
|
25262
|
-
const destination = import_node_path42.default.join(base, file);
|
|
25451
|
+
const destination = import_node_path42.default.join(base, libraryEntryFiles.get(file) ?? file);
|
|
25263
25452
|
const interfaceModule = /(?:^|\/)(\w+)-Swift\.h$/.exec(file)?.[1];
|
|
25264
25453
|
const localInterface = interfaceModule && swiftTargets.has(interfaceModule) ? `#include ${JSON.stringify(
|
|
25265
25454
|
import_node_path42.default.relative(
|
|
@@ -25318,9 +25507,16 @@ module ${moduleName}.Swift {
|
|
|
25318
25507
|
emitSwiftPackageManifest({
|
|
25319
25508
|
root: layout2.root,
|
|
25320
25509
|
files: files2,
|
|
25321
|
-
targets: manifestTargets
|
|
25510
|
+
targets: manifestTargets.map((target) => ({
|
|
25511
|
+
...target,
|
|
25512
|
+
sources: target.sources?.map((source) => {
|
|
25513
|
+
const entry = libraryEntryFiles.get(import_node_path42.default.posix.join(target.path, source));
|
|
25514
|
+
return entry ? import_node_path42.default.posix.relative(target.path, entry) : source;
|
|
25515
|
+
})
|
|
25516
|
+
})),
|
|
25322
25517
|
packages,
|
|
25323
25518
|
native,
|
|
25519
|
+
sourceSwiftTargets: swiftTargets,
|
|
25324
25520
|
nativeFlags,
|
|
25325
25521
|
nativeImportFlags,
|
|
25326
25522
|
nativeHeaderFlags,
|
|
@@ -25896,7 +26092,7 @@ async function buildFrameworkProducts(scratch2, args) {
|
|
|
25896
26092
|
"--build-system",
|
|
25897
26093
|
"native",
|
|
25898
26094
|
"-j",
|
|
25899
|
-
|
|
26095
|
+
String(swiftBuildJobs()),
|
|
25900
26096
|
"--package-path",
|
|
25901
26097
|
linkRoot,
|
|
25902
26098
|
"--scratch-path",
|
|
@@ -25914,7 +26110,7 @@ async function buildFrameworkProducts(scratch2, args) {
|
|
|
25914
26110
|
"-Xswiftc",
|
|
25915
26111
|
"-num-threads",
|
|
25916
26112
|
"-Xswiftc",
|
|
25917
|
-
|
|
26113
|
+
String(swiftBuildJobs()),
|
|
25918
26114
|
...swiftReproducibleBuildFlags([
|
|
25919
26115
|
[import_node_path42.default.dirname(args.toolchainBin), "toolchain"],
|
|
25920
26116
|
[args.moduleRoot, "framework"],
|
|
@@ -26393,7 +26589,7 @@ function compileSwiftProjectOnce(input, options) {
|
|
|
26393
26589
|
"--build-system",
|
|
26394
26590
|
"native",
|
|
26395
26591
|
"-j",
|
|
26396
|
-
|
|
26592
|
+
String(swiftBuildJobs()),
|
|
26397
26593
|
"--package-path",
|
|
26398
26594
|
root,
|
|
26399
26595
|
...swiftCompileSdkOptions(frameworkRoot, options.toolchainBin),
|
|
@@ -26406,7 +26602,7 @@ function compileSwiftProjectOnce(input, options) {
|
|
|
26406
26602
|
"-Xswiftc",
|
|
26407
26603
|
"-num-threads",
|
|
26408
26604
|
"-Xswiftc",
|
|
26409
|
-
|
|
26605
|
+
String(swiftBuildJobs()),
|
|
26410
26606
|
...swiftReproducibleBuildFlags([
|
|
26411
26607
|
[import_node_path42.default.dirname(options.toolchainBin), "toolchain"],
|
|
26412
26608
|
[frameworkRoot, "framework"],
|
|
@@ -28666,7 +28862,7 @@ ${output2}`
|
|
|
28666
28862
|
}
|
|
28667
28863
|
project.visitMembers(
|
|
28668
28864
|
targetId,
|
|
28669
|
-
project.
|
|
28865
|
+
xcodePathResolver(project.objects, project.projectDir, import_node_path46.default.join, settings),
|
|
28670
28866
|
(file) => isDirectory(file) ? walkFiles(file) : import_node_fs48.default.existsSync(file) ? [file] : [],
|
|
28671
28867
|
import_node_path46.default.join,
|
|
28672
28868
|
(file, kind) => {
|
|
@@ -28689,6 +28885,55 @@ ${output2}`
|
|
|
28689
28885
|
if (file.endsWith(".swift")) sources.add(file);
|
|
28690
28886
|
}
|
|
28691
28887
|
);
|
|
28888
|
+
if (options.prepareGeneratedSources && options.requireSources !== false) {
|
|
28889
|
+
const definitions = [...allSources].filter(
|
|
28890
|
+
(file) => file.endsWith(".intentdefinition")
|
|
28891
|
+
);
|
|
28892
|
+
if (definitions.length > 0 && process.platform !== "darwin")
|
|
28893
|
+
throw new Error(
|
|
28894
|
+
`${targetName}: intent definition code generation requires macOS and Xcode`
|
|
28895
|
+
);
|
|
28896
|
+
for (const definition2 of definitions) {
|
|
28897
|
+
const configuredLanguage = settings("INTENTS_CODEGEN_LANGUAGE");
|
|
28898
|
+
const language = !configuredLanguage || configuredLanguage === "Automatic" ? sources.size > 0 ? "Swift" : "Objective-C" : configuredLanguage;
|
|
28899
|
+
const output2 = import_node_path46.default.join(
|
|
28900
|
+
settings("DERIVED_FILE_DIR"),
|
|
28901
|
+
"IntentDefinitionGenerated",
|
|
28902
|
+
import_node_path46.default.basename(definition2, ".intentdefinition")
|
|
28903
|
+
);
|
|
28904
|
+
import_node_fs48.default.rmSync(output2, { recursive: true, force: true });
|
|
28905
|
+
import_node_fs48.default.mkdirSync(output2, { recursive: true });
|
|
28906
|
+
const args = [
|
|
28907
|
+
"intentbuilderc",
|
|
28908
|
+
"generate",
|
|
28909
|
+
"-input",
|
|
28910
|
+
definition2,
|
|
28911
|
+
"-output",
|
|
28912
|
+
output2,
|
|
28913
|
+
"-classPrefix",
|
|
28914
|
+
settings("PROJECT_CLASS_PREFIX"),
|
|
28915
|
+
"-language",
|
|
28916
|
+
language,
|
|
28917
|
+
"-visibility",
|
|
28918
|
+
"public"
|
|
28919
|
+
];
|
|
28920
|
+
if (language === "Swift")
|
|
28921
|
+
args.push("-swiftVersion", settings("SWIFT_VERSION") || "5.0");
|
|
28922
|
+
if (settings("DEFINES_MODULE") === "YES")
|
|
28923
|
+
args.push("-moduleName", settings("PRODUCT_MODULE_NAME"));
|
|
28924
|
+
(0, import_node_child_process27.execFileSync)("xcrun", args, {
|
|
28925
|
+
cwd: project.projectDir,
|
|
28926
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
28927
|
+
timeout: runScriptTimeoutMs
|
|
28928
|
+
});
|
|
28929
|
+
projectInputs.add(definition2);
|
|
28930
|
+
for (const file of walkFiles(output2)) {
|
|
28931
|
+
allSources.add(file);
|
|
28932
|
+
if (file.endsWith(".swift")) sources.add(file);
|
|
28933
|
+
if (HEADER_FILE.test(file)) headers.add(file);
|
|
28934
|
+
}
|
|
28935
|
+
}
|
|
28936
|
+
}
|
|
28692
28937
|
return {
|
|
28693
28938
|
sources: [...sources].sort(),
|
|
28694
28939
|
resources: [...resources].sort(),
|
|
@@ -29045,6 +29290,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
29045
29290
|
TARGETNAME: "$(TARGET_NAME)",
|
|
29046
29291
|
PROJECT: "$(PROJECT_NAME)",
|
|
29047
29292
|
PROJECT_NAME: import_node_path46.default.basename(ref.project.xcodeproj, ".xcodeproj"),
|
|
29293
|
+
PROJECT_CLASS_PREFIX: isDict(ref.project.project.attributes) ? str(ref.project.project.attributes.CLASSPREFIX) ?? "" : "",
|
|
29048
29294
|
PROJECT_FILE_PATH: ref.project.xcodeproj,
|
|
29049
29295
|
SRCROOT: ref.project.projectDir,
|
|
29050
29296
|
SOURCE_ROOT: ref.project.projectDir,
|
|
@@ -31238,7 +31484,7 @@ function sourceClosureDigest(srcDir, entrypoints) {
|
|
|
31238
31484
|
return hash.digest("hex");
|
|
31239
31485
|
}
|
|
31240
31486
|
var standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS);
|
|
31241
|
-
var STANDIN_SOURCE_DIGEST = true ? "
|
|
31487
|
+
var STANDIN_SOURCE_DIGEST = true ? "f22bd8f1239a91af778d6520980a12d70026c38b44b902f5f74e989a7f9e5a4b" : standinSourceDigest();
|
|
31242
31488
|
|
|
31243
31489
|
// src/expoSwiftContract.ts
|
|
31244
31490
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
@@ -31568,7 +31814,7 @@ async function packageTreeDigest(root) {
|
|
|
31568
31814
|
|
|
31569
31815
|
// src/expo-native-prebuilt.ts
|
|
31570
31816
|
var EXPO_NATIVE_ENTRY_NAME = "ios";
|
|
31571
|
-
var EXPO_NATIVE_COMPILER_DIGEST = true ? "
|
|
31817
|
+
var EXPO_NATIVE_COMPILER_DIGEST = true ? "b47302e942b775c322039be90321ad78f13adf20d97071d4d4c59e01c983dfca" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
|
|
31572
31818
|
var IDENTITY_SOURCE_SKIPS = 1 | 4 | 8 | 16 | 32 | 64 | 128 | 4096;
|
|
31573
31819
|
function readSources(value) {
|
|
31574
31820
|
const sources = isRecord(value) ? value.sources : null;
|
|
@@ -32397,7 +32643,8 @@ async function resolveSwiftPackagesAsync(options) {
|
|
|
32397
32643
|
}
|
|
32398
32644
|
function resolveSwiftPackages(options) {
|
|
32399
32645
|
const { rootDir, resolved, products, localDirs } = options;
|
|
32400
|
-
const
|
|
32646
|
+
const providedTargets = new Set(options.provided ?? []);
|
|
32647
|
+
const providedProducts = new Set(options.provided ?? []);
|
|
32401
32648
|
const result = {
|
|
32402
32649
|
sourceLinks: { targets: [], owners: [] },
|
|
32403
32650
|
targets: [],
|
|
@@ -32487,7 +32734,7 @@ function resolveSwiftPackages(options) {
|
|
|
32487
32734
|
if (targetOutcomes.has(key2)) return targetOutcomes.get(key2);
|
|
32488
32735
|
targetOutcomes.set(key2, []);
|
|
32489
32736
|
const outcome = (() => {
|
|
32490
|
-
if (
|
|
32737
|
+
if (providedTargets.has(name3)) return [];
|
|
32491
32738
|
const target = pkg.manifest.targets.get(name3);
|
|
32492
32739
|
if (!target)
|
|
32493
32740
|
return [`${import_node_path62.default.basename(pkg.manifest.dir)} declares no target ${name3}`];
|
|
@@ -32535,14 +32782,14 @@ function resolveSwiftPackages(options) {
|
|
|
32535
32782
|
};
|
|
32536
32783
|
const productOutcomes = /* @__PURE__ */ new Map();
|
|
32537
32784
|
const resolveProduct = (pkg, product) => {
|
|
32538
|
-
if (
|
|
32785
|
+
if (providedProducts.has(product)) return [];
|
|
32539
32786
|
const roots = pkg.manifest.products.get(product)?.targets;
|
|
32540
32787
|
const reason = !roots ? [`${import_node_path62.default.basename(pkg.manifest.dir)} has no library ${product}`] : blockers(roots.map((name3) => resolveTarget(pkg, name3)));
|
|
32541
32788
|
productOutcomes.set(`${pkg.manifest.dir}\0${product}`, { pkg, reason });
|
|
32542
32789
|
return reason;
|
|
32543
32790
|
};
|
|
32544
32791
|
const resolveDependencyProduct = (pkg, dependency) => {
|
|
32545
|
-
if (
|
|
32792
|
+
if (providedProducts.has(dependency.name)) return [];
|
|
32546
32793
|
const loaded2 = dependencyPackage(pkg, dependency);
|
|
32547
32794
|
return typeof loaded2 === "string" ? [loaded2] : loaded2 ? resolveProduct(loaded2, dependency.name) : [];
|
|
32548
32795
|
};
|
|
@@ -32575,7 +32822,7 @@ function resolveSwiftPackages(options) {
|
|
|
32575
32822
|
))
|
|
32576
32823
|
return false;
|
|
32577
32824
|
claimed.add(key2);
|
|
32578
|
-
|
|
32825
|
+
providedTargets.delete(name3);
|
|
32579
32826
|
for (const dependency of target.dependencies) {
|
|
32580
32827
|
if (dependency.kind === "target") claimTarget(pkg, dependency.name);
|
|
32581
32828
|
else {
|
|
@@ -32588,7 +32835,7 @@ function resolveSwiftPackages(options) {
|
|
|
32588
32835
|
const claimProduct = (pkg, product) => {
|
|
32589
32836
|
const roots = pkg.manifest.products.get(product)?.targets ?? [];
|
|
32590
32837
|
if (roots.map((name3) => claimTarget(pkg, name3)).some(Boolean))
|
|
32591
|
-
|
|
32838
|
+
providedProducts.delete(product);
|
|
32592
32839
|
};
|
|
32593
32840
|
for (const { product, source } of products) {
|
|
32594
32841
|
if (source.kind === "remote" && !options.provided) continue;
|
|
@@ -32596,7 +32843,7 @@ function resolveSwiftPackages(options) {
|
|
|
32596
32843
|
if (pkg && typeof pkg !== "string") claimProduct(pkg, product);
|
|
32597
32844
|
}
|
|
32598
32845
|
for (const { product, source } of products) {
|
|
32599
|
-
if (
|
|
32846
|
+
if (providedProducts.has(product)) continue;
|
|
32600
32847
|
if (source.kind === "remote" && !options.provided) continue;
|
|
32601
32848
|
const pkg = source.kind === "unnamed" ? unnamed(source, product) : load2(source);
|
|
32602
32849
|
const reason = pkg === void 0 ? ["no package the workspace references vends it"] : typeof pkg === "string" ? [pkg] : resolveProduct(pkg, product);
|
|
@@ -32678,10 +32925,10 @@ function resolveSwiftPackages(options) {
|
|
|
32678
32925
|
if (found.has(key2)) return;
|
|
32679
32926
|
found.add(key2);
|
|
32680
32927
|
if (pkg.manifest.targets.get(name3)?.type === "macro") return;
|
|
32681
|
-
if (
|
|
32928
|
+
if (providedTargets.has(name3) && placeholderPackage(pkg)) return;
|
|
32682
32929
|
for (const dependency of pkg.manifest.targets.get(name3)?.dependencies ?? []) {
|
|
32683
32930
|
if (dependency.kind === "target") visit3(pkg, dependency.name);
|
|
32684
|
-
else if (!
|
|
32931
|
+
else if (!providedProducts.has(dependency.name)) {
|
|
32685
32932
|
const nested = dependencyPackage(pkg, dependency);
|
|
32686
32933
|
if (nested && typeof nested !== "string")
|
|
32687
32934
|
for (const root of nested.manifest.products.get(dependency.name)?.targets ?? [])
|
|
@@ -32690,7 +32937,7 @@ function resolveSwiftPackages(options) {
|
|
|
32690
32937
|
}
|
|
32691
32938
|
};
|
|
32692
32939
|
for (const { product, source } of listed) {
|
|
32693
|
-
if (
|
|
32940
|
+
if (providedProducts.has(product)) continue;
|
|
32694
32941
|
const pkg = source.kind === "unnamed" ? unnamed(source, product) : packages.get(sourceKey(source));
|
|
32695
32942
|
if (!pkg || typeof pkg === "string") continue;
|
|
32696
32943
|
for (const root of pkg.manifest.products.get(product)?.targets ?? [])
|
|
@@ -32767,7 +33014,7 @@ function resolveSwiftPackages(options) {
|
|
|
32767
33014
|
target.dependencies = (target.dependencies ?? []).flatMap(
|
|
32768
33015
|
(dependency) => {
|
|
32769
33016
|
if (dependency.kind === "target") return [dependency];
|
|
32770
|
-
if (
|
|
33017
|
+
if (providedProducts.has(dependency.name)) return [];
|
|
32771
33018
|
const nested = dependencyPackage(pkg, dependency);
|
|
32772
33019
|
if (!nested || typeof nested === "string") return [];
|
|
32773
33020
|
if (nativePackages.has(nested.manifest.dir))
|
|
@@ -32827,7 +33074,7 @@ function resolveSwiftPackages(options) {
|
|
|
32827
33074
|
});
|
|
32828
33075
|
result.sourceLinks.targets.push({
|
|
32829
33076
|
id,
|
|
32830
|
-
sourceTarget: target.type === "regular" && !
|
|
33077
|
+
sourceTarget: target.type === "regular" && !providedTargets.has(name3) ? name3 : null,
|
|
32831
33078
|
productName: name3,
|
|
32832
33079
|
productType: `swiftpm.target.${target.type}`,
|
|
32833
33080
|
machOType: null,
|
|
@@ -33482,6 +33729,12 @@ function binaryHeaderSearchPaths(binary2, root, declaredFrameworks) {
|
|
|
33482
33729
|
const headers = libraryHeaders && import_node_fs68.default.existsSync(libraryHeaders) ? [libraryHeaders] : [];
|
|
33483
33730
|
if (headers.length === 0 && frameworks.length === 0)
|
|
33484
33731
|
return { frameworks: [], headers: [] };
|
|
33732
|
+
const provided = new Set(
|
|
33733
|
+
declaredFrameworks ? swiftPeachModules(declaredFrameworks.moduleRoot) : []
|
|
33734
|
+
);
|
|
33735
|
+
const providedFrameworks = frameworks.filter(
|
|
33736
|
+
(framework) => provided.has(import_node_path65.default.basename(framework, ".framework"))
|
|
33737
|
+
);
|
|
33485
33738
|
const declared = /* @__PURE__ */ new Map();
|
|
33486
33739
|
for (const framework of frameworks) {
|
|
33487
33740
|
const name3 = import_node_path65.default.basename(framework, ".framework");
|
|
@@ -33508,12 +33761,14 @@ function binaryHeaderSearchPaths(binary2, root, declaredFrameworks) {
|
|
|
33508
33761
|
}
|
|
33509
33762
|
}
|
|
33510
33763
|
const declaredDigest = (0, import_node_crypto32.createHash)("sha256");
|
|
33764
|
+
for (const framework of providedFrameworks)
|
|
33765
|
+
declaredDigest.update(`provided/${import_node_path65.default.relative(artifact.dir, framework)}\0`);
|
|
33511
33766
|
for (const [framework, { declared: names, imports: imports2, sdkHeader }] of declared)
|
|
33512
33767
|
declaredDigest.update(import_node_path65.default.relative(artifact.dir, framework)).update([...names ?? []].sort().join("\0")).update("\n").update([...imports2].sort().join("\0")).update(sdkHeader ?? "");
|
|
33513
33768
|
const staging = import_node_path65.default.join(
|
|
33514
33769
|
root,
|
|
33515
33770
|
"peach-binary-trees",
|
|
33516
|
-
declared.size ? `${artifact.digest.slice(0, 32)}-${declaredDigest.digest("hex").slice(0, 16)}` : artifact.digest.slice(0, 32)
|
|
33771
|
+
declared.size || providedFrameworks.length ? `${artifact.digest.slice(0, 32)}-${declaredDigest.digest("hex").slice(0, 16)}` : artifact.digest.slice(0, 32)
|
|
33517
33772
|
);
|
|
33518
33773
|
const revision = import_node_path65.default.join(staging, "revisions", STANDIN_SOURCE_DIGEST.slice(0, 32));
|
|
33519
33774
|
const stageTree = () => {
|
|
@@ -33536,7 +33791,11 @@ function binaryHeaderSearchPaths(binary2, root, declaredFrameworks) {
|
|
|
33536
33791
|
import_node_fs68.default.cpSync(
|
|
33537
33792
|
import_node_path65.default.join(framework, part),
|
|
33538
33793
|
import_node_path65.default.join(pending, "frameworks", import_node_path65.default.basename(framework), part),
|
|
33539
|
-
{
|
|
33794
|
+
{
|
|
33795
|
+
recursive: true,
|
|
33796
|
+
dereference: true,
|
|
33797
|
+
filter: (source) => !providedFrameworks.includes(framework) || import_node_path65.default.basename(source) !== `${import_node_path65.default.basename(framework, ".framework")}-Swift.h`
|
|
33798
|
+
}
|
|
33540
33799
|
);
|
|
33541
33800
|
const surface = found.find(
|
|
33542
33801
|
(item) => "headers" in item && import_node_path65.default.dirname(item.headers) === framework
|
|
@@ -33572,6 +33831,22 @@ function binaryHeaderSearchPaths(binary2, root, declaredFrameworks) {
|
|
|
33572
33831
|
}
|
|
33573
33832
|
}
|
|
33574
33833
|
const contents = (0, import_node_crypto32.createHash)("sha256");
|
|
33834
|
+
for (const framework of providedFrameworks.filter((item) => !declared.has(item))) {
|
|
33835
|
+
const modulemap = import_node_path65.default.join(
|
|
33836
|
+
pending,
|
|
33837
|
+
"frameworks",
|
|
33838
|
+
import_node_path65.default.basename(framework),
|
|
33839
|
+
"Modules/module.modulemap"
|
|
33840
|
+
);
|
|
33841
|
+
const swiftModule = `${import_node_path65.default.basename(framework, ".framework")}.Swift`;
|
|
33842
|
+
import_node_fs68.default.writeFileSync(
|
|
33843
|
+
modulemap,
|
|
33844
|
+
import_node_fs68.default.readFileSync(modulemap, "utf8").replace(
|
|
33845
|
+
/\bmodule\s+([\w.]+)\s*\{[^{}]*\}/g,
|
|
33846
|
+
(declaration, name4) => name4 === swiftModule ? "" : declaration
|
|
33847
|
+
)
|
|
33848
|
+
);
|
|
33849
|
+
}
|
|
33575
33850
|
for (const relative3 of import_node_fs68.default.readdirSync(pending, { recursive: true, encoding: "utf8" }).sort()) {
|
|
33576
33851
|
const file = import_node_path65.default.join(pending, relative3);
|
|
33577
33852
|
contents.update(`${relative3}\0`);
|
|
@@ -33900,6 +34175,7 @@ function swiftStandin(surface, binary2, toolchain, work, behavior, siblings) {
|
|
|
33900
34175
|
binary2,
|
|
33901
34176
|
toolchain,
|
|
33902
34177
|
work,
|
|
34178
|
+
/* @__PURE__ */ new Set(),
|
|
33903
34179
|
behavior,
|
|
33904
34180
|
// the interface's imports peach ships carry the types its declarations name
|
|
33905
34181
|
[...new Set(imports2)].filter(
|
|
@@ -33972,6 +34248,7 @@ function placeholderStandin(surface, binary2, toolchain, work, behavior, sibling
|
|
|
33972
34248
|
binary2,
|
|
33973
34249
|
toolchain,
|
|
33974
34250
|
work,
|
|
34251
|
+
/* @__PURE__ */ new Set(),
|
|
33975
34252
|
behavior,
|
|
33976
34253
|
imports2.filter((module2) => siblings.has(module2)),
|
|
33977
34254
|
false,
|
|
@@ -34115,6 +34392,7 @@ function mixedStandin(surface, binary2, toolchain, work, behavior, frameworkDirs
|
|
|
34115
34392
|
binary2,
|
|
34116
34393
|
toolchain,
|
|
34117
34394
|
work,
|
|
34395
|
+
view.requiredInits ?? /* @__PURE__ */ new Set(),
|
|
34118
34396
|
behavior,
|
|
34119
34397
|
imports2,
|
|
34120
34398
|
true,
|
|
@@ -34199,6 +34477,7 @@ function objcStandin(surface, binary2, toolchain, work, behavior, frameworks, si
|
|
|
34199
34477
|
binary2,
|
|
34200
34478
|
toolchain,
|
|
34201
34479
|
work,
|
|
34480
|
+
/* @__PURE__ */ new Set(),
|
|
34202
34481
|
behavior,
|
|
34203
34482
|
[
|
|
34204
34483
|
.../* @__PURE__ */ new Set([
|
|
@@ -34218,7 +34497,7 @@ function objcStandin(surface, binary2, toolchain, work, behavior, frameworks, si
|
|
|
34218
34497
|
}
|
|
34219
34498
|
var OBJC_UNREPRESENTABLE = "cannot be marked '@objc' because its type cannot be represented in Objective-C";
|
|
34220
34499
|
var INERT_VALUE = /missing argument|cannot be constructed|has no member 'init'|no exact matches in call to initializer|cannot convert return expression|does not conform to '|extra argument|takes no arguments|could not be inferred|cannot infer/;
|
|
34221
|
-
function graphStandin(module2, graphs, values, wasm, binary2, toolchain, work, behavior, imports2 = [], requireSwift = false, objcProperties = /* @__PURE__ */ new Map(), placeholder = null, inheritedConformances = /* @__PURE__ */ new Map(), projections = /* @__PURE__ */ new Map(), dependencyGraphs = []) {
|
|
34500
|
+
function graphStandin(module2, graphs, values, wasm, binary2, toolchain, work, requiredInits2, behavior, imports2 = [], requireSwift = false, objcProperties = /* @__PURE__ */ new Map(), placeholder = null, inheritedConformances = /* @__PURE__ */ new Map(), projections = /* @__PURE__ */ new Map(), dependencyGraphs = []) {
|
|
34222
34501
|
const paths = new Set(
|
|
34223
34502
|
graphs.flatMap(
|
|
34224
34503
|
(graph) => graph.symbols.map((symbol2) => symbol2.pathComponents.join("."))
|
|
@@ -34263,6 +34542,7 @@ function graphStandin(module2, graphs, values, wasm, binary2, toolchain, work, b
|
|
|
34263
34542
|
module: module2,
|
|
34264
34543
|
source: `${binary2.target} (${binary2.source})`,
|
|
34265
34544
|
values,
|
|
34545
|
+
requiredInits: requiredInits2,
|
|
34266
34546
|
behavior,
|
|
34267
34547
|
omit,
|
|
34268
34548
|
plain,
|
|
@@ -34473,6 +34753,7 @@ function cStandin(surface, binary2, toolchain, work) {
|
|
|
34473
34753
|
])
|
|
34474
34754
|
);
|
|
34475
34755
|
const include = import_node_path65.default.join(work, "include");
|
|
34756
|
+
import_node_fs68.default.mkdirSync(include, { recursive: true });
|
|
34476
34757
|
for (const [file, text5] of texts) {
|
|
34477
34758
|
import_node_fs68.default.mkdirSync(import_node_path65.default.dirname(import_node_path65.default.join(include, file)), { recursive: true });
|
|
34478
34759
|
import_node_fs68.default.writeFileSync(import_node_path65.default.join(include, file), text5);
|
|
@@ -36646,7 +36927,7 @@ async function prepareXcodeObjCImplementations(app, binaries, moduleRoot) {
|
|
|
36646
36927
|
let interrupted = false;
|
|
36647
36928
|
await mapLimit(
|
|
36648
36929
|
units,
|
|
36649
|
-
|
|
36930
|
+
swiftBuildJobs(),
|
|
36650
36931
|
async ({ target, index, unit: unit2, file }, position) => {
|
|
36651
36932
|
if (interrupted) return;
|
|
36652
36933
|
const minimum = minimums[index];
|