peachsim 0.1.2018 → 0.1.2019
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/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 +379 -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 +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +373 -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 +378 -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 +74 -15
- 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 +74 -15
- package/dist-lib/native-app-identity-project.cjs +72 -13
- package/dist-lib/native-app-identity-project.mjs +72 -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 +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +380 -103
- 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 +372 -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/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 +55 -1
- package/src/xcode-target-members.ts +4 -0
package/dist-lib/vite-swift.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2019 | (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": "ac16dcf0d45e79a08b0cce4923526a24ae1509c4aefd6d468dba688e5877e5f9", "xcode-target-members.ts": "ad7589132bffab265e8a10b64e24484fe88b4a2b1cc0ee19a97f151a002eca77", "xcode-json-project.ts": "41990ebbe4b488eef34e74c4608b4b48e5a5b299ba98ca7fbcfdfa0e77be63b6", "openstep-plist.ts": "74e6ce1dac80c9c318e0e9f5e3e8cd19a898a8820c36fc160609695bcb59dcd3" };
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
45
|
|
|
@@ -4386,6 +4386,24 @@ function swiftSdkOptions() {
|
|
|
4386
4386
|
var SWIFT_HOST_COMPILER_RELEASE = "swift-6.4.0-RELEASE-custom-81b2c791c27276bf";
|
|
4387
4387
|
var SWIFT_HOST_COMPILER_ID = "81b2c791c27276bf";
|
|
4388
4388
|
var compilerArchives = {
|
|
4389
|
+
"swift-6.4.0-RELEASE-custom-11345d60dca47496": {
|
|
4390
|
+
identity: "11345d60dca47496",
|
|
4391
|
+
archive: "tar.zst",
|
|
4392
|
+
hosts: {
|
|
4393
|
+
"darwin-arm64": {
|
|
4394
|
+
checksum: "3df74a95c6f3ffa45aaa412027b390c99f9af81f6f6a41bf6d58a1a3079b5b02",
|
|
4395
|
+
manifest: "8e5ed4be6adc967e4c7d955eff004c96d5dc050a589d50e1b3e694b70f9afd63"
|
|
4396
|
+
},
|
|
4397
|
+
"linux-x64": {
|
|
4398
|
+
checksum: "a80e46add069932114bacc18640dc2e6a1a8f2a3ea7306a8ea8614d5cdf6e0e7",
|
|
4399
|
+
manifest: "662d8869534f3cce827b1205973db1f9a1e1d92027005a5bdb6893f9c2a0b39d"
|
|
4400
|
+
},
|
|
4401
|
+
"linux-arm64": {
|
|
4402
|
+
checksum: "4ca69bbc284fc7d54be57c80b744b88cce997d470ff23048795db54e7a6fbcba",
|
|
4403
|
+
manifest: "85df84da2f814b6a71c264b37b83a81965ac33b5d2b465443d60c08cc7bc5dc3"
|
|
4404
|
+
}
|
|
4405
|
+
}
|
|
4406
|
+
},
|
|
4389
4407
|
"swift-6.4.0-RELEASE-custom-45bb46301c86fe73": {
|
|
4390
4408
|
identity: "45bb46301c86fe73",
|
|
4391
4409
|
archive: "tar.gz",
|
|
@@ -4600,7 +4618,12 @@ function privateSwiftDistributionRoot() {
|
|
|
4600
4618
|
const root = process.env[SWIFT_PRIVATE_DISTRIBUTION_ENV]?.trim();
|
|
4601
4619
|
return root ? import_node_path4.default.resolve(root) : null;
|
|
4602
4620
|
}
|
|
4621
|
+
function privateSwiftCompilerRelease() {
|
|
4622
|
+
return process.env.PEACH_SWIFT_PRIVATE_COMPILER_RELEASE?.trim() || null;
|
|
4623
|
+
}
|
|
4603
4624
|
function privateSwiftRelease() {
|
|
4625
|
+
const compiler = privateSwiftCompilerRelease();
|
|
4626
|
+
if (compiler) return compiler;
|
|
4604
4627
|
const root = privateSwiftDistributionRoot();
|
|
4605
4628
|
if (!root) return null;
|
|
4606
4629
|
const manifest = JSON.parse(
|
|
@@ -6411,6 +6434,9 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
6411
6434
|
const designated = (id) => (children.get(id) ?? []).some(
|
|
6412
6435
|
(member) => member.kind.identifier === "swift.init" && !unavailable(member) && !/\bconvenience\b/.test(text(member))
|
|
6413
6436
|
);
|
|
6437
|
+
const superChain = function* (id) {
|
|
6438
|
+
for (let at = superId.get(id); at && byId.has(at); at = superId.get(at)) yield at;
|
|
6439
|
+
};
|
|
6414
6440
|
const hiddenInit = (id) => `${pathOf(byId.get(id))}.init(_peachInert:)`;
|
|
6415
6441
|
const classBuilds = /* @__PURE__ */ new Map();
|
|
6416
6442
|
const classBuild = (id) => {
|
|
@@ -6680,11 +6706,15 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
6680
6706
|
const flags = new Set(
|
|
6681
6707
|
modifiers[1].trim().split(/\s+/).filter(Boolean).map((flag) => flag.replace(/\(.*/, ""))
|
|
6682
6708
|
);
|
|
6683
|
-
const
|
|
6709
|
+
const requiredInit = context.inClass && !!options.requiredInits?.has(path49);
|
|
6710
|
+
const restatesRequired = context.inClass && path49.endsWith(".init()") && [...superChain(owner.get(member.identifier.precise) ?? "")].some(
|
|
6711
|
+
(at) => options.requiredInits?.has(`${pathOf(byId.get(at))}.init()`)
|
|
6712
|
+
);
|
|
6713
|
+
const required = context.inClass && (flags.has("required") || requiredInit || restatesRequired);
|
|
6684
6714
|
const final = context.inClass && flags.has("final") ? "final " : "";
|
|
6685
6715
|
const mutating = flags.has("mutating") ? "mutating " : flags.has("nonmutating") ? "nonmutating " : "";
|
|
6686
6716
|
let core = `${flags.has("convenience") ? "convenience " : ""}${modifiers[2]}`;
|
|
6687
|
-
const override = context.inClass && !options.plain?.has(path49) && (flags.has("override") || overrides.has(member.identifier.precise) || options.forcedOverride?.has(path49) || isObjC(member) && path49.endsWith(".init()")) ? "override " : "";
|
|
6717
|
+
const override = context.inClass && !options.plain?.has(path49) && !restatesRequired && (flags.has("override") || overrides.has(member.identifier.precise) || options.forcedOverride?.has(path49) || isObjC(member) && path49.endsWith(".init()")) ? "override " : "";
|
|
6688
6718
|
const head = `${indent2}${attrs}${access(member, context.openOwner)} ${required ? "required " : ""}${final}${override}${mutating}`;
|
|
6689
6719
|
const measured = behavior.get(path49);
|
|
6690
6720
|
if (measured) used.add(path49);
|
|
@@ -6893,7 +6923,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
6893
6923
|
member,
|
|
6894
6924
|
path: path49
|
|
6895
6925
|
});
|
|
6896
|
-
else emitWitness(member, inner, path49);
|
|
6926
|
+
else emitWitness(member, inner, path49, open && isObjC(member));
|
|
6897
6927
|
}
|
|
6898
6928
|
}
|
|
6899
6929
|
if (options.inert && designated2 && classBuild(id) === "hidden")
|
|
@@ -6903,6 +6933,12 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
6903
6933
|
emit(
|
|
6904
6934
|
`${inner}public required init?(coder: NSCoder) { ${options.inert ? "return nil" : trap(`${path49}.init(coder:)`)} }`
|
|
6905
6935
|
);
|
|
6936
|
+
if (designated2 && !members2.some((member) => leaf(member) === "init()") && [...superChain(id)].some(
|
|
6937
|
+
(at) => options.requiredInits?.has(`${pathOf(byId.get(at))}.init()`)
|
|
6938
|
+
))
|
|
6939
|
+
emit(
|
|
6940
|
+
`${inner}public required init() { ${options.inert ? superInit(id) : trap(`${path49}.init()`)} }`
|
|
6941
|
+
);
|
|
6906
6942
|
emit(`${indent2}}`);
|
|
6907
6943
|
return;
|
|
6908
6944
|
}
|
|
@@ -7071,7 +7107,8 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
7071
7107
|
}
|
|
7072
7108
|
}
|
|
7073
7109
|
);
|
|
7074
|
-
const emitWitness = (member, indent2, owner2) => {
|
|
7110
|
+
const emitWitness = (member, indent2, owner2, openObjC = false) => {
|
|
7111
|
+
const visibility = openObjC ? "open" : "public";
|
|
7075
7112
|
const { 2: rest } = LEADING_ATTRS.exec(text(member));
|
|
7076
7113
|
const decl = rest.replace(/^(?:weak |unowned )/, "").replace(/^((?:static )?)let /, "$1var ");
|
|
7077
7114
|
const witness = `${owner2}.${leaf(member)}`;
|
|
@@ -7079,10 +7116,12 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
7079
7116
|
if (member.kind.identifier === "swift.property" || member.kind.identifier === "swift.type.property") {
|
|
7080
7117
|
const parsed = splitAccessors(decl);
|
|
7081
7118
|
const setter = parsed.settable ? ` ${parsed.nonmutating ? "nonmutating " : ""}set { ${body} }` : "";
|
|
7082
|
-
emit(
|
|
7119
|
+
emit(
|
|
7120
|
+
`${indent2}${visibility} ${parsed.decl} { get${parsed.effects} { ${body} }${setter} }`
|
|
7121
|
+
);
|
|
7083
7122
|
} else
|
|
7084
7123
|
emit(
|
|
7085
|
-
`${indent2}
|
|
7124
|
+
`${indent2}${member.kind.identifier === "swift.init" ? "public required " : visibility + " "}${stripDefaults(decl)} { ${body} }`
|
|
7086
7125
|
);
|
|
7087
7126
|
};
|
|
7088
7127
|
const emitNoop = scoped((member, indent2) => {
|
|
@@ -7605,6 +7644,11 @@ function objcView(surface, toolchainBin, stdlib, cacheDir5, work, original, vend
|
|
|
7605
7644
|
`this peach's Swift has no iOS simulator standard library at ${stdlib}`
|
|
7606
7645
|
);
|
|
7607
7646
|
const sdk = original ? pinnedNativeSdk().sdkPath : materializeObjcSdk(cacheDir5);
|
|
7647
|
+
const moduleCache = import_node_path7.default.join(
|
|
7648
|
+
cacheDir5,
|
|
7649
|
+
"ios-module-cache",
|
|
7650
|
+
(0, import_node_crypto3.createHash)("sha256").update([toolchainBin, stdlib, sdk].map((dir) => import_node_fs7.default.realpathSync(dir)).join("\0")).digest("hex").slice(0, 16)
|
|
7651
|
+
);
|
|
7608
7652
|
const framework = import_node_path7.default.basename(import_node_path7.default.dirname(surface.modulemap)) === "Modules";
|
|
7609
7653
|
const frameworks = import_node_path7.default.join(work, "frameworks");
|
|
7610
7654
|
const include = import_node_path7.default.join(work, "include");
|
|
@@ -7657,6 +7701,10 @@ function objcView(surface, toolchainBin, stdlib, cacheDir5, work, original, vend
|
|
|
7657
7701
|
} else {
|
|
7658
7702
|
import_node_fs7.default.copyFileSync(surface.modulemap, import_node_path7.default.join(headersDir, "module.modulemap"));
|
|
7659
7703
|
}
|
|
7704
|
+
const stagedSurface = {
|
|
7705
|
+
...surface,
|
|
7706
|
+
modulemap: framework ? import_node_path7.default.join(frameworks, `${surface.module}.framework`, "Modules/module.modulemap") : import_node_path7.default.join(headersDir, "module.modulemap")
|
|
7707
|
+
};
|
|
7660
7708
|
const dependencyOriginals = /* @__PURE__ */ new Map();
|
|
7661
7709
|
for (const dependency of surface.dependencies ?? []) {
|
|
7662
7710
|
const dir = import_node_path7.default.join(include, dependency.module);
|
|
@@ -7824,7 +7872,7 @@ function objcView(surface, toolchainBin, stdlib, cacheDir5, work, original, vend
|
|
|
7824
7872
|
...original?.flags.flatMap((flag) => ["-Xcc", flag]) ?? [],
|
|
7825
7873
|
...(surface.moduleMapFlags ?? []).flatMap((flag) => ["-Xcc", flag]),
|
|
7826
7874
|
"-module-cache-path",
|
|
7827
|
-
|
|
7875
|
+
moduleCache,
|
|
7828
7876
|
"-minimum-access-level",
|
|
7829
7877
|
// symbol graphs hide public underscored names at the public threshold.
|
|
7830
7878
|
// original clang headers remain the declaration boundary, and a swift
|
|
@@ -7931,6 +7979,7 @@ function objcView(surface, toolchainBin, stdlib, cacheDir5, work, original, vend
|
|
|
7931
7979
|
})
|
|
7932
7980
|
};
|
|
7933
7981
|
});
|
|
7982
|
+
inheritedDefaultInits(stagedSurface, graphs, toolchainBin, search, moduleCache, work);
|
|
7934
7983
|
const inheritedConformances = /* @__PURE__ */ new Map();
|
|
7935
7984
|
if (surface.interface) {
|
|
7936
7985
|
const own = new Set(
|
|
@@ -7976,7 +8025,7 @@ function objcView(surface, toolchainBin, stdlib, cacheDir5, work, original, vend
|
|
|
7976
8025
|
...search,
|
|
7977
8026
|
...(surface.moduleMapFlags ?? []).flatMap((flag) => ["-Xcc", flag]),
|
|
7978
8027
|
"-module-cache-path",
|
|
7979
|
-
|
|
8028
|
+
moduleCache,
|
|
7980
8029
|
probe
|
|
7981
8030
|
],
|
|
7982
8031
|
{ encoding: "utf8", env: swiftEnvironment() }
|
|
@@ -8035,8 +8084,16 @@ function objcView(surface, toolchainBin, stdlib, cacheDir5, work, original, vend
|
|
|
8035
8084
|
graphs,
|
|
8036
8085
|
...surface.interface ? {
|
|
8037
8086
|
inheritedConformances,
|
|
8038
|
-
|
|
8087
|
+
requiredInits: requiredInits(
|
|
8039
8088
|
surface,
|
|
8089
|
+
graphs,
|
|
8090
|
+
toolchainBin,
|
|
8091
|
+
search,
|
|
8092
|
+
moduleCache,
|
|
8093
|
+
work
|
|
8094
|
+
),
|
|
8095
|
+
protocolProperties: protocolProperties(
|
|
8096
|
+
stagedSurface,
|
|
8040
8097
|
headersDir,
|
|
8041
8098
|
graphs,
|
|
8042
8099
|
toolchainBin,
|
|
@@ -8046,7 +8103,7 @@ function objcView(surface, toolchainBin, stdlib, cacheDir5, work, original, vend
|
|
|
8046
8103
|
} : {},
|
|
8047
8104
|
...original ? {
|
|
8048
8105
|
clangAST: objcDeclarationAST(
|
|
8049
|
-
|
|
8106
|
+
stagedSurface,
|
|
8050
8107
|
framework,
|
|
8051
8108
|
toolchainBin,
|
|
8052
8109
|
search,
|
|
@@ -8055,10 +8112,134 @@ function objcView(surface, toolchainBin, stdlib, cacheDir5, work, original, vend
|
|
|
8055
8112
|
original.target
|
|
8056
8113
|
)
|
|
8057
8114
|
} : {},
|
|
8058
|
-
values: enumValues(
|
|
8115
|
+
values: enumValues(
|
|
8116
|
+
graphs,
|
|
8117
|
+
stagedSurface,
|
|
8118
|
+
framework,
|
|
8119
|
+
toolchainBin,
|
|
8120
|
+
search,
|
|
8121
|
+
work,
|
|
8122
|
+
original
|
|
8123
|
+
),
|
|
8059
8124
|
imports: [...imports2].sort()
|
|
8060
8125
|
};
|
|
8061
8126
|
}
|
|
8127
|
+
function inheritedDefaultInits(surface, graphs, toolchainBin, search, moduleCache, work) {
|
|
8128
|
+
const symbols = graphs.flatMap((graph) => graph.symbols);
|
|
8129
|
+
const classes = symbols.filter(
|
|
8130
|
+
(symbol2) => /^c:objc\(cs\)\w+$/.test(symbol2.identifier.precise) && symbol2.pathComponents.length === 1 && !symbols.some(
|
|
8131
|
+
(member) => member.pathComponents.join(".") === `${symbol2.pathComponents[0]}.init()`
|
|
8132
|
+
) && symbols.some(
|
|
8133
|
+
(member) => member.pathComponents[0] === symbol2.pathComponents[0] && member.kind.identifier === "swift.init"
|
|
8134
|
+
)
|
|
8135
|
+
);
|
|
8136
|
+
if (classes.length === 0) return;
|
|
8137
|
+
const probe = import_node_path7.default.join(work, "inherited-default-inits.swift");
|
|
8138
|
+
import_node_fs7.default.writeFileSync(
|
|
8139
|
+
probe,
|
|
8140
|
+
[
|
|
8141
|
+
`import ${surface.module}`,
|
|
8142
|
+
...classes.map(
|
|
8143
|
+
(symbol2, index) => `@MainActor func peachInherited${index}() { _ = ${surface.module}.${symbol2.pathComponents[0]}() }`
|
|
8144
|
+
)
|
|
8145
|
+
].join("\n")
|
|
8146
|
+
);
|
|
8147
|
+
const run5 = (0, import_node_child_process6.spawnSync)(
|
|
8148
|
+
import_node_path7.default.join(toolchainBin, "swift-frontend"),
|
|
8149
|
+
[
|
|
8150
|
+
"-dump-ast",
|
|
8151
|
+
"-diagnostic-style",
|
|
8152
|
+
"llvm",
|
|
8153
|
+
"-no-color-diagnostics",
|
|
8154
|
+
"-target",
|
|
8155
|
+
IOS_SDK_TARGET,
|
|
8156
|
+
...search,
|
|
8157
|
+
...(surface.moduleMapFlags ?? []).flatMap((flag) => ["-Xcc", flag]),
|
|
8158
|
+
"-module-cache-path",
|
|
8159
|
+
moduleCache,
|
|
8160
|
+
probe
|
|
8161
|
+
],
|
|
8162
|
+
{ encoding: "utf8", env: swiftEnvironment(), maxBuffer: 64 * 1024 * 1024 }
|
|
8163
|
+
);
|
|
8164
|
+
if (run5.error) throw run5.error;
|
|
8165
|
+
const rejected = /* @__PURE__ */ new Set();
|
|
8166
|
+
for (const line of run5.stderr.split("\n")) {
|
|
8167
|
+
if (!line.includes("error:")) continue;
|
|
8168
|
+
const location = line.startsWith(`${probe}:`) ? /^:(\d+):\d+: error:/.exec(line.slice(probe.length)) : null;
|
|
8169
|
+
const index = location ? Number(location[1]) - 2 : -1;
|
|
8170
|
+
if (index < 0 || index >= classes.length)
|
|
8171
|
+
throw new Error(`inherited initializer probe does not typecheck: ${line}`);
|
|
8172
|
+
rejected.add(index);
|
|
8173
|
+
}
|
|
8174
|
+
if (run5.status !== 0 && rejected.size === 0)
|
|
8175
|
+
throw new Error(
|
|
8176
|
+
`inherited initializer probe failed: ${run5.stderr || run5.signal || run5.status}`
|
|
8177
|
+
);
|
|
8178
|
+
const references = run5.stdout.split("\n").filter((line) => line.includes("declref_expr"));
|
|
8179
|
+
for (const [index, symbol2] of classes.entries()) {
|
|
8180
|
+
if (rejected.has(index)) continue;
|
|
8181
|
+
if (!references.some(
|
|
8182
|
+
(line) => line.includes(`location=${probe}:${index + 2}:`) && line.includes(`.${symbol2.pathComponents[0]}.init()@`)
|
|
8183
|
+
))
|
|
8184
|
+
continue;
|
|
8185
|
+
const id = `${symbol2.identifier.precise}(im)init`;
|
|
8186
|
+
graphs[0].symbols.push({
|
|
8187
|
+
kind: { identifier: "swift.init" },
|
|
8188
|
+
identifier: { precise: id },
|
|
8189
|
+
pathComponents: [...symbol2.pathComponents, "init()"],
|
|
8190
|
+
declarationFragments: [{ kind: "keyword", spelling: "override init()" }],
|
|
8191
|
+
accessLevel: "public"
|
|
8192
|
+
});
|
|
8193
|
+
graphs[0].relationships.push({
|
|
8194
|
+
kind: "memberOf",
|
|
8195
|
+
source: id,
|
|
8196
|
+
target: symbol2.identifier.precise
|
|
8197
|
+
});
|
|
8198
|
+
}
|
|
8199
|
+
}
|
|
8200
|
+
function requiredInits(surface, graphs, toolchainBin, search, moduleCache, work) {
|
|
8201
|
+
const classes = graphs.flatMap((graph) => graph.symbols).filter(
|
|
8202
|
+
(symbol2) => /^c:objc\(cs\)\w+$/.test(symbol2.identifier.precise) && symbol2.pathComponents.length === 1 && graphs.some(
|
|
8203
|
+
(graph) => graph.symbols.some(
|
|
8204
|
+
(member) => member.pathComponents.join(".") === `${symbol2.pathComponents[0]}.init()`
|
|
8205
|
+
)
|
|
8206
|
+
)
|
|
8207
|
+
).map((symbol2) => symbol2.pathComponents[0]);
|
|
8208
|
+
const found = /* @__PURE__ */ new Set();
|
|
8209
|
+
if (classes.length === 0) return found;
|
|
8210
|
+
const probe = import_node_path7.default.join(work, "required-inits.swift");
|
|
8211
|
+
import_node_fs7.default.writeFileSync(
|
|
8212
|
+
probe,
|
|
8213
|
+
[
|
|
8214
|
+
`import ${surface.module}`,
|
|
8215
|
+
...classes.map(
|
|
8216
|
+
(name3, index) => `class PeachRequired${index}: ${surface.module}.${name3} { init(peach: Int) { fatalError() } }`
|
|
8217
|
+
)
|
|
8218
|
+
].join("\n")
|
|
8219
|
+
);
|
|
8220
|
+
const run5 = (0, import_node_child_process6.spawnSync)(
|
|
8221
|
+
import_node_path7.default.join(toolchainBin, "swift-frontend"),
|
|
8222
|
+
[
|
|
8223
|
+
"-typecheck",
|
|
8224
|
+
"-target",
|
|
8225
|
+
IOS_SDK_TARGET,
|
|
8226
|
+
...search,
|
|
8227
|
+
...(surface.moduleMapFlags ?? []).flatMap((flag) => ["-Xcc", flag]),
|
|
8228
|
+
"-module-cache-path",
|
|
8229
|
+
moduleCache,
|
|
8230
|
+
probe
|
|
8231
|
+
],
|
|
8232
|
+
{ encoding: "utf8", env: swiftEnvironment(), maxBuffer: 64 * 1024 * 1024 }
|
|
8233
|
+
);
|
|
8234
|
+
if (run5.error) throw run5.error;
|
|
8235
|
+
const unknown2 = /error: (?:no such module|cannot find type) .*/.exec(run5.stderr);
|
|
8236
|
+
if (unknown2) throw new Error(`required init probe does not typecheck: ${unknown2[0]}`);
|
|
8237
|
+
for (const match of run5.stderr.matchAll(
|
|
8238
|
+
/error: 'required' initializer 'init\(\)' must be provided by subclass of '(?:\w+\.)?(\w+)'/g
|
|
8239
|
+
))
|
|
8240
|
+
found.add(`${match[1]}.init()`);
|
|
8241
|
+
return found;
|
|
8242
|
+
}
|
|
8062
8243
|
function clangSearchFlags(search) {
|
|
8063
8244
|
const flags = [];
|
|
8064
8245
|
for (let index = 0; index < search.length; index += 2) {
|
|
@@ -8557,7 +8738,7 @@ function swiftSharedSdkViewOptions(moduleRoot, distribution, toolchainBin, sdk)
|
|
|
8557
8738
|
const overlay = import_node_path8.default.join(swiftSharedSdkRoot(moduleRoot, distribution), "wasm/include");
|
|
8558
8739
|
const overlayFiles = (0, import_node_fs8.readdirSync)(overlay, { recursive: true, withFileTypes: true }).filter((entry) => entry.isFile()).map((entry) => import_node_path8.default.join(entry.parentPath, entry.name)).sort();
|
|
8559
8740
|
const key2 = JSON.stringify([
|
|
8560
|
-
"
|
|
8741
|
+
"v22",
|
|
8561
8742
|
toolchainBin,
|
|
8562
8743
|
sdk,
|
|
8563
8744
|
frameworks,
|
|
@@ -8613,6 +8794,7 @@ function swiftSharedSdkViewOptions(moduleRoot, distribution, toolchainBin, sdk)
|
|
|
8613
8794
|
[import_node_path8.default.join(sysroot, "darwin/System/Library/Frameworks"), frameworks],
|
|
8614
8795
|
...[
|
|
8615
8796
|
"MacTypes.h",
|
|
8797
|
+
"objc/NSObject.h",
|
|
8616
8798
|
"net/if.h",
|
|
8617
8799
|
"notify.h",
|
|
8618
8800
|
"notify.modulemap",
|
|
@@ -11566,13 +11748,18 @@ function createGuestImageLedger(input) {
|
|
|
11566
11748
|
exported.set(definition2.alias, definition2);
|
|
11567
11749
|
}
|
|
11568
11750
|
const names = [...new Set([...exported.values()].map((definition2) => definition2.name))];
|
|
11569
|
-
const
|
|
11570
|
-
|
|
11571
|
-
names.
|
|
11751
|
+
const nameOffsets = /* @__PURE__ */ new Map();
|
|
11752
|
+
let nameSize = 0;
|
|
11753
|
+
const nameContents = names.map((name3) => {
|
|
11572
11754
|
const bytes = Buffer.concat([Buffer.from(name3), Buffer.from([0])]);
|
|
11573
|
-
|
|
11574
|
-
|
|
11575
|
-
|
|
11755
|
+
nameOffsets.set(name3, nameSize);
|
|
11756
|
+
nameSize += bytes.length;
|
|
11757
|
+
return [...bytes].map((byte) => `\\${byte.toString(16).padStart(2, "0")}`).join("");
|
|
11758
|
+
}).join("");
|
|
11759
|
+
const ir = [
|
|
11760
|
+
'target triple = "wasm32-unknown-wasip1"',
|
|
11761
|
+
`@.names = private constant [${nameSize} x i8] c"${nameContents}"`
|
|
11762
|
+
];
|
|
11576
11763
|
for (const definition2 of exported.values()) {
|
|
11577
11764
|
if (definition2.kind === "function")
|
|
11578
11765
|
ir.push(
|
|
@@ -11583,7 +11770,7 @@ function createGuestImageLedger(input) {
|
|
|
11583
11770
|
ir.push(`@__peach_dyld_symbols = constant [${exported.size} x { ptr, i32, ptr }] [`);
|
|
11584
11771
|
ir.push(
|
|
11585
11772
|
[...exported.values()].map(
|
|
11586
|
-
(definition2) => ` { ptr, i32, ptr } { ptr @.
|
|
11773
|
+
(definition2) => ` { ptr, i32, ptr } { ptr getelementptr (i8, ptr @.names, i32 ${nameOffsets.get(definition2.name)}), i32 ${definition2.image}, ptr @${definition2.alias} }`
|
|
11587
11774
|
).join(",\n")
|
|
11588
11775
|
);
|
|
11589
11776
|
ir.push("]", `@__peach_dyld_symbol_count = constant i32 ${exported.size}`);
|
|
@@ -12416,7 +12603,7 @@ function guestSourceImages(graph) {
|
|
|
12416
12603
|
const type = dependency.productType;
|
|
12417
12604
|
let dynamic;
|
|
12418
12605
|
if (type.startsWith("swiftpm.target.")) {
|
|
12419
|
-
if (type !== "swiftpm.target.regular" && type !== "swiftpm.target.binary")
|
|
12606
|
+
if (type !== "swiftpm.target.regular" && type !== "swiftpm.target.binary" && type !== "swiftpm.target.system")
|
|
12420
12607
|
throw new Error(`unsupported SwiftPM target ${edge.target}`);
|
|
12421
12608
|
dynamic = false;
|
|
12422
12609
|
} else if (type.startsWith("swiftpm.library.")) {
|
|
@@ -14339,10 +14526,11 @@ function sourceGuestRuntimeLinks(options) {
|
|
|
14339
14526
|
const links = [];
|
|
14340
14527
|
const requests = [];
|
|
14341
14528
|
const optionGroups = [
|
|
14342
|
-
{ object: null, flags:
|
|
14343
|
-
|
|
14529
|
+
{ object: null, flags: image.linkerFlags, autoLinked: false },
|
|
14530
|
+
{ object: null, flags: autolink, autoLinked: true },
|
|
14531
|
+
...image.clangLinkOptions.map((options2) => ({ ...options2, autoLinked: true }))
|
|
14344
14532
|
];
|
|
14345
|
-
for (const { object: object4, flags } of optionGroups) {
|
|
14533
|
+
for (const { object: object4, flags, autoLinked } of optionGroups) {
|
|
14346
14534
|
for (let index = 0; index < flags.length; index++) {
|
|
14347
14535
|
const flag = flags[index];
|
|
14348
14536
|
const artifact = artifacts.get(flag);
|
|
@@ -14359,6 +14547,7 @@ function sourceGuestRuntimeLinks(options) {
|
|
|
14359
14547
|
if (flag === "-framework") {
|
|
14360
14548
|
const name4 = flags[++index];
|
|
14361
14549
|
const provider = name4 && frameworkAliases.get(name4);
|
|
14550
|
+
if (!provider && name4 && autoLinked) continue;
|
|
14362
14551
|
if (!provider)
|
|
14363
14552
|
throw new Error(
|
|
14364
14553
|
`source image ${image.id} has unresolved framework linkage ${name4}`
|
|
@@ -15991,13 +16180,14 @@ async function runCompiler(command, args, options, stream = false, quiet) {
|
|
|
15991
16180
|
var WASM_TRIPLE = "wasm32-unknown-wasip1";
|
|
15992
16181
|
var SWIFTPM_PROGRESS = /^\[\d+\/\d+\] /;
|
|
15993
16182
|
var SWIFTPM_NOISE = /^(?:\[\d+\/\d+\] |Building for production\.\.\.$|warning: '--build-system native' has been deprecated)/;
|
|
15994
|
-
|
|
15995
|
-
|
|
15996
|
-
|
|
15997
|
-
|
|
15998
|
-
|
|
15999
|
-
)
|
|
16000
|
-
|
|
16183
|
+
function swiftBuildJobs() {
|
|
16184
|
+
const admittedCores = windowAdmission()?.cores ?? Number(process.env.TM_EXEC_CPU_CORES);
|
|
16185
|
+
return Math.min(
|
|
16186
|
+
4,
|
|
16187
|
+
Math.max(1, Math.floor(import_node_os10.default.availableParallelism() / 2)),
|
|
16188
|
+
Number.isInteger(admittedCores) && admittedCores > 0 ? admittedCores : 4
|
|
16189
|
+
);
|
|
16190
|
+
}
|
|
16001
16191
|
var SWIFT_BUILDER_TRANSPORT_MARGIN_MS = 3e5;
|
|
16002
16192
|
var SWIFT_BUILDER_DEFAULT_COMPILE_MS = 18e5;
|
|
16003
16193
|
function swiftBuilderHopTimeoutMs(compileTimeoutMs) {
|
|
@@ -16781,9 +16971,9 @@ var executableLinkFlags = (root) => ` "-Xclang-linker", "-O0",
|
|
|
16781
16971
|
`;
|
|
16782
16972
|
var darwinRecordsRegion = (quoted) => quoted.length ? ["-Wl,--start-lib", ...quoted, "-Wl,--end-lib"] : [];
|
|
16783
16973
|
var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
16784
|
-
var MULTI_MANIFEST_VERSION =
|
|
16974
|
+
var MULTI_MANIFEST_VERSION = 68;
|
|
16785
16975
|
var SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
|
|
16786
|
-
var compilerSourceDigest = true ? "
|
|
16976
|
+
var compilerSourceDigest = true ? "0be1de6e499585bfdd605805a7b9dbaa1f1e8d69f2a1a65d693d7952343a2edb" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
|
|
16787
16977
|
function swiftArtifactHash(input, release, moduleRoot) {
|
|
16788
16978
|
const hash = (0, import_node_crypto13.createHash)("sha256");
|
|
16789
16979
|
hash.update(`swift-compile
|
|
@@ -16925,7 +17115,23 @@ function emitSwiftPackageManifest(args) {
|
|
|
16925
17115
|
const distributionLink = args.distributionLink;
|
|
16926
17116
|
if (distribution && distributionLink) {
|
|
16927
17117
|
const isProvider = (object4) => object4.startsWith(`lib/${DARWIN_RECORDS_PREFIX}`);
|
|
16928
|
-
const
|
|
17118
|
+
const sourceModules = new Set(
|
|
17119
|
+
targets.filter(
|
|
17120
|
+
(target) => args.sourceSwiftTargets?.has(target.name) && !args.native?.get(target.name)?.clang
|
|
17121
|
+
).map((target) => swiftTargetModuleName(target.name))
|
|
17122
|
+
);
|
|
17123
|
+
const product = v5.parse(
|
|
17124
|
+
swiftFrameworkProductSchema,
|
|
17125
|
+
JSON.parse(
|
|
17126
|
+
(0, import_node_fs27.readFileSync)(import_node_path27.default.join(moduleRoot, SWIFT_FRAMEWORK_PRODUCT_FILE), "utf8")
|
|
17127
|
+
)
|
|
17128
|
+
);
|
|
17129
|
+
const replacedObjects = new Set(
|
|
17130
|
+
product.objects.filter((object4) => sourceModules.has(swiftTargetModuleName(object4.target))).map((object4) => object4.path)
|
|
17131
|
+
);
|
|
17132
|
+
const available = distribution.objects.filter(
|
|
17133
|
+
(object4) => !isProvider(object4) && !replacedObjects.has(object4)
|
|
17134
|
+
);
|
|
16929
17135
|
const objects = available.filter(
|
|
16930
17136
|
(object4) => !targets.some((target) => object4.startsWith(`lib/${target.name}-`)) && [...OPTIONAL_FRAMEWORKS, "SpriteKit", "PeachBox2D"].every(
|
|
16931
17137
|
(name3) => !object4.startsWith(`lib/${name3}-`) || reachedFrameworks.has(name3)
|
|
@@ -17240,14 +17446,6 @@ function syncSwiftTree(base, files2) {
|
|
|
17240
17446
|
var DIRECTIVE = /^[ \t]*#(?:if|elseif)\b/;
|
|
17241
17447
|
var OS_IOS = /\b(?:os\(\s*iOS\s*\)|targetEnvironment\(\s*simulator\s*\))/g;
|
|
17242
17448
|
var DELEGATE_CLASS = /^class\s+[A-Za-z_]\w*\s*(?:<[^>{]*>)?\s*:[^{]*\b(?:UIApplicationDelegate|UISceneDelegate|UIWindowSceneDelegate)\b[^{]*\{/;
|
|
17243
|
-
var REUSABLE_INIT = /^override(?=\s+(?:(?:public|open|internal)\s+)?init\s*\(\s*(?:style\s*:[^,)]*,\s*reuseIdentifier|reuseIdentifier)\s*:)/;
|
|
17244
|
-
var REUSABLE_VIEW_BASES = [
|
|
17245
|
-
"UICollectionReusableView",
|
|
17246
|
-
"UICollectionViewCell",
|
|
17247
|
-
"UICollectionViewListCell"
|
|
17248
|
-
];
|
|
17249
|
-
var CLASS_BASE = /^class\s+([A-Za-z_]\w*)\s*(?:<[^>{]*>)?\s*:\s*([A-Za-z_][\w.]*)[^{]*\{/;
|
|
17250
|
-
var FRAME_INIT = /^override(?=\s+(?:(?:public|open|internal)\s+)?init\s*\(\s*frame\s*:)/;
|
|
17251
17449
|
function compiledSwiftSources(files2, targets, overlayFrameworks) {
|
|
17252
17450
|
const ordered = [...targets].sort((a, b) => b.path.length - a.path.length);
|
|
17253
17451
|
return new Map(
|
|
@@ -18027,7 +18225,7 @@ var CORE_FOUNDATION_HANDLE_IMPORTS = [
|
|
|
18027
18225
|
"import CoreGraphics"
|
|
18028
18226
|
]).join("; ");
|
|
18029
18227
|
function foundationOwnerOf(name3) {
|
|
18030
|
-
if (name3 === "
|
|
18228
|
+
if (name3 === "NSKeyValueObservedChange" || name3 === "NSKeyValueObservation")
|
|
18031
18229
|
return "PeachObjC";
|
|
18032
18230
|
if (name3 === "DispatchData") return "Dispatch";
|
|
18033
18231
|
if (FOUNDATION_NETWORKING_TYPES.has(name3)) return "FoundationNetworking";
|
|
@@ -18047,10 +18245,6 @@ function swiftSourceAsIOS(source, overlayFrameworks, swiftPackage) {
|
|
|
18047
18245
|
}).join("\n");
|
|
18048
18246
|
let out = "";
|
|
18049
18247
|
let copied = 0;
|
|
18050
|
-
const reusableViews = new Set(REUSABLE_VIEW_BASES);
|
|
18051
|
-
const reusableBodies = [];
|
|
18052
|
-
let depth = 0;
|
|
18053
|
-
let opensReusableBody = false;
|
|
18054
18248
|
const sceneLifecycleBodies = /* @__PURE__ */ new Set();
|
|
18055
18249
|
for (const at of tokens2) {
|
|
18056
18250
|
const rest = conditioned.slice(at, at + 400);
|
|
@@ -18059,21 +18253,6 @@ function swiftSourceAsIOS(source, overlayFrameworks, swiftPackage) {
|
|
|
18059
18253
|
out += conditioned.slice(copied, at + 1) + " public var _peachUsesSceneLifecycle: Bool { true };";
|
|
18060
18254
|
copied = at + 1;
|
|
18061
18255
|
}
|
|
18062
|
-
depth++;
|
|
18063
|
-
if (opensReusableBody) reusableBodies.push(depth);
|
|
18064
|
-
opensReusableBody = false;
|
|
18065
|
-
continue;
|
|
18066
|
-
}
|
|
18067
|
-
if (rest.startsWith("}")) {
|
|
18068
|
-
if (reusableBodies.at(-1) === depth) reusableBodies.pop();
|
|
18069
|
-
depth--;
|
|
18070
|
-
continue;
|
|
18071
|
-
}
|
|
18072
|
-
if (rest.startsWith("override")) {
|
|
18073
|
-
if (REUSABLE_INIT.test(rest) || reusableBodies.at(-1) === depth && FRAME_INIT.test(rest)) {
|
|
18074
|
-
out += `${conditioned.slice(copied, at)}required`;
|
|
18075
|
-
copied = at + "override".length;
|
|
18076
|
-
}
|
|
18077
18256
|
continue;
|
|
18078
18257
|
}
|
|
18079
18258
|
const imported = conditioned[at - 1] === "." ? null : /^import[ \t]+([A-Za-z_]\w*)(?:[ \t]*\.[ \t]*[A-Za-z_]\w*)+/.exec(rest);
|
|
@@ -18118,11 +18297,6 @@ function swiftSourceAsIOS(source, overlayFrameworks, swiftPackage) {
|
|
|
18118
18297
|
continue;
|
|
18119
18298
|
}
|
|
18120
18299
|
if (rest.startsWith("class")) {
|
|
18121
|
-
const declared = CLASS_BASE.exec(rest);
|
|
18122
|
-
if (declared && reusableViews.has(declared[2].split(".").pop())) {
|
|
18123
|
-
reusableViews.add(declared[1]);
|
|
18124
|
-
opensReusableBody = true;
|
|
18125
|
-
}
|
|
18126
18300
|
const modifiers = conditioned.slice(conditioned.lastIndexOf("\n", at - 1) + 1, at);
|
|
18127
18301
|
const delegateClass = DELEGATE_CLASS.exec(rest);
|
|
18128
18302
|
if (delegateClass && /\bUIApplicationDelegate\b/.test(delegateClass[0])) {
|
|
@@ -18619,7 +18793,7 @@ function swiftCodeScan(source) {
|
|
|
18619
18793
|
else top.parens--;
|
|
18620
18794
|
i++;
|
|
18621
18795
|
} else {
|
|
18622
|
-
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("
|
|
18796
|
+
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;
|
|
18623
18797
|
if (keyword && !/[\w$]/.test(source[i - 1] ?? "") && !/[\w$]/.test(source[i + keyword.length] ?? "")) {
|
|
18624
18798
|
tokens2.push(i);
|
|
18625
18799
|
i += keyword.length;
|
|
@@ -19526,6 +19700,7 @@ module ${moduleName}.Swift {
|
|
|
19526
19700
|
return projectOverlayFrameworks;
|
|
19527
19701
|
}
|
|
19528
19702
|
);
|
|
19703
|
+
const libraryEntryFiles = /* @__PURE__ */ new Map();
|
|
19529
19704
|
for (const target of [...targets]) {
|
|
19530
19705
|
if (!target.executable || ![...native.values()].some((value) => value.late?.producers.includes(target.name)))
|
|
19531
19706
|
continue;
|
|
@@ -19581,7 +19756,18 @@ module ${moduleName}.Swift {
|
|
|
19581
19756
|
`mixed executable ${target.name} requires one typed Swift application entry`
|
|
19582
19757
|
);
|
|
19583
19758
|
}
|
|
19584
|
-
if (!nativeEntry)
|
|
19759
|
+
if (!nativeEntry) {
|
|
19760
|
+
compiled.set(entryFile, entrySource);
|
|
19761
|
+
if (import_node_path27.default.basename(entryFile) === "main.swift") {
|
|
19762
|
+
const libraryEntry = import_node_path27.default.posix.join(
|
|
19763
|
+
import_node_path27.default.posix.dirname(entryFile),
|
|
19764
|
+
"PeachApplicationEntry.generated.swift"
|
|
19765
|
+
);
|
|
19766
|
+
if (Object.hasOwn(input.files, libraryEntry))
|
|
19767
|
+
throw new Error(`mixed application entry conflicts with ${libraryEntry}`);
|
|
19768
|
+
libraryEntryFiles.set(entryFile, libraryEntry);
|
|
19769
|
+
}
|
|
19770
|
+
}
|
|
19585
19771
|
const name3 = `${target.name}Executable`;
|
|
19586
19772
|
if (targets.some((candidate) => candidate.name === name3))
|
|
19587
19773
|
throw new Error(`mixed application executable target conflicts with ${name3}`);
|
|
@@ -19729,7 +19915,7 @@ module ${moduleName}.Swift {
|
|
|
19729
19915
|
}
|
|
19730
19916
|
for (const [file, contents] of Object.entries(input.files)) {
|
|
19731
19917
|
if (file === "Package.swift") continue;
|
|
19732
|
-
const destination = import_node_path27.default.join(base, file);
|
|
19918
|
+
const destination = import_node_path27.default.join(base, libraryEntryFiles.get(file) ?? file);
|
|
19733
19919
|
const interfaceModule = /(?:^|\/)(\w+)-Swift\.h$/.exec(file)?.[1];
|
|
19734
19920
|
const localInterface = interfaceModule && swiftTargets.has(interfaceModule) ? `#include ${JSON.stringify(
|
|
19735
19921
|
import_node_path27.default.relative(
|
|
@@ -19788,9 +19974,16 @@ module ${moduleName}.Swift {
|
|
|
19788
19974
|
emitSwiftPackageManifest({
|
|
19789
19975
|
root: layout2.root,
|
|
19790
19976
|
files: files2,
|
|
19791
|
-
targets: manifestTargets
|
|
19977
|
+
targets: manifestTargets.map((target) => ({
|
|
19978
|
+
...target,
|
|
19979
|
+
sources: target.sources?.map((source) => {
|
|
19980
|
+
const entry = libraryEntryFiles.get(import_node_path27.default.posix.join(target.path, source));
|
|
19981
|
+
return entry ? import_node_path27.default.posix.relative(target.path, entry) : source;
|
|
19982
|
+
})
|
|
19983
|
+
})),
|
|
19792
19984
|
packages,
|
|
19793
19985
|
native,
|
|
19986
|
+
sourceSwiftTargets: swiftTargets,
|
|
19794
19987
|
nativeFlags,
|
|
19795
19988
|
nativeImportFlags,
|
|
19796
19989
|
nativeHeaderFlags,
|
|
@@ -20366,7 +20559,7 @@ async function buildFrameworkProducts(scratch2, args) {
|
|
|
20366
20559
|
"--build-system",
|
|
20367
20560
|
"native",
|
|
20368
20561
|
"-j",
|
|
20369
|
-
|
|
20562
|
+
String(swiftBuildJobs()),
|
|
20370
20563
|
"--package-path",
|
|
20371
20564
|
linkRoot,
|
|
20372
20565
|
"--scratch-path",
|
|
@@ -20384,7 +20577,7 @@ async function buildFrameworkProducts(scratch2, args) {
|
|
|
20384
20577
|
"-Xswiftc",
|
|
20385
20578
|
"-num-threads",
|
|
20386
20579
|
"-Xswiftc",
|
|
20387
|
-
|
|
20580
|
+
String(swiftBuildJobs()),
|
|
20388
20581
|
...swiftReproducibleBuildFlags([
|
|
20389
20582
|
[import_node_path27.default.dirname(args.toolchainBin), "toolchain"],
|
|
20390
20583
|
[args.moduleRoot, "framework"],
|
|
@@ -20863,7 +21056,7 @@ function compileSwiftProjectOnce(input, options) {
|
|
|
20863
21056
|
"--build-system",
|
|
20864
21057
|
"native",
|
|
20865
21058
|
"-j",
|
|
20866
|
-
|
|
21059
|
+
String(swiftBuildJobs()),
|
|
20867
21060
|
"--package-path",
|
|
20868
21061
|
root,
|
|
20869
21062
|
...swiftCompileSdkOptions(frameworkRoot, options.toolchainBin),
|
|
@@ -20876,7 +21069,7 @@ function compileSwiftProjectOnce(input, options) {
|
|
|
20876
21069
|
"-Xswiftc",
|
|
20877
21070
|
"-num-threads",
|
|
20878
21071
|
"-Xswiftc",
|
|
20879
|
-
|
|
21072
|
+
String(swiftBuildJobs()),
|
|
20880
21073
|
...swiftReproducibleBuildFlags([
|
|
20881
21074
|
[import_node_path27.default.dirname(options.toolchainBin), "toolchain"],
|
|
20882
21075
|
[frameworkRoot, "framework"],
|
|
@@ -22564,7 +22757,7 @@ function parseOpenStepPlist(text5) {
|
|
|
22564
22757
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
22565
22758
|
var NEVER_MEMBER = /(?:^|\/)(?:Info\.plist|[^/]+\.entitlements|[^/]+\.xcconfig|\.DS_Store)$/;
|
|
22566
22759
|
var BUNDLE_DIR = /\.(xcassets|bundle|lproj|xcdatamodeld|scnassets|spriteatlas|rcproject|storyboardc|icon)$/;
|
|
22567
|
-
function xcodePathResolver(objects, projectDir, join9) {
|
|
22760
|
+
function xcodePathResolver(objects, projectDir, join9, sourceTreeRoot) {
|
|
22568
22761
|
const parents = /* @__PURE__ */ new Map();
|
|
22569
22762
|
for (const [id, entry] of Object.entries(objects)) {
|
|
22570
22763
|
if (!isDict(entry)) continue;
|
|
@@ -22587,6 +22780,9 @@ function xcodePathResolver(objects, projectDir, join9) {
|
|
|
22587
22780
|
const parent = parents.get(id);
|
|
22588
22781
|
const base = parent ? resolve2(parent) : projectDir;
|
|
22589
22782
|
if (base !== null) result = join9(base, own);
|
|
22783
|
+
} else {
|
|
22784
|
+
const base = sourceTreeRoot?.(tree2);
|
|
22785
|
+
if (base) result = join9(base, own);
|
|
22590
22786
|
}
|
|
22591
22787
|
}
|
|
22592
22788
|
paths.set(id, result);
|
|
@@ -27546,7 +27742,7 @@ ${output2}`
|
|
|
27546
27742
|
}
|
|
27547
27743
|
project.visitMembers(
|
|
27548
27744
|
targetId,
|
|
27549
|
-
project.
|
|
27745
|
+
xcodePathResolver(project.objects, project.projectDir, import_node_path38.default.join, settings),
|
|
27550
27746
|
(file) => isDirectory(file) ? walkFiles(file) : import_node_fs37.default.existsSync(file) ? [file] : [],
|
|
27551
27747
|
import_node_path38.default.join,
|
|
27552
27748
|
(file, kind) => {
|
|
@@ -27569,6 +27765,51 @@ ${output2}`
|
|
|
27569
27765
|
if (file.endsWith(".swift")) sources.add(file);
|
|
27570
27766
|
}
|
|
27571
27767
|
);
|
|
27768
|
+
if (options.prepareGeneratedSources && options.requireSources !== false) {
|
|
27769
|
+
const definitions = [...allSources].filter(
|
|
27770
|
+
(file) => file.endsWith(".intentdefinition")
|
|
27771
|
+
);
|
|
27772
|
+
for (const definition2 of definitions) {
|
|
27773
|
+
const configuredLanguage = settings("INTENTS_CODEGEN_LANGUAGE");
|
|
27774
|
+
const language = !configuredLanguage || configuredLanguage === "Automatic" ? sources.size > 0 ? "Swift" : "Objective-C" : configuredLanguage;
|
|
27775
|
+
const output2 = import_node_path38.default.join(
|
|
27776
|
+
settings("DERIVED_FILE_DIR"),
|
|
27777
|
+
"IntentDefinitionGenerated",
|
|
27778
|
+
import_node_path38.default.basename(definition2, ".intentdefinition")
|
|
27779
|
+
);
|
|
27780
|
+
import_node_fs37.default.rmSync(output2, { recursive: true, force: true });
|
|
27781
|
+
import_node_fs37.default.mkdirSync(output2, { recursive: true });
|
|
27782
|
+
const args = [
|
|
27783
|
+
"intentbuilderc",
|
|
27784
|
+
"generate",
|
|
27785
|
+
"-input",
|
|
27786
|
+
definition2,
|
|
27787
|
+
"-output",
|
|
27788
|
+
output2,
|
|
27789
|
+
"-classPrefix",
|
|
27790
|
+
settings("PROJECT_CLASS_PREFIX"),
|
|
27791
|
+
"-language",
|
|
27792
|
+
language,
|
|
27793
|
+
"-visibility",
|
|
27794
|
+
"public"
|
|
27795
|
+
];
|
|
27796
|
+
if (language === "Swift")
|
|
27797
|
+
args.push("-swiftVersion", settings("SWIFT_VERSION") || "5.0");
|
|
27798
|
+
if (settings("DEFINES_MODULE") === "YES")
|
|
27799
|
+
args.push("-moduleName", settings("PRODUCT_MODULE_NAME"));
|
|
27800
|
+
(0, import_node_child_process22.execFileSync)("xcrun", args, {
|
|
27801
|
+
cwd: project.projectDir,
|
|
27802
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
27803
|
+
timeout: runScriptTimeoutMs
|
|
27804
|
+
});
|
|
27805
|
+
projectInputs.add(definition2);
|
|
27806
|
+
for (const file of walkFiles(output2)) {
|
|
27807
|
+
allSources.add(file);
|
|
27808
|
+
if (file.endsWith(".swift")) sources.add(file);
|
|
27809
|
+
if (HEADER_FILE.test(file)) headers.add(file);
|
|
27810
|
+
}
|
|
27811
|
+
}
|
|
27812
|
+
}
|
|
27572
27813
|
return {
|
|
27573
27814
|
sources: [...sources].sort(),
|
|
27574
27815
|
resources: [...resources].sort(),
|
|
@@ -27905,6 +28146,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
27905
28146
|
TARGETNAME: "$(TARGET_NAME)",
|
|
27906
28147
|
PROJECT: "$(PROJECT_NAME)",
|
|
27907
28148
|
PROJECT_NAME: import_node_path38.default.basename(ref.project.xcodeproj, ".xcodeproj"),
|
|
28149
|
+
PROJECT_CLASS_PREFIX: isDict(ref.project.project.attributes) ? str(ref.project.project.attributes.CLASSPREFIX) ?? "" : "",
|
|
27908
28150
|
PROJECT_FILE_PATH: ref.project.xcodeproj,
|
|
27909
28151
|
SRCROOT: ref.project.projectDir,
|
|
27910
28152
|
SOURCE_ROOT: ref.project.projectDir,
|
|
@@ -29218,7 +29460,8 @@ async function resolveSwiftPackagesAsync(options) {
|
|
|
29218
29460
|
}
|
|
29219
29461
|
function resolveSwiftPackages(options) {
|
|
29220
29462
|
const { rootDir, resolved, products, localDirs } = options;
|
|
29221
|
-
const
|
|
29463
|
+
const providedTargets = new Set(options.provided ?? []);
|
|
29464
|
+
const providedProducts = new Set(options.provided ?? []);
|
|
29222
29465
|
const result = {
|
|
29223
29466
|
sourceLinks: { targets: [], owners: [] },
|
|
29224
29467
|
targets: [],
|
|
@@ -29308,7 +29551,7 @@ function resolveSwiftPackages(options) {
|
|
|
29308
29551
|
if (targetOutcomes.has(key2)) return targetOutcomes.get(key2);
|
|
29309
29552
|
targetOutcomes.set(key2, []);
|
|
29310
29553
|
const outcome = (() => {
|
|
29311
|
-
if (
|
|
29554
|
+
if (providedTargets.has(name3)) return [];
|
|
29312
29555
|
const target = pkg.manifest.targets.get(name3);
|
|
29313
29556
|
if (!target)
|
|
29314
29557
|
return [`${import_node_path40.default.basename(pkg.manifest.dir)} declares no target ${name3}`];
|
|
@@ -29356,14 +29599,14 @@ function resolveSwiftPackages(options) {
|
|
|
29356
29599
|
};
|
|
29357
29600
|
const productOutcomes = /* @__PURE__ */ new Map();
|
|
29358
29601
|
const resolveProduct = (pkg, product) => {
|
|
29359
|
-
if (
|
|
29602
|
+
if (providedProducts.has(product)) return [];
|
|
29360
29603
|
const roots = pkg.manifest.products.get(product)?.targets;
|
|
29361
29604
|
const reason = !roots ? [`${import_node_path40.default.basename(pkg.manifest.dir)} has no library ${product}`] : blockers(roots.map((name3) => resolveTarget(pkg, name3)));
|
|
29362
29605
|
productOutcomes.set(`${pkg.manifest.dir}\0${product}`, { pkg, reason });
|
|
29363
29606
|
return reason;
|
|
29364
29607
|
};
|
|
29365
29608
|
const resolveDependencyProduct = (pkg, dependency) => {
|
|
29366
|
-
if (
|
|
29609
|
+
if (providedProducts.has(dependency.name)) return [];
|
|
29367
29610
|
const loaded2 = dependencyPackage(pkg, dependency);
|
|
29368
29611
|
return typeof loaded2 === "string" ? [loaded2] : loaded2 ? resolveProduct(loaded2, dependency.name) : [];
|
|
29369
29612
|
};
|
|
@@ -29396,7 +29639,7 @@ function resolveSwiftPackages(options) {
|
|
|
29396
29639
|
))
|
|
29397
29640
|
return false;
|
|
29398
29641
|
claimed.add(key2);
|
|
29399
|
-
|
|
29642
|
+
providedTargets.delete(name3);
|
|
29400
29643
|
for (const dependency of target.dependencies) {
|
|
29401
29644
|
if (dependency.kind === "target") claimTarget(pkg, dependency.name);
|
|
29402
29645
|
else {
|
|
@@ -29409,7 +29652,7 @@ function resolveSwiftPackages(options) {
|
|
|
29409
29652
|
const claimProduct = (pkg, product) => {
|
|
29410
29653
|
const roots = pkg.manifest.products.get(product)?.targets ?? [];
|
|
29411
29654
|
if (roots.map((name3) => claimTarget(pkg, name3)).some(Boolean))
|
|
29412
|
-
|
|
29655
|
+
providedProducts.delete(product);
|
|
29413
29656
|
};
|
|
29414
29657
|
for (const { product, source } of products) {
|
|
29415
29658
|
if (source.kind === "remote" && !options.provided) continue;
|
|
@@ -29417,7 +29660,7 @@ function resolveSwiftPackages(options) {
|
|
|
29417
29660
|
if (pkg && typeof pkg !== "string") claimProduct(pkg, product);
|
|
29418
29661
|
}
|
|
29419
29662
|
for (const { product, source } of products) {
|
|
29420
|
-
if (
|
|
29663
|
+
if (providedProducts.has(product)) continue;
|
|
29421
29664
|
if (source.kind === "remote" && !options.provided) continue;
|
|
29422
29665
|
const pkg = source.kind === "unnamed" ? unnamed(source, product) : load2(source);
|
|
29423
29666
|
const reason = pkg === void 0 ? ["no package the workspace references vends it"] : typeof pkg === "string" ? [pkg] : resolveProduct(pkg, product);
|
|
@@ -29499,10 +29742,10 @@ function resolveSwiftPackages(options) {
|
|
|
29499
29742
|
if (found.has(key2)) return;
|
|
29500
29743
|
found.add(key2);
|
|
29501
29744
|
if (pkg.manifest.targets.get(name3)?.type === "macro") return;
|
|
29502
|
-
if (
|
|
29745
|
+
if (providedTargets.has(name3) && placeholderPackage(pkg)) return;
|
|
29503
29746
|
for (const dependency of pkg.manifest.targets.get(name3)?.dependencies ?? []) {
|
|
29504
29747
|
if (dependency.kind === "target") visit(pkg, dependency.name);
|
|
29505
|
-
else if (!
|
|
29748
|
+
else if (!providedProducts.has(dependency.name)) {
|
|
29506
29749
|
const nested = dependencyPackage(pkg, dependency);
|
|
29507
29750
|
if (nested && typeof nested !== "string")
|
|
29508
29751
|
for (const root of nested.manifest.products.get(dependency.name)?.targets ?? [])
|
|
@@ -29511,7 +29754,7 @@ function resolveSwiftPackages(options) {
|
|
|
29511
29754
|
}
|
|
29512
29755
|
};
|
|
29513
29756
|
for (const { product, source } of listed) {
|
|
29514
|
-
if (
|
|
29757
|
+
if (providedProducts.has(product)) continue;
|
|
29515
29758
|
const pkg = source.kind === "unnamed" ? unnamed(source, product) : packages.get(sourceKey(source));
|
|
29516
29759
|
if (!pkg || typeof pkg === "string") continue;
|
|
29517
29760
|
for (const root of pkg.manifest.products.get(product)?.targets ?? [])
|
|
@@ -29588,7 +29831,7 @@ function resolveSwiftPackages(options) {
|
|
|
29588
29831
|
target.dependencies = (target.dependencies ?? []).flatMap(
|
|
29589
29832
|
(dependency) => {
|
|
29590
29833
|
if (dependency.kind === "target") return [dependency];
|
|
29591
|
-
if (
|
|
29834
|
+
if (providedProducts.has(dependency.name)) return [];
|
|
29592
29835
|
const nested = dependencyPackage(pkg, dependency);
|
|
29593
29836
|
if (!nested || typeof nested === "string") return [];
|
|
29594
29837
|
if (nativePackages.has(nested.manifest.dir))
|
|
@@ -29648,7 +29891,7 @@ function resolveSwiftPackages(options) {
|
|
|
29648
29891
|
});
|
|
29649
29892
|
result.sourceLinks.targets.push({
|
|
29650
29893
|
id,
|
|
29651
|
-
sourceTarget: target.type === "regular" && !
|
|
29894
|
+
sourceTarget: target.type === "regular" && !providedTargets.has(name3) ? name3 : null,
|
|
29652
29895
|
productName: name3,
|
|
29653
29896
|
productType: `swiftpm.target.${target.type}`,
|
|
29654
29897
|
machOType: null,
|
|
@@ -29734,7 +29977,7 @@ function sourceClosureDigest(srcDir, entrypoints) {
|
|
|
29734
29977
|
return hash.digest("hex");
|
|
29735
29978
|
}
|
|
29736
29979
|
var standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS);
|
|
29737
|
-
var STANDIN_SOURCE_DIGEST = true ? "
|
|
29980
|
+
var STANDIN_SOURCE_DIGEST = true ? "a6fbd6cacda09f1aa6c599d98ed2a57bec23f7b0037d3d77a24dd291012d3d49" : standinSourceDigest();
|
|
29738
29981
|
|
|
29739
29982
|
// src/swift-standins.ts
|
|
29740
29983
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
@@ -30631,6 +30874,12 @@ function binaryHeaderSearchPaths(binary, root, declaredFrameworks) {
|
|
|
30631
30874
|
const headers = libraryHeaders && import_node_fs46.default.existsSync(libraryHeaders) ? [libraryHeaders] : [];
|
|
30632
30875
|
if (headers.length === 0 && frameworks.length === 0)
|
|
30633
30876
|
return { frameworks: [], headers: [] };
|
|
30877
|
+
const provided = new Set(
|
|
30878
|
+
declaredFrameworks ? swiftPeachModules(declaredFrameworks.moduleRoot) : []
|
|
30879
|
+
);
|
|
30880
|
+
const providedFrameworks = frameworks.filter(
|
|
30881
|
+
(framework) => provided.has(import_node_path47.default.basename(framework, ".framework"))
|
|
30882
|
+
);
|
|
30634
30883
|
const declared = /* @__PURE__ */ new Map();
|
|
30635
30884
|
for (const framework of frameworks) {
|
|
30636
30885
|
const name3 = import_node_path47.default.basename(framework, ".framework");
|
|
@@ -30657,12 +30906,14 @@ function binaryHeaderSearchPaths(binary, root, declaredFrameworks) {
|
|
|
30657
30906
|
}
|
|
30658
30907
|
}
|
|
30659
30908
|
const declaredDigest = (0, import_node_crypto24.createHash)("sha256");
|
|
30909
|
+
for (const framework of providedFrameworks)
|
|
30910
|
+
declaredDigest.update(`provided/${import_node_path47.default.relative(artifact.dir, framework)}\0`);
|
|
30660
30911
|
for (const [framework, { declared: names, imports: imports2, sdkHeader }] of declared)
|
|
30661
30912
|
declaredDigest.update(import_node_path47.default.relative(artifact.dir, framework)).update([...names ?? []].sort().join("\0")).update("\n").update([...imports2].sort().join("\0")).update(sdkHeader ?? "");
|
|
30662
30913
|
const staging = import_node_path47.default.join(
|
|
30663
30914
|
root,
|
|
30664
30915
|
"peach-binary-trees",
|
|
30665
|
-
declared.size ? `${artifact.digest.slice(0, 32)}-${declaredDigest.digest("hex").slice(0, 16)}` : artifact.digest.slice(0, 32)
|
|
30916
|
+
declared.size || providedFrameworks.length ? `${artifact.digest.slice(0, 32)}-${declaredDigest.digest("hex").slice(0, 16)}` : artifact.digest.slice(0, 32)
|
|
30666
30917
|
);
|
|
30667
30918
|
const revision = import_node_path47.default.join(staging, "revisions", STANDIN_SOURCE_DIGEST.slice(0, 32));
|
|
30668
30919
|
const stageTree = () => {
|
|
@@ -30685,7 +30936,11 @@ function binaryHeaderSearchPaths(binary, root, declaredFrameworks) {
|
|
|
30685
30936
|
import_node_fs46.default.cpSync(
|
|
30686
30937
|
import_node_path47.default.join(framework, part),
|
|
30687
30938
|
import_node_path47.default.join(pending, "frameworks", import_node_path47.default.basename(framework), part),
|
|
30688
|
-
{
|
|
30939
|
+
{
|
|
30940
|
+
recursive: true,
|
|
30941
|
+
dereference: true,
|
|
30942
|
+
filter: (source) => !providedFrameworks.includes(framework) || import_node_path47.default.basename(source) !== `${import_node_path47.default.basename(framework, ".framework")}-Swift.h`
|
|
30943
|
+
}
|
|
30689
30944
|
);
|
|
30690
30945
|
const surface = found.find(
|
|
30691
30946
|
(item) => "headers" in item && import_node_path47.default.dirname(item.headers) === framework
|
|
@@ -30721,6 +30976,22 @@ function binaryHeaderSearchPaths(binary, root, declaredFrameworks) {
|
|
|
30721
30976
|
}
|
|
30722
30977
|
}
|
|
30723
30978
|
const contents = (0, import_node_crypto24.createHash)("sha256");
|
|
30979
|
+
for (const framework of providedFrameworks.filter((item) => !declared.has(item))) {
|
|
30980
|
+
const modulemap = import_node_path47.default.join(
|
|
30981
|
+
pending,
|
|
30982
|
+
"frameworks",
|
|
30983
|
+
import_node_path47.default.basename(framework),
|
|
30984
|
+
"Modules/module.modulemap"
|
|
30985
|
+
);
|
|
30986
|
+
const swiftModule = `${import_node_path47.default.basename(framework, ".framework")}.Swift`;
|
|
30987
|
+
import_node_fs46.default.writeFileSync(
|
|
30988
|
+
modulemap,
|
|
30989
|
+
import_node_fs46.default.readFileSync(modulemap, "utf8").replace(
|
|
30990
|
+
/\bmodule\s+([\w.]+)\s*\{[^{}]*\}/g,
|
|
30991
|
+
(declaration, name4) => name4 === swiftModule ? "" : declaration
|
|
30992
|
+
)
|
|
30993
|
+
);
|
|
30994
|
+
}
|
|
30724
30995
|
for (const relative2 of import_node_fs46.default.readdirSync(pending, { recursive: true, encoding: "utf8" }).sort()) {
|
|
30725
30996
|
const file = import_node_path47.default.join(pending, relative2);
|
|
30726
30997
|
contents.update(`${relative2}\0`);
|
|
@@ -31049,6 +31320,7 @@ function swiftStandin(surface, binary, toolchain, work, behavior, siblings) {
|
|
|
31049
31320
|
binary,
|
|
31050
31321
|
toolchain,
|
|
31051
31322
|
work,
|
|
31323
|
+
/* @__PURE__ */ new Set(),
|
|
31052
31324
|
behavior,
|
|
31053
31325
|
// the interface's imports peach ships carry the types its declarations name
|
|
31054
31326
|
[...new Set(imports2)].filter(
|
|
@@ -31121,6 +31393,7 @@ function placeholderStandin(surface, binary, toolchain, work, behavior, siblings
|
|
|
31121
31393
|
binary,
|
|
31122
31394
|
toolchain,
|
|
31123
31395
|
work,
|
|
31396
|
+
/* @__PURE__ */ new Set(),
|
|
31124
31397
|
behavior,
|
|
31125
31398
|
imports2.filter((module2) => siblings.has(module2)),
|
|
31126
31399
|
false,
|
|
@@ -31264,6 +31537,7 @@ function mixedStandin(surface, binary, toolchain, work, behavior, frameworkDirs,
|
|
|
31264
31537
|
binary,
|
|
31265
31538
|
toolchain,
|
|
31266
31539
|
work,
|
|
31540
|
+
view.requiredInits ?? /* @__PURE__ */ new Set(),
|
|
31267
31541
|
behavior,
|
|
31268
31542
|
imports2,
|
|
31269
31543
|
true,
|
|
@@ -31348,6 +31622,7 @@ function objcStandin(surface, binary, toolchain, work, behavior, frameworks, sib
|
|
|
31348
31622
|
binary,
|
|
31349
31623
|
toolchain,
|
|
31350
31624
|
work,
|
|
31625
|
+
/* @__PURE__ */ new Set(),
|
|
31351
31626
|
behavior,
|
|
31352
31627
|
[
|
|
31353
31628
|
.../* @__PURE__ */ new Set([
|
|
@@ -31367,7 +31642,7 @@ function objcStandin(surface, binary, toolchain, work, behavior, frameworks, sib
|
|
|
31367
31642
|
}
|
|
31368
31643
|
var OBJC_UNREPRESENTABLE = "cannot be marked '@objc' because its type cannot be represented in Objective-C";
|
|
31369
31644
|
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/;
|
|
31370
|
-
function graphStandin(module2, graphs, values, wasm, binary, toolchain, work, behavior, imports2 = [], requireSwift = false, objcProperties = /* @__PURE__ */ new Map(), placeholder = null, inheritedConformances = /* @__PURE__ */ new Map(), projections = /* @__PURE__ */ new Map(), dependencyGraphs = []) {
|
|
31645
|
+
function graphStandin(module2, graphs, values, wasm, binary, toolchain, work, requiredInits2, behavior, imports2 = [], requireSwift = false, objcProperties = /* @__PURE__ */ new Map(), placeholder = null, inheritedConformances = /* @__PURE__ */ new Map(), projections = /* @__PURE__ */ new Map(), dependencyGraphs = []) {
|
|
31371
31646
|
const paths = new Set(
|
|
31372
31647
|
graphs.flatMap(
|
|
31373
31648
|
(graph) => graph.symbols.map((symbol2) => symbol2.pathComponents.join("."))
|
|
@@ -31412,6 +31687,7 @@ function graphStandin(module2, graphs, values, wasm, binary, toolchain, work, be
|
|
|
31412
31687
|
module: module2,
|
|
31413
31688
|
source: `${binary.target} (${binary.source})`,
|
|
31414
31689
|
values,
|
|
31690
|
+
requiredInits: requiredInits2,
|
|
31415
31691
|
behavior,
|
|
31416
31692
|
omit,
|
|
31417
31693
|
plain,
|
|
@@ -31622,6 +31898,7 @@ function cStandin(surface, binary, toolchain, work) {
|
|
|
31622
31898
|
])
|
|
31623
31899
|
);
|
|
31624
31900
|
const include = import_node_path47.default.join(work, "include");
|
|
31901
|
+
import_node_fs46.default.mkdirSync(include, { recursive: true });
|
|
31625
31902
|
for (const [file, text5] of texts) {
|
|
31626
31903
|
import_node_fs46.default.mkdirSync(import_node_path47.default.dirname(import_node_path47.default.join(include, file)), { recursive: true });
|
|
31627
31904
|
import_node_fs46.default.writeFileSync(import_node_path47.default.join(include, file), text5);
|
|
@@ -33795,7 +34072,7 @@ async function prepareXcodeObjCImplementations(app, binaries, moduleRoot) {
|
|
|
33795
34072
|
let interrupted = false;
|
|
33796
34073
|
await mapLimit(
|
|
33797
34074
|
units,
|
|
33798
|
-
|
|
34075
|
+
swiftBuildJobs(),
|
|
33799
34076
|
async ({ target, index, unit: unit2, file }, position) => {
|
|
33800
34077
|
if (interrupted) return;
|
|
33801
34078
|
const minimum = minimums[index];
|