peachsim 0.1.1716 → 0.1.1728
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/README.md +21 -3
- package/cli/app-bundle-resources.ts +2 -1
- package/cli/app-fonts.ts +4 -4
- package/cli/app-splash.ts +4 -4
- package/cli/app-stubs.ts +17 -0
- package/cli/command-registry.ts +1 -0
- package/cli/commands/control.ts +82 -822
- package/cli/commands/daemon.ts +8 -0
- package/cli/commands/detox.ts +3 -0
- package/cli/commands/doctor.ts +19 -2
- package/cli/commands/inspect/actions.ts +74 -14
- package/cli/commands/inspect/core.ts +5 -1
- package/cli/commands/inspect/settling.ts +5 -2
- package/cli/commands/inspect/wait-ready.ts +6 -0
- package/cli/commands/inspect.ts +48 -45
- package/cli/commands/kotlin.ts +12 -2
- package/cli/commands/package.ts +750 -0
- package/cli/commands/serve.ts +6 -0
- package/cli/commands/shell-url.ts +834 -0
- package/cli/commands/swift.ts +42 -102
- package/cli/commands/test.ts +20 -0
- package/cli/commands/upload.ts +1 -1
- package/cli/device-option.ts +1 -1
- package/cli/main.ts +13 -1
- package/cli/native-input.ts +199 -0
- package/cli/outbound-endpoints.ts +26 -1
- package/cli/packaged-app-launcher.ts +95 -0
- package/cli/scene-video.ts +13 -6
- package/detox/index.ts +187 -23
- 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 +38000 -31658
- 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 +184 -60
- package/dist-lib/dev-bundle-resolution.cjs +14 -13
- package/dist-lib/expo-swift-bundle.cjs +18199 -11834
- package/dist-lib/expo-swift-metadata.cjs +4 -1
- package/dist-lib/expo-swift-metadata.mjs +3 -1
- package/dist-lib/home-paths.cjs +21 -2
- package/dist-lib/host/bridge-host.cjs +26509 -23850
- package/dist-lib/host/fetch-proxy-handler.cjs +221 -222
- 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 +876 -389
- 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 +127 -16
- package/dist-lib/menu.cjs +7 -1
- package/dist-lib/menu.mjs +7 -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 +883 -404
- package/dist-lib/native-app-identity-project.cjs +694 -280
- package/dist-lib/native-app-identity-project.mjs +490 -83
- package/dist-lib/native-app-identity.cjs +13 -2
- package/dist-lib/native-app-identity.mjs +13 -2
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +28 -23
- package/dist-lib/public-origins-lib.json +392 -224
- package/dist-lib/react-native-host-modules.cjs +32 -2
- package/dist-lib/react-native-host-modules.mjs +32 -2
- package/dist-lib/reap-browser.cjs +12 -4
- package/dist-lib/scripts/dev-server-scanner.cjs +15 -8
- package/dist-lib/sdk.cjs +17 -7
- package/dist-lib/sdk.mjs +16 -7
- package/dist-lib/skills.cjs +61838 -47851
- package/dist-lib/swift-compile.cjs +583 -360
- package/dist-lib/swift-compile.mjs +496 -275
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +1 -1
- package/dist-lib/swift-submit.cjs +2 -2
- package/dist-lib/swift-submit.mjs +2 -2
- package/dist-lib/swift-toolchain.cjs +105 -17
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +4453 -2231
- package/dist-lib/vite.cjs +230 -228
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-compat/src/stubs/native-seams/react-native-cookies.d.ts +17 -8
- package/dist-types/packages/peach-engine/src/engine/canvaskit-renderer.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/image-loader.d.ts +7 -5
- package/dist-types/packages/peach-engine/src/engine/memory-counts.d.ts +3 -1
- package/dist-types/packages/peach-engine/src/engine/node.d.ts +1 -11
- package/dist-types/packages/peach-engine/src/engine/types.d.ts +3 -0
- package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +9 -0
- package/dist-types/packages/peach-engine/src/render-worker/host-service-protocol.d.ts +3 -0
- package/dist-types/packages/peach-engine/src/render-worker/native-ui-commandContract.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/render-worker/shell-protocol.d.ts +4 -0
- package/dist-types/packages/peach-engine/src/render-worker/tree-sync-port.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/render-worker/worklet-runtime.d.ts +23 -1
- package/dist-types/packages/peach-engine/src/shell-events.d.ts +1 -0
- package/dist-types/packages/peach-globals/src/audioBridgeContract.d.ts +5 -0
- package/dist-types/packages/peach-globals/src/index.d.ts +1 -1
- package/dist-types/packages/peach-globals/src/keyboardBridgeContract.d.ts +11 -0
- package/dist-types/packages/peach-globals/src/shellBridgeContract.d.ts +1 -0
- package/dist-types/packages/peach-globals/src/testBridgeContract.d.ts +9 -2
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/scripts/dev-server-scanner.ts +12 -25
- package/sdk/ios/System/Library/Frameworks/AuthenticationServices.framework/Headers/ASFoundation.h +52 -0
- package/sdk/ios/System/Library/Frameworks/AuthenticationServices.framework/Headers/ASWebAuthenticationSession.h +128 -0
- package/sdk/ios/System/Library/Frameworks/AuthenticationServices.framework/Headers/ASWebAuthenticationSessionCallback.h +35 -0
- package/sdk/ios/System/Library/Frameworks/AuthenticationServices.framework/Headers/AuthenticationServices.h +3 -0
- package/sdk/ios/System/Library/Frameworks/AuthenticationServices.framework/Modules/module.modulemap +5 -0
- package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPMessage.h +724 -0
- package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetwork.h +4 -0
- package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetworkDefs.h +27 -0
- package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Modules/module.modulemap +5 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURL.h +1301 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h +2 -0
- package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocationManager.h +21 -50
- package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLRegion.h +6 -6
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h +75 -9
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h +12 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIInterface.h +23 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h +7 -9
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIOrientation.h +14 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIStringDrawing.h +12 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIView.h +14 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIViewAnimating.h +12 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIViewController.h +16 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIWindow.h +2 -0
- package/sdk/ios/usr/include/ConditionalMacros.h +619 -0
- package/sdk/ios/usr/include/module.modulemap +1 -0
- package/sdk/ios/usr/include/objc/objc-sync.h +59 -0
- package/sdk/ios/usr/include/os.modulemap +5 -0
- package/sdk/ios/usr/include/sys/cdefs.h +5 -0
- package/sdk/ios/usr/include/sys/ioccom.h +99 -0
- package/sdk/ios/usr/include/sys/syslog.h +236 -0
- package/sdk/ios/usr/include/syslog.h +24 -0
- package/sdk/ios/wasm/include/fcntl.h +4 -2
- package/sdk/ios/wasm/include/stdio.h +24 -0
- package/sdk/ios/wasm/include/stdlib.h +32 -7
- package/sdk/ios/wasm/include/sys/file.h +7 -0
- package/sdk/ios/wasm/include/sys/ioctl.h +6 -0
- package/sdk/ios/wasm/include/sys/syscall.h +9 -0
- package/sdk/ios/wasm/include/sys/time.h +10 -0
- package/sdk/ios/wasm/include/unistd.h +12 -3
- package/sdk/native-hashes.json +1 -0
- package/skills/contrast/SKILL.md +2 -1
- package/skills/peach-test/SKILL.md +7 -3
- package/src/admitted-mac-build.ts +3 -0
- package/src/android-app-identity.ts +18 -0
- package/src/android-root-module.ts +9 -9
- package/src/appPackageContract.ts +81 -0
- package/src/bridge-contract.ts +50 -0
- package/src/bundle-channel.mjs +21 -4
- package/src/dev-bundle-resolution.ts +7 -27
- package/src/dom-source-reference.ts +15 -0
- package/src/expo-discovery-cache.ts +127 -23
- package/src/expo-manifest-body.ts +33 -0
- package/src/expo-native-workspace.ts +38 -13
- package/src/expo-swift-host.ts +264 -62
- package/src/expoSwiftContract.ts +3 -0
- package/src/generated/swift-c-predefines.json +1 -1
- package/src/home-paths.ts +35 -1
- package/src/host/app-package-handler.ts +47 -0
- package/src/host/bridge-host.ts +3 -0
- package/src/host/staged-host-files.ts +18 -0
- package/src/index.ts +3 -0
- package/src/kotlin-host.ts +21 -18
- package/src/kotlin-instance-source.ts +126 -0
- package/src/menu.ts +7 -0
- package/src/native-app-identity-project.ts +7 -2
- package/src/native-app-identity.ts +11 -0
- package/src/native-firebase-config.ts +24 -1
- package/src/nitro-adapter.lock.json +268 -268
- package/src/nitro-bundle.ts +8 -0
- package/src/nitro-compile.ts +35 -9
- package/src/nitro-dependencies.ts +21 -19
- package/src/nitro-source.ts +4 -0
- package/src/nitroContract.ts +7 -0
- package/src/react-native-bridge-modules.ts +68 -42
- package/src/react-native-host-modules.ts +31 -1
- package/src/reactNativeConfigurationContract.ts +14 -0
- package/src/reap-browser.ts +15 -3
- package/src/sdk.ts +5 -0
- package/src/settingsContract.ts +27 -1
- package/src/sim-client.ts +4 -1
- package/src/storageSnapshotContract.ts +3 -0
- package/src/swift-compile.ts +221 -41
- package/src/swift-coverage/provenance.ts +1 -0
- package/src/swift-coverage/xcode-asset-symbols.ts +922 -0
- package/src/swift-coverage/xcode-assets.ts +89 -131
- package/src/swift-coverage/xcode.ts +1 -1
- package/src/swift-cxx-reachable.ts +2 -1
- package/src/swift-distribution.lock.json +14 -13
- package/src/swift-host.ts +95 -22
- package/src/swift-icu.ts +1 -1
- package/src/swift-link-roots.ts +118 -0
- package/src/swift-objc-compile.ts +144 -22
- package/src/swift-objc-import.ts +6 -0
- package/src/swift-objc-standin.ts +2 -14
- package/src/swift-package-manifest.ts +14 -6
- package/src/swift-packages.ts +75 -11
- package/src/swift-pdf-raster.ts +1 -0
- package/src/swift-root-lock.ts +17 -1
- package/src/swift-source-pods.ts +2 -10
- package/src/swift-standin-emit.ts +592 -57
- package/src/swift-standins.ts +430 -49
- package/src/swift-submit.ts +3 -1
- package/src/swift-toolchain.ts +140 -17
- package/src/turbo-codegen-intake.ts +91 -0
- package/src/vite-plugin-one.ts +13 -9
- package/src/vite-plugin.ts +28 -15
- package/src/xcode-project.ts +223 -22
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.1728 | (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;
|
|
@@ -64,7 +64,10 @@ __export(swift_compile_exports, {
|
|
|
64
64
|
swiftSdkPaths: () => swiftSdkPaths,
|
|
65
65
|
swiftSourceAsIOS: () => swiftSourceAsIOS,
|
|
66
66
|
swiftSourceClosure: () => swiftSourceClosure,
|
|
67
|
+
swiftSystemLibraryExclusions: () => swiftSystemLibraryExclusions,
|
|
68
|
+
swiftSystemLibrarySurface: () => swiftSystemLibrarySurface,
|
|
67
69
|
swiftTargetDependencies: () => swiftTargetDependencies,
|
|
70
|
+
swiftTypedApplicationEntry: () => swiftTypedApplicationEntry,
|
|
68
71
|
syncSwiftTree: () => syncSwiftTree,
|
|
69
72
|
withNativeSourceGlue: () => withNativeSourceGlue,
|
|
70
73
|
wrapUIApplicationMainEntry: () => wrapUIApplicationMainEntry,
|
|
@@ -73,9 +76,9 @@ __export(swift_compile_exports, {
|
|
|
73
76
|
module.exports = __toCommonJS(swift_compile_exports);
|
|
74
77
|
var import_node_child_process7 = require("node:child_process");
|
|
75
78
|
var import_node_crypto5 = require("node:crypto");
|
|
76
|
-
var
|
|
79
|
+
var import_node_fs9 = require("node:fs");
|
|
77
80
|
var import_node_os4 = __toESM(require("node:os"), 1);
|
|
78
|
-
var
|
|
81
|
+
var import_node_path13 = __toESM(require("node:path"), 1);
|
|
79
82
|
|
|
80
83
|
// src/admitted-mac-build.ts
|
|
81
84
|
var import_node_child_process = require("node:child_process");
|
|
@@ -84,6 +87,8 @@ function windowAdmission() {
|
|
|
84
87
|
encoding: "utf8",
|
|
85
88
|
stdio: ["ignore", "pipe", "inherit"]
|
|
86
89
|
});
|
|
90
|
+
if (result.error && "code" in result.error && result.error.code === "ENOENT")
|
|
91
|
+
return null;
|
|
87
92
|
if (result.error) throw result.error;
|
|
88
93
|
if (result.status === 1) return null;
|
|
89
94
|
if (result.status !== 0) throw new Error(`tm window ancestor exited ${result.status}`);
|
|
@@ -105,7 +110,7 @@ function admittedMacBuilderSlot(env = process.env) {
|
|
|
105
110
|
|
|
106
111
|
// src/generated/swift-c-predefines.json
|
|
107
112
|
var swift_c_predefines_default = {
|
|
108
|
-
release: "swift-6.4.0-RELEASE-custom-
|
|
113
|
+
release: "swift-6.4.0-RELEASE-custom-0b2d0a9011c88e66",
|
|
109
114
|
languages: {
|
|
110
115
|
c: {
|
|
111
116
|
TARGET_IPHONE_SIMULATOR: "1",
|
|
@@ -2161,8 +2166,17 @@ function rnxHomeDir() {
|
|
|
2161
2166
|
function cacheDir() {
|
|
2162
2167
|
return import_node_path.default.join(rnxHomeDir(), "cache");
|
|
2163
2168
|
}
|
|
2169
|
+
var BUILDERS_ROOT_ENV = "CONTRAST_BUILDERS_ROOT";
|
|
2170
|
+
function buildersRootEnv() {
|
|
2171
|
+
const root = process.env[BUILDERS_ROOT_ENV]?.trim();
|
|
2172
|
+
return root ? root : null;
|
|
2173
|
+
}
|
|
2174
|
+
function swiftCacheDir() {
|
|
2175
|
+
const root = buildersRootEnv();
|
|
2176
|
+
return root ? import_node_path.default.join(root, "peach-cache") : cacheDir();
|
|
2177
|
+
}
|
|
2164
2178
|
function swiftPackageCacheOptions() {
|
|
2165
|
-
const root = import_node_path.default.join(
|
|
2179
|
+
const root = import_node_path.default.join(swiftCacheDir(), "swiftpm");
|
|
2166
2180
|
return ["cache", "config", "security"].flatMap((name2) => [
|
|
2167
2181
|
`--${name2}-path`,
|
|
2168
2182
|
import_node_path.default.join(root, name2)
|
|
@@ -2850,9 +2864,9 @@ var EXCERPT = /^(\s*)(\d+)( \| )(.*)$/;
|
|
|
2850
2864
|
var MARKER = /^(\s*)( \| )(.*)$/;
|
|
2851
2865
|
function designTimeDiagnostic(output, files) {
|
|
2852
2866
|
const rewritten = /* @__PURE__ */ new Map();
|
|
2853
|
-
const linesOf = (
|
|
2867
|
+
const linesOf = (path13) => {
|
|
2854
2868
|
const file = Object.keys(files).find(
|
|
2855
|
-
(name2) => name2.endsWith(".swift") && (
|
|
2869
|
+
(name2) => name2.endsWith(".swift") && (path13 === name2 || path13.endsWith(`/${name2}`))
|
|
2856
2870
|
);
|
|
2857
2871
|
if (file === void 0) return null;
|
|
2858
2872
|
let lines = rewritten.get(file);
|
|
@@ -2968,31 +2982,53 @@ function swiftSdkOptions() {
|
|
|
2968
2982
|
}
|
|
2969
2983
|
return [];
|
|
2970
2984
|
}
|
|
2971
|
-
var SWIFT_HOST_COMPILER_RELEASE = "swift-6.4.0-RELEASE-custom-
|
|
2972
|
-
var SWIFT_HOST_COMPILER_ID = "
|
|
2985
|
+
var SWIFT_HOST_COMPILER_RELEASE = "swift-6.4.0-RELEASE-custom-0b2d0a9011c88e66";
|
|
2986
|
+
var SWIFT_HOST_COMPILER_ID = "0b2d0a9011c88e66";
|
|
2973
2987
|
var compilerArchives = {
|
|
2974
|
-
"
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2988
|
+
"swift-6.4.0-RELEASE-custom-ecd2ad9d3fe59329": {
|
|
2989
|
+
identity: "ecd2ad9d3fe59329",
|
|
2990
|
+
hosts: {
|
|
2991
|
+
"darwin-arm64": {
|
|
2992
|
+
checksum: "ab42a13b34e410ca09737420d1ee1d6af417eec039ab44f9a60502bdb5c76506",
|
|
2993
|
+
manifest: "8a93b6b1e6ff577f6dacd81a511d415ca3b396698f9b0c4abc35a4ca807e9d1a"
|
|
2994
|
+
},
|
|
2995
|
+
"linux-x64": {
|
|
2996
|
+
checksum: "b174baa2c578fb32f09c79590d65d03951b04cdec52101b23a46c0b274249fc3",
|
|
2997
|
+
manifest: "330e6cbae5890111c22a58e645049a971eff30334c3f240c650fcfedfeab4ef6"
|
|
2998
|
+
},
|
|
2999
|
+
"linux-arm64": {
|
|
3000
|
+
checksum: "25f722334dd9d79391cb2e47301165e9ef98dd9a8036927652f3c5db3c56b2ae",
|
|
3001
|
+
manifest: "94e5667febf26f8a4ee8c5456f83f62d17453e503d261a4c46d2b80f872470ab"
|
|
3002
|
+
}
|
|
3003
|
+
}
|
|
2981
3004
|
},
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
3005
|
+
[SWIFT_HOST_COMPILER_RELEASE]: {
|
|
3006
|
+
identity: SWIFT_HOST_COMPILER_ID,
|
|
3007
|
+
hosts: {
|
|
3008
|
+
"darwin-arm64": {
|
|
3009
|
+
checksum: "dc6a494227297ea657e8e5f7c5b4a861cb5e142bdbcfcb028ace2aeb19db90cc",
|
|
3010
|
+
manifest: "d8e9eee0fb9b847f1e9350525d6c68606df46101745f553332309ed026b3c26a"
|
|
3011
|
+
},
|
|
3012
|
+
"linux-x64": {
|
|
3013
|
+
checksum: "85c04b4496aea1657c21a47f448e01d6ccc1c7920d130a566db37fb8350a7be2",
|
|
3014
|
+
manifest: "8451659e74235ad53b700c1afbe293512197900eb98cb1f79e36df2f5c85d511"
|
|
3015
|
+
},
|
|
3016
|
+
"linux-arm64": {
|
|
3017
|
+
checksum: "196606ed62c5c926d18e6ef0769cb1ab21c9943f9084070ddf14a7bc696768b8",
|
|
3018
|
+
manifest: "85fb8d5b6527bd75003a6dbd25b68b22540665cf9df9b13f41f82e5d8acdbf1d"
|
|
3019
|
+
}
|
|
3020
|
+
}
|
|
2985
3021
|
}
|
|
2986
3022
|
};
|
|
2987
3023
|
function swiftHostCompilerArchive(release, host2 = `${process.platform}-${process.arch}`) {
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
const archive =
|
|
3024
|
+
const compiler = compilerArchives[release];
|
|
3025
|
+
if (!compiler) throw new Error(`unqualified host compiler ${release}`);
|
|
3026
|
+
const archive = compiler.hosts[host2];
|
|
2991
3027
|
if (!archive) throw new Error(`unsupported Swift compiler host ${host2}`);
|
|
2992
3028
|
return {
|
|
2993
3029
|
...archive,
|
|
2994
|
-
identity:
|
|
2995
|
-
url: `https://r2.sootsim.com/swift-host-compiler/${
|
|
3030
|
+
identity: compiler.identity,
|
|
3031
|
+
url: `https://r2.sootsim.com/swift-host-compiler/${compiler.identity}/${release}-${host2}.tar.gz`
|
|
2996
3032
|
};
|
|
2997
3033
|
}
|
|
2998
3034
|
function swiftUpstreamRelease(release) {
|
|
@@ -3355,7 +3391,7 @@ function archiveMember(archive, name2) {
|
|
|
3355
3391
|
}
|
|
3356
3392
|
function icuSegment(object) {
|
|
3357
3393
|
let at = 8;
|
|
3358
|
-
const
|
|
3394
|
+
const leb2 = () => {
|
|
3359
3395
|
let result = 0;
|
|
3360
3396
|
let shift = 0;
|
|
3361
3397
|
let byte;
|
|
@@ -3369,15 +3405,15 @@ function icuSegment(object) {
|
|
|
3369
3405
|
const found = [];
|
|
3370
3406
|
while (at < object.length) {
|
|
3371
3407
|
const id = object[at++];
|
|
3372
|
-
const size =
|
|
3408
|
+
const size = leb2();
|
|
3373
3409
|
const end = at + size;
|
|
3374
3410
|
if (id === 11) {
|
|
3375
|
-
for (let count =
|
|
3376
|
-
if (
|
|
3411
|
+
for (let count = leb2(); count > 0; count--) {
|
|
3412
|
+
if (leb2() !== 0) throw new Error("swift-icu: unexpected data segment kind");
|
|
3377
3413
|
at++;
|
|
3378
|
-
|
|
3414
|
+
leb2();
|
|
3379
3415
|
at++;
|
|
3380
|
-
const length =
|
|
3416
|
+
const length = leb2();
|
|
3381
3417
|
const bytes = object.subarray(at, at + length);
|
|
3382
3418
|
if (bytes[2] === 218 && bytes[3] === 39) found.push(bytes);
|
|
3383
3419
|
at += length;
|
|
@@ -3390,6 +3426,100 @@ function icuSegment(object) {
|
|
|
3390
3426
|
return found[0];
|
|
3391
3427
|
}
|
|
3392
3428
|
|
|
3429
|
+
// src/swift-link-roots.ts
|
|
3430
|
+
var import_node_fs5 = __toESM(require("node:fs"), 1);
|
|
3431
|
+
var import_node_path6 = __toESM(require("node:path"), 1);
|
|
3432
|
+
var OBJC_SEGMENTS = [
|
|
3433
|
+
"__objc_classes",
|
|
3434
|
+
"__objc_protocols",
|
|
3435
|
+
"__objc_cats",
|
|
3436
|
+
"__objc_class_aliases"
|
|
3437
|
+
];
|
|
3438
|
+
var leb = (bytes, at) => {
|
|
3439
|
+
let value = 0;
|
|
3440
|
+
let scale = 1;
|
|
3441
|
+
for (; ; ) {
|
|
3442
|
+
const byte = bytes[at.offset++];
|
|
3443
|
+
value += (byte & 127) * scale;
|
|
3444
|
+
if (!(byte & 128)) return value;
|
|
3445
|
+
scale *= 128;
|
|
3446
|
+
}
|
|
3447
|
+
};
|
|
3448
|
+
function objcSegmentSizes(bytes) {
|
|
3449
|
+
const at = { offset: 8 };
|
|
3450
|
+
const names = [];
|
|
3451
|
+
const sizes = [];
|
|
3452
|
+
while (at.offset < bytes.length) {
|
|
3453
|
+
const id = bytes[at.offset++];
|
|
3454
|
+
const size = leb(bytes, at);
|
|
3455
|
+
const end = at.offset + size;
|
|
3456
|
+
if (id === 0) {
|
|
3457
|
+
const length = leb(bytes, at);
|
|
3458
|
+
const name2 = Buffer.from(bytes.subarray(at.offset, at.offset + length)).toString();
|
|
3459
|
+
at.offset += length;
|
|
3460
|
+
if (name2 === "linking") {
|
|
3461
|
+
leb(bytes, at);
|
|
3462
|
+
while (at.offset < end) {
|
|
3463
|
+
const kind = bytes[at.offset++];
|
|
3464
|
+
const length2 = leb(bytes, at);
|
|
3465
|
+
const next = at.offset + length2;
|
|
3466
|
+
if (kind === 5) {
|
|
3467
|
+
for (let count = leb(bytes, at); count > 0; count--) {
|
|
3468
|
+
const nameLength = leb(bytes, at);
|
|
3469
|
+
names.push(
|
|
3470
|
+
Buffer.from(bytes.subarray(at.offset, at.offset + nameLength)).toString()
|
|
3471
|
+
);
|
|
3472
|
+
at.offset += nameLength;
|
|
3473
|
+
leb(bytes, at);
|
|
3474
|
+
leb(bytes, at);
|
|
3475
|
+
}
|
|
3476
|
+
}
|
|
3477
|
+
at.offset = next;
|
|
3478
|
+
}
|
|
3479
|
+
}
|
|
3480
|
+
} else if (id === 11) {
|
|
3481
|
+
for (let count = leb(bytes, at); count > 0; count--) {
|
|
3482
|
+
const flags = leb(bytes, at);
|
|
3483
|
+
if (flags === 2) leb(bytes, at);
|
|
3484
|
+
if (flags !== 1) {
|
|
3485
|
+
at.offset++;
|
|
3486
|
+
leb(bytes, at);
|
|
3487
|
+
at.offset++;
|
|
3488
|
+
}
|
|
3489
|
+
const length = leb(bytes, at);
|
|
3490
|
+
sizes.push(length);
|
|
3491
|
+
at.offset += length;
|
|
3492
|
+
}
|
|
3493
|
+
}
|
|
3494
|
+
at.offset = end;
|
|
3495
|
+
}
|
|
3496
|
+
const result = /* @__PURE__ */ new Map();
|
|
3497
|
+
names.forEach((name2, index) => {
|
|
3498
|
+
if (OBJC_SEGMENTS.includes(name2))
|
|
3499
|
+
result.set(name2, (result.get(name2) ?? 0) + (sizes[index] ?? 0));
|
|
3500
|
+
});
|
|
3501
|
+
return result;
|
|
3502
|
+
}
|
|
3503
|
+
var rootsByDistribution = /* @__PURE__ */ new Map();
|
|
3504
|
+
function swiftObjcRootObjects(id, root, objects) {
|
|
3505
|
+
const cached = rootsByDistribution.get(id);
|
|
3506
|
+
if (cached) return cached;
|
|
3507
|
+
const measured = objects.map(
|
|
3508
|
+
(object) => [object, objcSegmentSizes(import_node_fs5.default.readFileSync(import_node_path6.default.join(root, object)))]
|
|
3509
|
+
);
|
|
3510
|
+
const empty = /* @__PURE__ */ new Map();
|
|
3511
|
+
for (const [, sizes] of measured)
|
|
3512
|
+
for (const [name2, size] of sizes)
|
|
3513
|
+
empty.set(name2, Math.min(empty.get(name2) ?? size, size));
|
|
3514
|
+
const roots = new Set(
|
|
3515
|
+
measured.filter(
|
|
3516
|
+
([, sizes]) => [...sizes].some(([name2, size]) => size > (empty.get(name2) ?? 0))
|
|
3517
|
+
).map(([object]) => object)
|
|
3518
|
+
);
|
|
3519
|
+
rootsByDistribution.set(id, roots);
|
|
3520
|
+
return roots;
|
|
3521
|
+
}
|
|
3522
|
+
|
|
3393
3523
|
// src/swift-objc-import.ts
|
|
3394
3524
|
var SWIFT_OBJC_INTEROP_FLAGS = [
|
|
3395
3525
|
"-Xfrontend",
|
|
@@ -3401,6 +3531,9 @@ var SWIFT_OBJC_INTEROP_FLAGS = [
|
|
|
3401
3531
|
"-Xcc",
|
|
3402
3532
|
"-fblocks"
|
|
3403
3533
|
];
|
|
3534
|
+
function swiftClangImporterFlags(flags) {
|
|
3535
|
+
return flags.filter((flag) => flag !== "-fobjc-arc" && flag !== "-fno-objc-arc");
|
|
3536
|
+
}
|
|
3404
3537
|
function swiftObjCModuleMap(module2, headers) {
|
|
3405
3538
|
return [
|
|
3406
3539
|
`module ${module2} {`,
|
|
@@ -3421,11 +3554,11 @@ var swiftObjCRuntimeFlags = [
|
|
|
3421
3554
|
|
|
3422
3555
|
// src/swift-objc-standin.ts
|
|
3423
3556
|
var import_node_crypto3 = require("node:crypto");
|
|
3424
|
-
var
|
|
3557
|
+
var import_node_path9 = __toESM(require("node:path"), 1);
|
|
3425
3558
|
|
|
3426
3559
|
// src/swift-objc-platform.ts
|
|
3427
3560
|
var import_node_child_process5 = require("node:child_process");
|
|
3428
|
-
var
|
|
3561
|
+
var import_node_path7 = __toESM(require("node:path"), 1);
|
|
3429
3562
|
var platforms = /* @__PURE__ */ new Map();
|
|
3430
3563
|
function swiftObjCPlatformFlags(toolchainBin, minimum) {
|
|
3431
3564
|
const key = `${toolchainBin}:${minimum}`;
|
|
@@ -3437,7 +3570,7 @@ function swiftObjCPlatformFlags(toolchainBin, minimum) {
|
|
|
3437
3570
|
minimum % 100
|
|
3438
3571
|
].join(".");
|
|
3439
3572
|
const result = (0, import_node_child_process5.spawnSync)(
|
|
3440
|
-
|
|
3573
|
+
import_node_path7.default.join(toolchainBin, "clang"),
|
|
3441
3574
|
[
|
|
3442
3575
|
"-target",
|
|
3443
3576
|
`arm64-apple-ios${version}-simulator`,
|
|
@@ -3471,10 +3604,10 @@ function swiftObjCPlatformFlags(toolchainBin, minimum) {
|
|
|
3471
3604
|
}
|
|
3472
3605
|
|
|
3473
3606
|
// src/swift-objc-sdk.ts
|
|
3474
|
-
var
|
|
3607
|
+
var import_node_path8 = __toESM(require("node:path"), 1);
|
|
3475
3608
|
var IOS_SDK_TARGET = "arm64-apple-ios16.0-simulator";
|
|
3476
3609
|
var OVERLAY_PATH = /^usr\/lib\/swift\/([^/]+)\.swiftmodule\/arm64-apple-ios-simulator\.swiftinterface$/;
|
|
3477
|
-
var tree = typeof __PEACH_BUNDLED_IOS_SDK__ === "undefined" ? readIosSdkTree(
|
|
3610
|
+
var tree = typeof __PEACH_BUNDLED_IOS_SDK__ === "undefined" ? readIosSdkTree(import_node_path8.default.join(peachsimPackageRoot(), "sdk", "ios")) : Object.entries(__PEACH_BUNDLED_IOS_SDK__).sort(([a], [b]) => a < b ? -1 : 1);
|
|
3478
3611
|
var IOS_SDK_HEADERS = {};
|
|
3479
3612
|
var IOS_SDK_OVERLAYS = {};
|
|
3480
3613
|
for (const [file, text2] of tree) {
|
|
@@ -3978,13 +4111,7 @@ function iosSdkEntries() {
|
|
|
3978
4111
|
${text2}`
|
|
3979
4112
|
]
|
|
3980
4113
|
);
|
|
3981
|
-
|
|
3982
|
-
if (osMap === void 0)
|
|
3983
|
-
throw new Error("sdk intake has no usr/include/os.modulemap for clang-import");
|
|
3984
|
-
const clangImport = [
|
|
3985
|
-
["clang-import/module.modulemap", osMap]
|
|
3986
|
-
];
|
|
3987
|
-
return [...Object.entries(IOS_SDK_HEADERS), ...overlays, ...clangImport].sort(
|
|
4114
|
+
return [...Object.entries(IOS_SDK_HEADERS), ...overlays].sort(
|
|
3988
4115
|
([a], [b]) => a < b ? -1 : 1
|
|
3989
4116
|
);
|
|
3990
4117
|
}
|
|
@@ -4007,11 +4134,11 @@ function objcSdkIntakeFlags(headers, toolchainBin, minimum) {
|
|
|
4007
4134
|
"-DU_DISABLE_RENAMING=0",
|
|
4008
4135
|
...WASI_EMULATION_FLAGS,
|
|
4009
4136
|
"-iframework",
|
|
4010
|
-
|
|
4137
|
+
import_node_path9.default.join(headers, "System/Library/Frameworks"),
|
|
4011
4138
|
"-isystem",
|
|
4012
|
-
|
|
4139
|
+
import_node_path9.default.join(headers, "wasm/include"),
|
|
4013
4140
|
"-idirafter",
|
|
4014
|
-
|
|
4141
|
+
import_node_path9.default.join(headers, "usr/include")
|
|
4015
4142
|
];
|
|
4016
4143
|
}
|
|
4017
4144
|
function iosDeploymentMinimum(version) {
|
|
@@ -4023,8 +4150,8 @@ function iosDeploymentMinimum(version) {
|
|
|
4023
4150
|
// src/swift-root-lock.ts
|
|
4024
4151
|
var import_node_child_process6 = require("node:child_process");
|
|
4025
4152
|
var import_node_crypto4 = require("node:crypto");
|
|
4026
|
-
var
|
|
4027
|
-
var
|
|
4153
|
+
var import_node_fs6 = require("node:fs");
|
|
4154
|
+
var import_node_path10 = __toESM(require("node:path"), 1);
|
|
4028
4155
|
var POLL_MS = 250;
|
|
4029
4156
|
var START_TOLERANCE_MS = 2e3;
|
|
4030
4157
|
function errorCode(error) {
|
|
@@ -4090,7 +4217,7 @@ function pause(ms, signal) {
|
|
|
4090
4217
|
var name = (number, suffix) => `${String(number).padStart(12, "0")}.${suffix}`;
|
|
4091
4218
|
function generationNumbers(directory) {
|
|
4092
4219
|
const numbers = /* @__PURE__ */ new Set();
|
|
4093
|
-
for (const entry of (0,
|
|
4220
|
+
for (const entry of (0, import_node_fs6.readdirSync)(directory)) {
|
|
4094
4221
|
const match = /^(\d{12})\./.exec(entry);
|
|
4095
4222
|
if (match) numbers.add(Number(match[1]));
|
|
4096
4223
|
}
|
|
@@ -4099,7 +4226,7 @@ function generationNumbers(directory) {
|
|
|
4099
4226
|
function readGeneration(directory, number) {
|
|
4100
4227
|
let owner;
|
|
4101
4228
|
try {
|
|
4102
|
-
owner = (0,
|
|
4229
|
+
owner = (0, import_node_fs6.readFileSync)(import_node_path10.default.join(directory, name(number, "owner")), "utf8");
|
|
4103
4230
|
} catch (error) {
|
|
4104
4231
|
if (errorCode(error) === "ENOENT") return null;
|
|
4105
4232
|
throw error;
|
|
@@ -4107,29 +4234,29 @@ function readGeneration(directory, number) {
|
|
|
4107
4234
|
return {
|
|
4108
4235
|
number,
|
|
4109
4236
|
holder: parseIdentity(owner),
|
|
4110
|
-
released: (0,
|
|
4237
|
+
released: (0, import_node_fs6.readdirSync)(directory).includes(name(number, "released"))
|
|
4111
4238
|
};
|
|
4112
4239
|
}
|
|
4113
4240
|
function readChildren(directory, number) {
|
|
4114
4241
|
const prefix = name(number, "child.");
|
|
4115
|
-
return (0,
|
|
4242
|
+
return (0, import_node_fs6.readdirSync)(directory).filter((entry) => entry.startsWith(prefix)).map((entry) => parseIdentity((0, import_node_fs6.readFileSync)(import_node_path10.default.join(directory, entry), "utf8")));
|
|
4116
4243
|
}
|
|
4117
4244
|
function groupAlive(table, leader) {
|
|
4118
4245
|
const row = table.find((candidate) => candidate.pid === leader.pid);
|
|
4119
4246
|
if (row && !sameProcess(row, leader)) return false;
|
|
4120
4247
|
return table.some((candidate) => candidate.pgid === leader.pid && !candidate.zombie);
|
|
4121
4248
|
}
|
|
4122
|
-
async function withSwiftRootLock(root, work, signal) {
|
|
4123
|
-
const directory =
|
|
4249
|
+
async function withSwiftRootLock(root, work, signal, wait = true) {
|
|
4250
|
+
const directory = import_node_path10.default.join(
|
|
4124
4251
|
rnxHomeDir(),
|
|
4125
4252
|
"cache",
|
|
4126
4253
|
"swift-root-locks",
|
|
4127
4254
|
(0, import_node_crypto4.createHash)("sha256").update(root).digest("hex").slice(0, 32)
|
|
4128
4255
|
);
|
|
4129
|
-
(0,
|
|
4256
|
+
(0, import_node_fs6.mkdirSync)(directory, { recursive: true });
|
|
4130
4257
|
const token = (0, import_node_crypto4.randomUUID)();
|
|
4131
4258
|
const owner = JSON.stringify(ownIdentity(process.pid));
|
|
4132
|
-
const pending =
|
|
4259
|
+
const pending = import_node_path10.default.join(directory, `pending.${token}`);
|
|
4133
4260
|
let held = 0;
|
|
4134
4261
|
for (; ; ) {
|
|
4135
4262
|
signal?.throwIfAborted();
|
|
@@ -4139,35 +4266,37 @@ async function withSwiftRootLock(root, work, signal) {
|
|
|
4139
4266
|
if (current && !current.released) {
|
|
4140
4267
|
const table = processTable();
|
|
4141
4268
|
if (table.some((row) => !row.zombie && sameProcess(row, current.holder))) {
|
|
4269
|
+
if (!wait) return void 0;
|
|
4142
4270
|
await pause(POLL_MS, signal);
|
|
4143
4271
|
continue;
|
|
4144
4272
|
}
|
|
4145
4273
|
const children2 = readChildren(directory, newest);
|
|
4146
4274
|
if (children2.some((child) => groupAlive(table, child))) {
|
|
4275
|
+
if (!wait) return void 0;
|
|
4147
4276
|
await pause(POLL_MS, signal);
|
|
4148
4277
|
continue;
|
|
4149
4278
|
}
|
|
4150
4279
|
}
|
|
4151
|
-
(0,
|
|
4280
|
+
(0, import_node_fs6.writeFileSync)(pending, owner);
|
|
4152
4281
|
try {
|
|
4153
|
-
(0,
|
|
4282
|
+
(0, import_node_fs6.linkSync)(pending, import_node_path10.default.join(directory, name(newest + 1, "owner")));
|
|
4154
4283
|
} catch (error) {
|
|
4155
4284
|
if (errorCode(error) === "EEXIST") continue;
|
|
4156
4285
|
throw error;
|
|
4157
4286
|
} finally {
|
|
4158
|
-
(0,
|
|
4287
|
+
(0, import_node_fs6.rmSync)(pending, { force: true });
|
|
4159
4288
|
}
|
|
4160
4289
|
const numbers = generationNumbers(directory);
|
|
4161
4290
|
if (numbers.at(-1) !== newest + 1) {
|
|
4162
|
-
(0,
|
|
4291
|
+
(0, import_node_fs6.rmSync)(import_node_path10.default.join(directory, name(newest + 1, "owner")), { force: true });
|
|
4163
4292
|
continue;
|
|
4164
4293
|
}
|
|
4165
4294
|
held = newest + 1;
|
|
4166
4295
|
for (const number of numbers)
|
|
4167
4296
|
if (number < held) {
|
|
4168
|
-
for (const entry of (0,
|
|
4297
|
+
for (const entry of (0, import_node_fs6.readdirSync)(directory))
|
|
4169
4298
|
if (entry.startsWith(name(number, "")))
|
|
4170
|
-
(0,
|
|
4299
|
+
(0, import_node_fs6.rmSync)(import_node_path10.default.join(directory, entry), { force: true });
|
|
4171
4300
|
}
|
|
4172
4301
|
break;
|
|
4173
4302
|
}
|
|
@@ -4190,10 +4319,10 @@ async function withSwiftRootLock(root, work, signal) {
|
|
|
4190
4319
|
}
|
|
4191
4320
|
const childPending = `${pending}.child.${child.pid}`;
|
|
4192
4321
|
try {
|
|
4193
|
-
(0,
|
|
4194
|
-
(0,
|
|
4322
|
+
(0, import_node_fs6.writeFileSync)(childPending, JSON.stringify(ownIdentity(child.pid)));
|
|
4323
|
+
(0, import_node_fs6.linkSync)(childPending, import_node_path10.default.join(directory, name(held, `child.${child.pid}`)));
|
|
4195
4324
|
} finally {
|
|
4196
|
-
(0,
|
|
4325
|
+
(0, import_node_fs6.rmSync)(childPending, { force: true });
|
|
4197
4326
|
}
|
|
4198
4327
|
} catch (error) {
|
|
4199
4328
|
child.stdin.destroy();
|
|
@@ -4207,19 +4336,19 @@ async function withSwiftRootLock(root, work, signal) {
|
|
|
4207
4336
|
return await work(lease);
|
|
4208
4337
|
} finally {
|
|
4209
4338
|
await Promise.all(children.map((child) => terminateProcessGroup(child, "SIGKILL", 0)));
|
|
4210
|
-
(0,
|
|
4339
|
+
(0, import_node_fs6.writeFileSync)(import_node_path10.default.join(directory, name(held, "released")), "");
|
|
4211
4340
|
}
|
|
4212
4341
|
}
|
|
4213
4342
|
|
|
4214
4343
|
// src/swift-shared-sdk.ts
|
|
4215
|
-
var
|
|
4216
|
-
var
|
|
4344
|
+
var import_node_fs7 = require("node:fs");
|
|
4345
|
+
var import_node_path11 = __toESM(require("node:path"), 1);
|
|
4217
4346
|
function swiftSharedSdkRoot(moduleRoot, distribution) {
|
|
4218
|
-
return
|
|
4347
|
+
return import_node_path11.default.resolve(moduleRoot, distribution ? "sdk/ios" : "../peachsim/sdk/ios");
|
|
4219
4348
|
}
|
|
4220
4349
|
function swiftSharedSdkInputFiles(moduleRoot) {
|
|
4221
4350
|
const root = swiftSharedSdkRoot(moduleRoot, false);
|
|
4222
|
-
return (0,
|
|
4351
|
+
return (0, import_node_fs7.readdirSync)(root, { recursive: true, withFileTypes: true }).filter((entry) => entry.isFile()).map((entry) => import_node_path11.default.relative(moduleRoot, import_node_path11.default.join(entry.parentPath, entry.name))).sort();
|
|
4223
4352
|
}
|
|
4224
4353
|
|
|
4225
4354
|
// src/swiftContract.ts
|
|
@@ -4325,8 +4454,8 @@ function isSwiftResourceBundles(value) {
|
|
|
4325
4454
|
}
|
|
4326
4455
|
|
|
4327
4456
|
// src/xcode-header-search.ts
|
|
4328
|
-
var
|
|
4329
|
-
var
|
|
4457
|
+
var import_node_fs8 = __toESM(require("node:fs"), 1);
|
|
4458
|
+
var import_node_path12 = __toESM(require("node:path"), 1);
|
|
4330
4459
|
function headerMap(entries) {
|
|
4331
4460
|
const unique = /* @__PURE__ */ new Map();
|
|
4332
4461
|
for (const entry of entries)
|
|
@@ -4369,16 +4498,16 @@ function headerMap(entries) {
|
|
|
4369
4498
|
return Buffer.concat([table, ...strings]);
|
|
4370
4499
|
}
|
|
4371
4500
|
function writeXcodeHeaderSearch(directory, targets) {
|
|
4372
|
-
|
|
4501
|
+
import_node_fs8.default.mkdirSync(directory, { recursive: true });
|
|
4373
4502
|
const productDirectories = /* @__PURE__ */ new Map();
|
|
4374
4503
|
for (const target of targets)
|
|
4375
4504
|
for (const [product, file] of Object.entries(target.productHeaders)) {
|
|
4376
|
-
const listed = productDirectories.get(
|
|
4377
|
-
productDirectories.set(
|
|
4378
|
-
listed.push({ name:
|
|
4505
|
+
const listed = productDirectories.get(import_node_path12.default.dirname(product)) ?? [];
|
|
4506
|
+
productDirectories.set(import_node_path12.default.dirname(product), listed);
|
|
4507
|
+
listed.push({ name: import_node_path12.default.basename(product), file });
|
|
4379
4508
|
}
|
|
4380
|
-
const overlay =
|
|
4381
|
-
|
|
4509
|
+
const overlay = import_node_path12.default.join(directory, "all-product-headers.yaml");
|
|
4510
|
+
import_node_fs8.default.writeFileSync(
|
|
4382
4511
|
overlay,
|
|
4383
4512
|
JSON.stringify({
|
|
4384
4513
|
"case-sensitive": "false",
|
|
@@ -4397,8 +4526,8 @@ function writeXcodeHeaderSearch(directory, targets) {
|
|
|
4397
4526
|
const files = [overlay];
|
|
4398
4527
|
const flags = targets.map((target, index) => {
|
|
4399
4528
|
const maps = target.headerMaps.map((map, order) => {
|
|
4400
|
-
const file =
|
|
4401
|
-
|
|
4529
|
+
const file = import_node_path12.default.join(directory, `${index}-${order}.hmap`);
|
|
4530
|
+
import_node_fs8.default.writeFileSync(file, headerMap(map.entries));
|
|
4402
4531
|
files.push(file);
|
|
4403
4532
|
return { flag: map.flag, file };
|
|
4404
4533
|
});
|
|
@@ -4514,9 +4643,9 @@ function swiftBuilderHopTimeoutMs(compileTimeoutMs) {
|
|
|
4514
4643
|
return (compileTimeoutMs ?? SWIFT_BUILDER_DEFAULT_COMPILE_MS) + SWIFT_BUILDER_TRANSPORT_MARGIN_MS;
|
|
4515
4644
|
}
|
|
4516
4645
|
function swiftDistributionAt(root) {
|
|
4517
|
-
const file =
|
|
4518
|
-
if (!(0,
|
|
4519
|
-
return parseSwiftDistributionManifest(JSON.parse((0,
|
|
4646
|
+
const file = import_node_path13.default.join(root, SWIFT_DISTRIBUTION_MANIFEST);
|
|
4647
|
+
if (!(0, import_node_fs9.existsSync)(file)) return null;
|
|
4648
|
+
return parseSwiftDistributionManifest(JSON.parse((0, import_node_fs9.readFileSync)(file, "utf8")));
|
|
4520
4649
|
}
|
|
4521
4650
|
function swiftModuleSdk(root) {
|
|
4522
4651
|
const pin = swiftDistributionAt(root) ?? swiftSourceSdk(root);
|
|
@@ -4532,6 +4661,7 @@ function swiftModuleInputFiles(root) {
|
|
|
4532
4661
|
...swiftSharedSdkInputFiles(root),
|
|
4533
4662
|
"../peachsim/src/swift-shared-sdk.ts",
|
|
4534
4663
|
"../../scripts/generate/swift-sdk-module/darwin-mach.json",
|
|
4664
|
+
"../../scripts/ops/swift-distribution-publish.ts",
|
|
4535
4665
|
"Package.swift",
|
|
4536
4666
|
"scripts/contrast-app-Package.swift",
|
|
4537
4667
|
"scripts/build-distribution.ts",
|
|
@@ -4546,7 +4676,7 @@ function swiftModuleInputFiles(root) {
|
|
|
4546
4676
|
"toolchain.json"
|
|
4547
4677
|
];
|
|
4548
4678
|
const walk = (dir) => {
|
|
4549
|
-
for (const entry of (0,
|
|
4679
|
+
for (const entry of (0, import_node_fs9.readdirSync)(import_node_path13.default.join(root, dir), {
|
|
4550
4680
|
withFileTypes: true
|
|
4551
4681
|
})) {
|
|
4552
4682
|
const relative = `${dir}/${entry.name}`;
|
|
@@ -4564,43 +4694,43 @@ function swiftMacroPlugins(moduleRoot) {
|
|
|
4564
4694
|
const distribution = swiftDistributionAt(moduleRoot);
|
|
4565
4695
|
if (distribution)
|
|
4566
4696
|
return {
|
|
4567
|
-
libraries: distribution.plugins.filter((plugin) =>
|
|
4568
|
-
executables: distribution.plugins.filter((plugin) =>
|
|
4697
|
+
libraries: distribution.plugins.filter((plugin) => import_node_path13.default.basename(plugin) !== "ExpoModulesMacros").map((plugin) => import_node_path13.default.join(moduleRoot, plugin)),
|
|
4698
|
+
executables: distribution.plugins.filter((plugin) => import_node_path13.default.basename(plugin) === "ExpoModulesMacros").map((plugin) => import_node_path13.default.join(moduleRoot, plugin)),
|
|
4569
4699
|
stale: false
|
|
4570
4700
|
};
|
|
4571
|
-
const dir =
|
|
4701
|
+
const dir = import_node_path13.default.join(moduleRoot, ".build/host/RnxPreviewMacros");
|
|
4572
4702
|
const release = JSON.parse(
|
|
4573
|
-
(0,
|
|
4703
|
+
(0, import_node_fs9.readFileSync)(import_node_path13.default.join(moduleRoot, "toolchain.json"), "utf8")
|
|
4574
4704
|
).release;
|
|
4575
|
-
const compilerStamp =
|
|
4576
|
-
const pluginScript =
|
|
4577
|
-
const expoPlugin =
|
|
4705
|
+
const compilerStamp = import_node_path13.default.join(dir, "compiler-release");
|
|
4706
|
+
const pluginScript = import_node_path13.default.join(moduleRoot, "scripts/build-preview-plugin.sh");
|
|
4707
|
+
const expoPlugin = import_node_path13.default.join(dir, "ExpoModulesMacros");
|
|
4578
4708
|
const ext = process.platform === "darwin" ? "dylib" : "so";
|
|
4579
4709
|
const plugins = [
|
|
4580
4710
|
{
|
|
4581
|
-
library:
|
|
4582
|
-
sources: [
|
|
4711
|
+
library: import_node_path13.default.join(dir, `libRnxPreviewMacros.${ext}`),
|
|
4712
|
+
sources: [import_node_path13.default.join(moduleRoot, "Sources/RnxPreviewMacros/PreviewMacro.swift")]
|
|
4583
4713
|
},
|
|
4584
4714
|
{
|
|
4585
|
-
library:
|
|
4715
|
+
library: import_node_path13.default.join(dir, `libFoundationMacros.${ext}`),
|
|
4586
4716
|
sources: [
|
|
4587
|
-
|
|
4588
|
-
|
|
4717
|
+
import_node_path13.default.join(moduleRoot, "Sources/FoundationMacros/PredicateMacro.swift"),
|
|
4718
|
+
import_node_path13.default.join(moduleRoot, "Sources/SwiftMacroSupport/PredicateExpression.swift")
|
|
4589
4719
|
]
|
|
4590
4720
|
},
|
|
4591
4721
|
{
|
|
4592
|
-
library:
|
|
4722
|
+
library: import_node_path13.default.join(dir, `libTipKitMacros.${ext}`),
|
|
4593
4723
|
sources: [
|
|
4594
|
-
|
|
4595
|
-
|
|
4724
|
+
import_node_path13.default.join(moduleRoot, "Sources/TipKitMacros/TipKitMacros.swift"),
|
|
4725
|
+
import_node_path13.default.join(moduleRoot, "Sources/SwiftMacroSupport/PredicateExpression.swift")
|
|
4596
4726
|
]
|
|
4597
4727
|
}
|
|
4598
4728
|
];
|
|
4599
4729
|
return {
|
|
4600
4730
|
libraries: plugins.map(({ library }) => library),
|
|
4601
4731
|
executables: [expoPlugin],
|
|
4602
|
-
stale: !(0,
|
|
4603
|
-
({ library, sources }) => !(0,
|
|
4732
|
+
stale: !(0, import_node_fs9.existsSync)(compilerStamp) || !(0, import_node_fs9.existsSync)(expoPlugin) || (0, import_node_fs9.statSync)(pluginScript).mtimeMs > (0, import_node_fs9.statSync)(expoPlugin).mtimeMs || (0, import_node_fs9.readFileSync)(compilerStamp, "utf8").trim() !== release || plugins.some(
|
|
4733
|
+
({ library, sources }) => !(0, import_node_fs9.existsSync)(library) || sources.some((source) => (0, import_node_fs9.statSync)(source).mtimeMs > (0, import_node_fs9.statSync)(library).mtimeMs)
|
|
4604
4734
|
)
|
|
4605
4735
|
};
|
|
4606
4736
|
}
|
|
@@ -4610,14 +4740,14 @@ async function ensureMacroPlugins(moduleRoot, toolchainBin, release, signal) {
|
|
|
4610
4740
|
await runCompiler(
|
|
4611
4741
|
"sh",
|
|
4612
4742
|
[
|
|
4613
|
-
|
|
4743
|
+
import_node_path13.default.join(moduleRoot, "scripts/build-preview-plugin.sh"),
|
|
4614
4744
|
toolchainBin,
|
|
4615
4745
|
libraries[0]
|
|
4616
4746
|
],
|
|
4617
4747
|
{ signal }
|
|
4618
4748
|
);
|
|
4619
|
-
(0,
|
|
4620
|
-
|
|
4749
|
+
(0, import_node_fs9.writeFileSync)(
|
|
4750
|
+
import_node_path13.default.join(import_node_path13.default.dirname(libraries[0]), "compiler-release"),
|
|
4621
4751
|
`${release}
|
|
4622
4752
|
`
|
|
4623
4753
|
);
|
|
@@ -4633,7 +4763,7 @@ function swiftModuleDigest(root) {
|
|
|
4633
4763
|
const files = swiftModuleInputFiles(root);
|
|
4634
4764
|
const stampHash = (0, import_node_crypto5.createHash)("sha256");
|
|
4635
4765
|
for (const file of files) {
|
|
4636
|
-
const stat = (0,
|
|
4766
|
+
const stat = (0, import_node_fs9.statSync)(import_node_path13.default.join(root, file), { bigint: true });
|
|
4637
4767
|
stampHash.update(file);
|
|
4638
4768
|
stampHash.update(
|
|
4639
4769
|
`${stat.dev}:${stat.ino}:${stat.size}:${stat.mtimeNs}:${stat.ctimeNs}
|
|
@@ -4647,7 +4777,7 @@ function swiftModuleDigest(root) {
|
|
|
4647
4777
|
for (const file of files) {
|
|
4648
4778
|
hash.update((0, import_node_crypto5.createHash)("sha256").update(file).digest());
|
|
4649
4779
|
hash.update(
|
|
4650
|
-
(0, import_node_crypto5.createHash)("sha256").update((0,
|
|
4780
|
+
(0, import_node_crypto5.createHash)("sha256").update((0, import_node_fs9.readFileSync)(import_node_path13.default.join(root, file))).digest()
|
|
4651
4781
|
);
|
|
4652
4782
|
}
|
|
4653
4783
|
const digest = hash.digest();
|
|
@@ -4671,7 +4801,7 @@ function withNativeSourceGlue(input, glue) {
|
|
|
4671
4801
|
...input,
|
|
4672
4802
|
files: {
|
|
4673
4803
|
...input.files,
|
|
4674
|
-
[
|
|
4804
|
+
[import_node_path13.default.posix.join(targetPath, "OneNativeSource.generated.swift")]: glue
|
|
4675
4805
|
},
|
|
4676
4806
|
oneModule: true
|
|
4677
4807
|
};
|
|
@@ -4812,7 +4942,7 @@ function swiftImportNames(contents, available) {
|
|
|
4812
4942
|
function swiftPeachModules(moduleRoot) {
|
|
4813
4943
|
const distribution = swiftDistributionAt(moduleRoot);
|
|
4814
4944
|
return distribution ? distribution.modules : swiftManifestDeclarations(
|
|
4815
|
-
(0,
|
|
4945
|
+
(0, import_node_fs9.readFileSync)(import_node_path13.default.join(moduleRoot, "Package.swift"), "utf8")
|
|
4816
4946
|
).filter((target) => !target.executable && !target.path.startsWith("fixtures/")).map((target) => target.name);
|
|
4817
4947
|
}
|
|
4818
4948
|
var sdkPaths = /* @__PURE__ */ new Map();
|
|
@@ -4822,7 +4952,7 @@ function swiftSdkPaths(moduleRoot, toolchainBin) {
|
|
|
4822
4952
|
const cached = sdkPaths.get(key);
|
|
4823
4953
|
if (cached) return cached;
|
|
4824
4954
|
const configuration = (0, import_node_child_process7.execFileSync)(
|
|
4825
|
-
|
|
4955
|
+
import_node_path13.default.join(toolchainBin, "swift"),
|
|
4826
4956
|
[
|
|
4827
4957
|
"sdk",
|
|
4828
4958
|
"configure",
|
|
@@ -4847,7 +4977,7 @@ function swiftSdkPaths(moduleRoot, toolchainBin) {
|
|
|
4847
4977
|
if (!Array.isArray(toolsets) || !toolsets.every((value) => typeof value === "string"))
|
|
4848
4978
|
throw new Error(`swift sdk ${sdk} reports invalid toolset paths`);
|
|
4849
4979
|
for (const toolset of toolsets) {
|
|
4850
|
-
const config = JSON.parse((0,
|
|
4980
|
+
const config = JSON.parse((0, import_node_fs9.readFileSync)(toolset, "utf8"));
|
|
4851
4981
|
if (!config || typeof config !== "object" || !("swiftCompiler" in config)) continue;
|
|
4852
4982
|
const compiler = config.swiftCompiler;
|
|
4853
4983
|
if (!compiler || typeof compiler !== "object" || !("extraCLIOptions" in compiler))
|
|
@@ -4863,7 +4993,7 @@ function swiftSdkPaths(moduleRoot, toolchainBin) {
|
|
|
4863
4993
|
if (flag !== "-fwasm-exceptions") cFlags.push(flag);
|
|
4864
4994
|
if (flag === "-iframeworkwithsysroot" && options[index + 2] === "-Xcc" && typeof options[index + 3] === "string") {
|
|
4865
4995
|
cFlags.push(options[index + 3]);
|
|
4866
|
-
frameworks.push(
|
|
4996
|
+
frameworks.push(import_node_path13.default.join(sysroot, options[index + 3]));
|
|
4867
4997
|
index += 3;
|
|
4868
4998
|
continue;
|
|
4869
4999
|
}
|
|
@@ -4880,7 +5010,7 @@ function swiftSdkPaths(moduleRoot, toolchainBin) {
|
|
|
4880
5010
|
}
|
|
4881
5011
|
const paths = {
|
|
4882
5012
|
sysroot,
|
|
4883
|
-
darwin:
|
|
5013
|
+
darwin: import_node_path13.default.join(sysroot, "darwin"),
|
|
4884
5014
|
resources: field("swiftResourcesPath"),
|
|
4885
5015
|
frameworks,
|
|
4886
5016
|
cFlags
|
|
@@ -4896,21 +5026,21 @@ function swiftAvailableModules(moduleRoot, toolchainBin) {
|
|
|
4896
5026
|
if (cached) return cached;
|
|
4897
5027
|
const modules = new Set(swiftPeachModules(moduleRoot));
|
|
4898
5028
|
const { resources, frameworks } = swiftSdkPaths(moduleRoot, toolchainBin);
|
|
4899
|
-
for (const entry of (0,
|
|
5029
|
+
for (const entry of (0, import_node_fs9.readdirSync)(import_node_path13.default.join(resources, "wasi"))) {
|
|
4900
5030
|
if (entry.endsWith(".swiftmodule"))
|
|
4901
5031
|
modules.add(entry.slice(0, -".swiftmodule".length));
|
|
4902
5032
|
}
|
|
4903
|
-
for (const entry of (0,
|
|
4904
|
-
const map =
|
|
4905
|
-
if (!(0,
|
|
4906
|
-
for (const match of (0,
|
|
5033
|
+
for (const entry of (0, import_node_fs9.readdirSync)(resources)) {
|
|
5034
|
+
const map = import_node_path13.default.join(resources, entry, "module.modulemap");
|
|
5035
|
+
if (!(0, import_node_fs9.existsSync)(map)) continue;
|
|
5036
|
+
for (const match of (0, import_node_fs9.readFileSync)(map, "utf8").matchAll(/^module\s+([A-Za-z_]\w*)/gm))
|
|
4907
5037
|
modules.add(match[1]);
|
|
4908
5038
|
}
|
|
4909
5039
|
for (const directory of frameworks) {
|
|
4910
|
-
for (const entry of (0,
|
|
4911
|
-
const map =
|
|
4912
|
-
if (!(0,
|
|
4913
|
-
for (const match of (0,
|
|
5040
|
+
for (const entry of (0, import_node_fs9.readdirSync)(directory)) {
|
|
5041
|
+
const map = import_node_path13.default.join(directory, entry, "Modules/module.modulemap");
|
|
5042
|
+
if (!(0, import_node_fs9.existsSync)(map)) continue;
|
|
5043
|
+
for (const match of (0, import_node_fs9.readFileSync)(map, "utf8").matchAll(
|
|
4914
5044
|
/^framework\s+module\s+([A-Za-z_]\w*)/gm
|
|
4915
5045
|
))
|
|
4916
5046
|
modules.add(match[1]);
|
|
@@ -4932,6 +5062,52 @@ function missingSwiftModules(files, available, providedByFile = () => []) {
|
|
|
4932
5062
|
}
|
|
4933
5063
|
return new Map([...missing].sort(([left], [right]) => left.localeCompare(right)));
|
|
4934
5064
|
}
|
|
5065
|
+
function swiftSystemLibrarySurface(files, targets) {
|
|
5066
|
+
const modules = /* @__PURE__ */ new Set();
|
|
5067
|
+
const headers = /* @__PURE__ */ new Set();
|
|
5068
|
+
for (const target of targets) {
|
|
5069
|
+
if (!target.systemLibrary) continue;
|
|
5070
|
+
const prefix = target.path === "." ? "" : `${target.path.replace(/\/+$/, "")}/`;
|
|
5071
|
+
for (const [file, contents] of Object.entries(files)) {
|
|
5072
|
+
if (!file.startsWith(prefix) || !file.endsWith(".modulemap")) continue;
|
|
5073
|
+
for (const match of contents.matchAll(/^\s*module\s+([A-Za-z_]\w*)/gm))
|
|
5074
|
+
modules.add(match[1]);
|
|
5075
|
+
for (const match of contents.matchAll(/^\s*(?:umbrella\s+)?header\s+"([^"]+)"/gm)) {
|
|
5076
|
+
const header = files[`${prefix}${match[1]}`];
|
|
5077
|
+
if (header === void 0) continue;
|
|
5078
|
+
for (const include of header.matchAll(/#\s*(?:include|import)\s*<([^>/]+)>/g))
|
|
5079
|
+
headers.add(include[1].replace(/\.h$/, ""));
|
|
5080
|
+
}
|
|
5081
|
+
}
|
|
5082
|
+
}
|
|
5083
|
+
return { modules, headers };
|
|
5084
|
+
}
|
|
5085
|
+
function swiftSystemLibraryExclusions(files, targets, distributionModules) {
|
|
5086
|
+
const surface = swiftSystemLibrarySurface(files, targets);
|
|
5087
|
+
return new Set(
|
|
5088
|
+
distributionModules.filter(
|
|
5089
|
+
(name2) => surface.modules.has(name2) || surface.headers.has(name2)
|
|
5090
|
+
)
|
|
5091
|
+
);
|
|
5092
|
+
}
|
|
5093
|
+
function distributionModulesPath(root, moduleRoot, excluded) {
|
|
5094
|
+
const modules = import_node_path13.default.join(moduleRoot, "modules");
|
|
5095
|
+
if (!excluded || excluded.size === 0) return modules;
|
|
5096
|
+
const key = (0, import_node_crypto5.createHash)("sha256").update([...excluded].sort().join("\0")).digest("hex").slice(0, 16);
|
|
5097
|
+
const directory = import_node_path13.default.join(root, `.peach-modules-${key}`);
|
|
5098
|
+
const complete = import_node_path13.default.join(directory, ".complete");
|
|
5099
|
+
if (!(0, import_node_fs9.existsSync)(complete)) {
|
|
5100
|
+
(0, import_node_fs9.mkdirSync)(directory, { recursive: true });
|
|
5101
|
+
for (const entry of (0, import_node_fs9.readdirSync)(directory))
|
|
5102
|
+
(0, import_node_fs9.rmSync)(import_node_path13.default.join(directory, entry), { recursive: true, force: true });
|
|
5103
|
+
for (const entry of (0, import_node_fs9.readdirSync)(modules)) {
|
|
5104
|
+
if (excluded.has(entry.replace(/\.swiftmodule$/, ""))) continue;
|
|
5105
|
+
(0, import_node_fs9.symlinkSync)(import_node_path13.default.join(modules, entry), import_node_path13.default.join(directory, entry));
|
|
5106
|
+
}
|
|
5107
|
+
(0, import_node_fs9.writeFileSync)(complete, "");
|
|
5108
|
+
}
|
|
5109
|
+
return directory;
|
|
5110
|
+
}
|
|
4935
5111
|
function swiftTargetDependencies(files, targets) {
|
|
4936
5112
|
const names = /* @__PURE__ */ new Set([...OPTIONAL_FRAMEWORKS, ...targets.map((target) => target.name)]);
|
|
4937
5113
|
const siblings = /* @__PURE__ */ new Map();
|
|
@@ -4973,15 +5149,17 @@ var FOUNDATION_IMPLICIT_FLAGS = FOUNDATION_IMPLICIT_MODULES.map(
|
|
|
4973
5149
|
).join("");
|
|
4974
5150
|
var ONE_IMPLICIT_FLAGS = ', "-Xfrontend", "-import-module", "-Xfrontend", "One"';
|
|
4975
5151
|
var executableLinkFlags = (root) => ` "-Xclang-linker", "-O0",
|
|
4976
|
-
"-Xclang-linker", ${JSON.stringify(`-fuse-ld=${
|
|
5152
|
+
"-Xclang-linker", ${JSON.stringify(`-fuse-ld=${import_node_path13.default.join(root, SWIFT_AUTOLINK_LINKER)}`)},
|
|
4977
5153
|
"-Xlinker", "-z", "-Xlinker", "stack-size=8372224",
|
|
4978
5154
|
"-Xlinker", "--stack-first",
|
|
4979
5155
|
"-Xlinker", "--global-base=8372224",
|
|
4980
5156
|
"-Xlinker", "-lsetjmp",
|
|
5157
|
+
"-Xlinker", "--export-table",
|
|
5158
|
+
"-Xlinker", "--growable-table",
|
|
4981
5159
|
`;
|
|
4982
5160
|
var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
4983
|
-
var MULTI_MANIFEST_VERSION =
|
|
4984
|
-
var compilerSourceDigest = true ? "
|
|
5161
|
+
var MULTI_MANIFEST_VERSION = 50;
|
|
5162
|
+
var compilerSourceDigest = true ? "16646f92cd4ac005481518b6bb1ecd5c0e3ba5c275a17123aae4ec7e63b74548" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
|
|
4985
5163
|
function swiftArtifactHash(input, release, moduleRoot) {
|
|
4986
5164
|
const hash = (0, import_node_crypto5.createHash)("sha256");
|
|
4987
5165
|
hash.update(`swift-compile
|
|
@@ -4990,6 +5168,7 @@ ${release}
|
|
|
4990
5168
|
hash.update(compilerSourceDigest);
|
|
4991
5169
|
if (input.oneModule) hash.update("one-module\n");
|
|
4992
5170
|
hash.update(swiftModuleDigest(moduleRoot));
|
|
5171
|
+
if (input.lazyDistribution) hash.update("lazy-distribution\n");
|
|
4993
5172
|
for (const file of Object.keys(input.files).sort()) {
|
|
4994
5173
|
hash.update((0, import_node_crypto5.createHash)("sha256").update(file).digest());
|
|
4995
5174
|
hash.update((0, import_node_crypto5.createHash)("sha256").update(input.files[file]).digest());
|
|
@@ -5025,6 +5204,10 @@ ${release}
|
|
|
5025
5204
|
);
|
|
5026
5205
|
hash.update(JSON.stringify(input.nativeTargets ?? []));
|
|
5027
5206
|
hash.update(JSON.stringify(input.packageGuestImports ?? []));
|
|
5207
|
+
if (input.defaultLocalization)
|
|
5208
|
+
hash.update(`default-localization
|
|
5209
|
+
${input.defaultLocalization}
|
|
5210
|
+
`);
|
|
5028
5211
|
for (const file of Object.keys(input.packageFiles ?? {}).sort()) {
|
|
5029
5212
|
hash.update(`package-file\0${file}\0`);
|
|
5030
5213
|
hash.update((0, import_node_crypto5.createHash)("sha256").update(input.packageFiles[file]).digest());
|
|
@@ -5057,17 +5240,17 @@ ${target}
|
|
|
5057
5240
|
return hash.digest("hex");
|
|
5058
5241
|
}
|
|
5059
5242
|
function swiftCrossImportFlags(moduleRoot, distribution) {
|
|
5060
|
-
const overlayRoot =
|
|
5243
|
+
const overlayRoot = import_node_path13.default.join(
|
|
5061
5244
|
moduleRoot,
|
|
5062
5245
|
distribution ? "modules" : "cross-import-overlays"
|
|
5063
5246
|
);
|
|
5064
|
-
return (0,
|
|
5247
|
+
return (0, import_node_fs9.readdirSync)(overlayRoot, { encoding: "utf8", recursive: true }).filter((file) => file.endsWith(".swiftoverlay")).sort((left, right) => left.localeCompare(right)).flatMap((file) => [
|
|
5065
5248
|
"-Xfrontend",
|
|
5066
5249
|
"-swift-module-cross-import",
|
|
5067
5250
|
"-Xfrontend",
|
|
5068
|
-
|
|
5251
|
+
import_node_path13.default.basename(import_node_path13.default.dirname(file), ".swiftcrossimport"),
|
|
5069
5252
|
"-Xfrontend",
|
|
5070
|
-
|
|
5253
|
+
import_node_path13.default.join(overlayRoot, file)
|
|
5071
5254
|
]);
|
|
5072
5255
|
}
|
|
5073
5256
|
function withoutWasmOverlayIsystem(flags) {
|
|
@@ -5105,23 +5288,27 @@ function emitSwiftPackageManifest(args) {
|
|
|
5105
5288
|
if (spriteKit) {
|
|
5106
5289
|
for (const name2 of ["SpriteKit", "PeachBox2D", "simd", "GLKit"]) reach(name2);
|
|
5107
5290
|
}
|
|
5291
|
+
let distributionLinkPath;
|
|
5108
5292
|
const distributionLink = args.distributionLink;
|
|
5109
|
-
if (distribution && !distributionLink)
|
|
5110
|
-
throw new Error(
|
|
5111
|
-
"swift-compile: distribution linking requires its object response file"
|
|
5112
|
-
);
|
|
5113
5293
|
if (distribution && distributionLink) {
|
|
5114
5294
|
const objects = distribution.objects.filter(
|
|
5115
5295
|
(object) => [...OPTIONAL_FRAMEWORKS, "SpriteKit", "PeachBox2D"].every(
|
|
5116
5296
|
(name2) => !object.startsWith(`lib/${name2}-`) || reachedFrameworks.has(name2)
|
|
5117
5297
|
)
|
|
5118
5298
|
);
|
|
5119
|
-
|
|
5120
|
-
|
|
5121
|
-
|
|
5122
|
-
|
|
5123
|
-
|
|
5299
|
+
const quoted = (object) => `"${import_node_path13.default.join(moduleRoot, object).replaceAll("\\", "\\\\").replaceAll('"', '\\"')}"`;
|
|
5300
|
+
const roots = args.lazyDistribution ? swiftObjcRootObjects(distribution.id, moduleRoot, distribution.objects) : null;
|
|
5301
|
+
const list = (roots ? [
|
|
5302
|
+
...objects.filter((object) => roots.has(object)).map(quoted),
|
|
5303
|
+
"-Wl,--start-lib",
|
|
5304
|
+
...objects.filter((object) => !roots.has(object)).map(quoted),
|
|
5305
|
+
"-Wl,--end-lib"
|
|
5306
|
+
] : objects.map(quoted)).join("\n") + "\n";
|
|
5307
|
+
distributionLinkPath = distributionLink.path.replace(
|
|
5308
|
+
/\.rsp$/,
|
|
5309
|
+
`-${(0, import_node_crypto5.createHash)("sha256").update(list).digest("hex").slice(0, 12)}.rsp`
|
|
5124
5310
|
);
|
|
5311
|
+
distributionLink.files.set(distributionLinkPath, list);
|
|
5125
5312
|
}
|
|
5126
5313
|
const overlayFlags = swiftCrossImportFlags(moduleRoot, Boolean(distribution)).map((flag) => `, ${JSON.stringify(flag)}`).join("");
|
|
5127
5314
|
const executable = targets.find((target) => target.executable);
|
|
@@ -5133,14 +5320,16 @@ function emitSwiftPackageManifest(args) {
|
|
|
5133
5320
|
const stanza = (target) => {
|
|
5134
5321
|
const native = args.native?.get(target.name);
|
|
5135
5322
|
if (target.systemLibrary || native?.clang?.sources.length === 0)
|
|
5136
|
-
return ` .systemLibrary(name: ${JSON.stringify(target.name)}, path: ${JSON.stringify(native?.clang ?
|
|
5323
|
+
return ` .systemLibrary(name: ${JSON.stringify(target.name)}, path: ${JSON.stringify(native?.clang ? import_node_path13.default.posix.dirname(native.clang.modulemap) : target.path)}),`;
|
|
5137
5324
|
const isolation = target.mainActorIsolation ? " .defaultIsolation(MainActor.self)," : "";
|
|
5138
5325
|
const interoperability = target.cxxInterop ? " .interoperabilityMode(.Cxx)," : "";
|
|
5139
5326
|
const defines = (target.defines ?? []).map((name2) => ` .define(${JSON.stringify(name2)}),`).join("");
|
|
5140
5327
|
const features = (target.experimentalFeatures ?? []).map((name2) => ` .enableExperimentalFeature(${JSON.stringify(name2)}),`).join("");
|
|
5141
5328
|
const upcoming = (target.upcomingFeatures ?? []).map((name2) => ` .enableUpcomingFeature(${JSON.stringify(name2)}),`).join("");
|
|
5142
5329
|
const upstream = (target.swiftFlags ?? []).map((flag) => `, ${JSON.stringify(flag)}`).join("");
|
|
5143
|
-
const imports = distribution ? `, "-I", ${JSON.stringify(
|
|
5330
|
+
const imports = distribution ? `, "-I", ${JSON.stringify(
|
|
5331
|
+
distributionModulesPath(args.root, moduleRoot, args.distributionExcludes)
|
|
5332
|
+
)}` : prebuilt ? `, "-I", ${JSON.stringify(prebuilt.modules)}${prebuilt.moduleMaps.map((map) => `, "-Xcc", ${JSON.stringify(`-fmodule-map-file=${map}`)}`).join("")}` : "";
|
|
5144
5333
|
const nativeFlags = [
|
|
5145
5334
|
...args.nativeFlags?.get(target.name) ?? [],
|
|
5146
5335
|
...args.nativeHeaderFlags ?? []
|
|
@@ -5172,12 +5361,12 @@ function emitSwiftPackageManifest(args) {
|
|
|
5172
5361
|
].map((flag) => `, ${JSON.stringify(flag)}`).join("");
|
|
5173
5362
|
const header = args.headerDirectory && [...args.native?.values() ?? []].some(
|
|
5174
5363
|
(value) => value.late?.producers.includes(target.name)
|
|
5175
|
-
) ? `, "-emit-objc-header-path", ${JSON.stringify(
|
|
5364
|
+
) ? `, "-emit-objc-header-path", ${JSON.stringify(import_node_path13.default.join(args.headerDirectory, `${target.name}-Swift.h`))}` : "";
|
|
5176
5365
|
const swiftSettings = `swiftSettings: [.swiftLanguageMode(.v${target.languageMode}),${isolation}${interoperability}${defines}${features}${upcoming} .unsafeFlags(["-Osize", "-Xfrontend", "-enable-cross-import-overlays"${overlayFlags}${FOUNDATION_IMPLICIT_FLAGS}${oneModule ? ONE_IMPLICIT_FLAGS : ""}${imports}${nativeImports}${nativeImportFlags}${objcFlags}${header}${upstream}])]`;
|
|
5177
5366
|
const deps = [
|
|
5178
5367
|
.../* @__PURE__ */ new Set([
|
|
5179
5368
|
...(target.dependencies ?? []).flatMap(
|
|
5180
|
-
(dependency) => dependency.kind === "product" && !(linkedObjects && dependency.package ===
|
|
5369
|
+
(dependency) => dependency.kind === "product" && !(linkedObjects && dependency.package === import_node_path13.default.basename(moduleRoot).toLowerCase()) ? [
|
|
5181
5370
|
`.product(name: ${JSON.stringify(dependency.name)}, package: ${JSON.stringify(dependency.package)})`
|
|
5182
5371
|
] : []
|
|
5183
5372
|
),
|
|
@@ -5206,7 +5395,10 @@ function emitSwiftPackageManifest(args) {
|
|
|
5206
5395
|
)
|
|
5207
5396
|
])
|
|
5208
5397
|
].join(", ");
|
|
5209
|
-
const library = distribution
|
|
5398
|
+
const library = distribution ? [
|
|
5399
|
+
...distributionLinkPath ? ["-Xclang-linker", `--config=${distributionLinkPath}`] : [],
|
|
5400
|
+
...distribution.link
|
|
5401
|
+
].map((flag) => `, ${JSON.stringify(flag)}`).join("") : prebuilt ? ["-Xclang-linker", `--config=${prebuilt.linkFile}`, ...prebuilt.link].map((flag) => `, ${JSON.stringify(flag)}`).join("") : "";
|
|
5210
5402
|
const kind = target.executable ? ".executableTarget" : ".target";
|
|
5211
5403
|
const linkedLibraries = (target.linkedLibraries ?? []).map(
|
|
5212
5404
|
(name2) => `.linkedLibrary(${JSON.stringify(name2)})`
|
|
@@ -5245,8 +5437,8 @@ function emitSwiftPackageManifest(args) {
|
|
|
5245
5437
|
` path: ${JSON.stringify(native?.clang ? "." : target.path)},`,
|
|
5246
5438
|
...exclusions.length ? [` exclude: ${JSON.stringify(exclusions)},`] : [],
|
|
5247
5439
|
...native?.clang ? [
|
|
5248
|
-
` sources: ${JSON.stringify(native.clang.sources.map((source) =>
|
|
5249
|
-
` publicHeadersPath: ${JSON.stringify(
|
|
5440
|
+
` sources: ${JSON.stringify(native.clang.sources.map((source) => import_node_path13.default.posix.join(native.path, source)))},`,
|
|
5441
|
+
` publicHeadersPath: ${JSON.stringify(import_node_path13.default.posix.dirname(native.clang.modulemap))},`
|
|
5250
5442
|
] : native?.flags ? [` sources: ${JSON.stringify(native.sources)},`] : [],
|
|
5251
5443
|
...!native?.clang && target.publicHeadersPath !== void 0 ? [` publicHeadersPath: ${JSON.stringify(target.publicHeadersPath)},`] : [],
|
|
5252
5444
|
// the native backend supplies dependency module maps without their
|
|
@@ -5262,6 +5454,7 @@ function emitSwiftPackageManifest(args) {
|
|
|
5262
5454
|
"// generated by swift-compile from the project package partition.",
|
|
5263
5455
|
"let package = Package(",
|
|
5264
5456
|
' name: "app",',
|
|
5457
|
+
...args.defaultLocalization ? [` defaultLocalization: ${JSON.stringify(args.defaultLocalization)},`] : [],
|
|
5265
5458
|
` products: [.executable(name: "${executable.name}", targets: ["${executable.name}"])],`,
|
|
5266
5459
|
` dependencies: [${[
|
|
5267
5460
|
...linkedObjects ? [] : [`.package(path: ${JSON.stringify(moduleRoot)})`],
|
|
@@ -5289,8 +5482,8 @@ function emitSwiftPackageManifest(args) {
|
|
|
5289
5482
|
` .target(name: ${JSON.stringify(group.name)},`,
|
|
5290
5483
|
` dependencies: ${JSON.stringify(native.mixed ? [] : [name2])},`,
|
|
5291
5484
|
` path: ${JSON.stringify(native.clang || native.mixed ? "." : native.path)},`,
|
|
5292
|
-
` sources: ${JSON.stringify(native.clang || native.mixed ? group.sources.map((source) =>
|
|
5293
|
-
` publicHeadersPath: ${JSON.stringify(native.clang ?
|
|
5485
|
+
` sources: ${JSON.stringify(native.clang || native.mixed ? group.sources.map((source) => import_node_path13.default.posix.join(native.path, source)) : group.sources)},`,
|
|
5486
|
+
` publicHeadersPath: ${JSON.stringify(native.clang ? import_node_path13.default.posix.dirname(native.clang.modulemap) : native.implementationHeaders ?? "include")},`,
|
|
5294
5487
|
` cSettings: [${macroSettings(owner?.cDefines)} .unsafeFlags(${JSON.stringify([...nativeFlags, ...group.flags])})],`,
|
|
5295
5488
|
` cxxSettings: [${macroSettings(owner?.cxxDefines)} .unsafeFlags(${JSON.stringify(["-fno-cxx-modules", ...cxxFlagsFor(nativeFlags), "-I", native.includeDirectory, "-I", args.headerDirectory, ...group.cxxFlags])})]),`
|
|
5296
5489
|
]) : [];
|
|
@@ -5302,22 +5495,22 @@ function emitSwiftPackageManifest(args) {
|
|
|
5302
5495
|
].join("\n");
|
|
5303
5496
|
}
|
|
5304
5497
|
function syncSwiftTree(base, files) {
|
|
5305
|
-
(0,
|
|
5498
|
+
(0, import_node_fs9.mkdirSync)(base, { recursive: true });
|
|
5306
5499
|
const walk = (dir) => {
|
|
5307
|
-
for (const entry of (0,
|
|
5308
|
-
const full =
|
|
5309
|
-
if (dir === base && (entry.name === ".build" || entry.name === SWIFT_LINK_STAMP || entry.name === SWIFT_FRAMEWORK_KEY))
|
|
5500
|
+
for (const entry of (0, import_node_fs9.readdirSync)(dir, { withFileTypes: true })) {
|
|
5501
|
+
const full = import_node_path13.default.join(dir, entry.name);
|
|
5502
|
+
if (dir === base && (entry.name === ".build" || entry.name.startsWith(".peach-modules-") || entry.name === SWIFT_LINK_STAMP || entry.name === SWIFT_FRAMEWORK_KEY))
|
|
5310
5503
|
continue;
|
|
5311
5504
|
if (entry.isDirectory()) walk(full);
|
|
5312
|
-
else if (!files.has(full)) (0,
|
|
5505
|
+
else if (!files.has(full)) (0, import_node_fs9.rmSync)(full, { force: true });
|
|
5313
5506
|
}
|
|
5314
5507
|
};
|
|
5315
5508
|
walk(base);
|
|
5316
5509
|
for (const [full, contents] of files) {
|
|
5317
|
-
if ((0,
|
|
5510
|
+
if ((0, import_node_fs9.existsSync)(full) && (typeof contents === "string" ? (0, import_node_fs9.readFileSync)(full, "utf8") === contents : (0, import_node_fs9.readFileSync)(full).equals(contents)))
|
|
5318
5511
|
continue;
|
|
5319
|
-
(0,
|
|
5320
|
-
(0,
|
|
5512
|
+
(0, import_node_fs9.mkdirSync)(import_node_path13.default.dirname(full), { recursive: true });
|
|
5513
|
+
(0, import_node_fs9.writeFileSync)(full, contents);
|
|
5321
5514
|
}
|
|
5322
5515
|
}
|
|
5323
5516
|
var DIRECTIVE = /^[ \t]*#(?:if|elseif)\b/;
|
|
@@ -6336,11 +6529,16 @@ function swiftApplicationEntry(file, source) {
|
|
|
6336
6529
|
else if (source[at] === "}") depth--;
|
|
6337
6530
|
else if (depth === 0 && /^@(?:main|UIApplicationMain)\b/.test(source.slice(at)))
|
|
6338
6531
|
return true;
|
|
6339
|
-
else if (depth === 0 &&
|
|
6532
|
+
else if (depth === 0 && import_node_path13.default.basename(file) === "main.swift" && /^UIApplicationMain\s*\(/.test(source.slice(at)))
|
|
6340
6533
|
return true;
|
|
6341
6534
|
}
|
|
6342
6535
|
return false;
|
|
6343
6536
|
}
|
|
6537
|
+
function swiftTypedApplicationEntry(source) {
|
|
6538
|
+
const code = [...swiftConditionalLines(swiftCodeMask(source))].map(({ line, active }) => active === false ? " ".repeat(line.length) : line).join("\n");
|
|
6539
|
+
const match = /@main\b[\s\S]*?\b(?:struct|class|enum)\s+([A-Za-z_]\w*)/.exec(code);
|
|
6540
|
+
return match ? { index: match.index, name: match[1] } : null;
|
|
6541
|
+
}
|
|
6344
6542
|
function wrapUIApplicationMainEntry(source) {
|
|
6345
6543
|
const code = [...swiftConditionalLines(swiftCodeMask(source))].map(({ line, active }) => active === false ? " ".repeat(line.length) : line).join("\n");
|
|
6346
6544
|
const { tokens } = swiftCodeScan(code);
|
|
@@ -6686,33 +6884,33 @@ function swiftCodeScan(source) {
|
|
|
6686
6884
|
return { lineStarts: starts, tokens };
|
|
6687
6885
|
}
|
|
6688
6886
|
function prepareSwiftDependency(source, destination) {
|
|
6689
|
-
(0,
|
|
6887
|
+
(0, import_node_fs9.rmSync)(destination, { recursive: true, force: true });
|
|
6690
6888
|
const origins = {};
|
|
6691
6889
|
const gather = (from) => {
|
|
6692
|
-
for (const entry of (0,
|
|
6890
|
+
for (const entry of (0, import_node_fs9.readdirSync)(from, { withFileTypes: true })) {
|
|
6693
6891
|
if (entry.name === ".git" || entry.name === ".build" || entry.name === ".swiftpm")
|
|
6694
6892
|
continue;
|
|
6695
|
-
const file =
|
|
6893
|
+
const file = import_node_path13.default.join(from, entry.name);
|
|
6696
6894
|
if (entry.isDirectory()) gather(file);
|
|
6697
6895
|
else if (entry.isFile() && entry.name.endsWith(".swift"))
|
|
6698
|
-
origins[
|
|
6896
|
+
origins[import_node_path13.default.relative(source, file)] = (0, import_node_fs9.readFileSync)(file, "utf8");
|
|
6699
6897
|
}
|
|
6700
6898
|
};
|
|
6701
6899
|
gather(source);
|
|
6702
|
-
const manifest =
|
|
6703
|
-
const targets = (0,
|
|
6900
|
+
const manifest = import_node_path13.default.join(source, "Package.swift");
|
|
6901
|
+
const targets = (0, import_node_fs9.existsSync)(manifest) ? swiftManifestTargets((0, import_node_fs9.readFileSync)(manifest, "utf8")) : [];
|
|
6704
6902
|
const compiled = compiledSwiftSources(origins, targets);
|
|
6705
6903
|
const copy = (from, to) => {
|
|
6706
|
-
(0,
|
|
6707
|
-
for (const entry of (0,
|
|
6904
|
+
(0, import_node_fs9.mkdirSync)(to, { recursive: true });
|
|
6905
|
+
for (const entry of (0, import_node_fs9.readdirSync)(from, { withFileTypes: true })) {
|
|
6708
6906
|
if (entry.name === ".git" || entry.name === ".build" || entry.name === ".swiftpm")
|
|
6709
6907
|
continue;
|
|
6710
|
-
const file =
|
|
6711
|
-
const target =
|
|
6908
|
+
const file = import_node_path13.default.join(from, entry.name);
|
|
6909
|
+
const target = import_node_path13.default.join(to, entry.name);
|
|
6712
6910
|
if (entry.isDirectory()) copy(file, target);
|
|
6713
6911
|
else if (entry.isFile() && entry.name.endsWith(".swift"))
|
|
6714
|
-
(0,
|
|
6715
|
-
else (0,
|
|
6912
|
+
(0, import_node_fs9.writeFileSync)(target, compiled.get(import_node_path13.default.relative(source, file)));
|
|
6913
|
+
else (0, import_node_fs9.cpSync)(file, target, { verbatimSymlinks: true });
|
|
6716
6914
|
}
|
|
6717
6915
|
};
|
|
6718
6916
|
copy(source, destination);
|
|
@@ -6720,19 +6918,19 @@ function prepareSwiftDependency(source, destination) {
|
|
|
6720
6918
|
var HIDDEN_UNITS = "PeachHiddenUnits";
|
|
6721
6919
|
function clangImportModuleMapFlags(settings, layoutRoot, written) {
|
|
6722
6920
|
const searched = new Set(settings.headerSearchPaths);
|
|
6723
|
-
const directory =
|
|
6921
|
+
const directory = import_node_path13.default.join(layoutRoot, ".build", "peach-clang-modulemaps");
|
|
6724
6922
|
return (settings.moduleMaps ?? []).flatMap((map) => {
|
|
6725
|
-
const headers =
|
|
6726
|
-
if (!(0,
|
|
6727
|
-
const published =
|
|
6728
|
-
if (searched.has(map.headers) && (0,
|
|
6729
|
-
if (!searched.has(map.headers) && (0,
|
|
6923
|
+
const headers = import_node_path13.default.join(layoutRoot, map.headers);
|
|
6924
|
+
if (!(0, import_node_fs9.existsSync)(headers)) return [];
|
|
6925
|
+
const published = import_node_path13.default.join(headers, "module.modulemap");
|
|
6926
|
+
if (searched.has(map.headers) && (0, import_node_fs9.existsSync)(published)) return [];
|
|
6927
|
+
if (!searched.has(map.headers) && (0, import_node_fs9.existsSync)(published))
|
|
6730
6928
|
return [`-fmodule-map-file=${published}`];
|
|
6731
6929
|
const cached = written.get(headers);
|
|
6732
6930
|
if (cached) return [cached];
|
|
6733
|
-
(0,
|
|
6734
|
-
const output =
|
|
6735
|
-
(0,
|
|
6931
|
+
(0, import_node_fs9.mkdirSync)(directory, { recursive: true });
|
|
6932
|
+
const output = import_node_path13.default.join(directory, `module-${written.size}.modulemap`);
|
|
6933
|
+
(0, import_node_fs9.writeFileSync)(
|
|
6736
6934
|
output,
|
|
6737
6935
|
swiftPackageClangModuleMap(swiftTargetModuleName(map.module), {
|
|
6738
6936
|
kind: "directory",
|
|
@@ -6767,13 +6965,14 @@ function writeSwiftProject(layout, input, moduleRoot, prebuilt) {
|
|
|
6767
6965
|
const targets = distribution && compileTargets(input).length === 0 ? [
|
|
6768
6966
|
{
|
|
6769
6967
|
name: "App",
|
|
6770
|
-
path:
|
|
6968
|
+
path: import_node_path13.default.relative(layout.root, layout.sources),
|
|
6771
6969
|
executable: true,
|
|
6772
6970
|
languageMode: 5,
|
|
6773
6971
|
mainActorIsolation: false,
|
|
6774
6972
|
resources: false
|
|
6775
6973
|
}
|
|
6776
6974
|
] : compileTargets(input);
|
|
6975
|
+
const distributionExcludes = distribution ? swiftSystemLibraryExclusions(input.files, targets, distribution.modules) : void 0;
|
|
6777
6976
|
const files = /* @__PURE__ */ new Map();
|
|
6778
6977
|
const native = /* @__PURE__ */ new Map();
|
|
6779
6978
|
const targetFailures = [];
|
|
@@ -6797,18 +6996,18 @@ function writeSwiftProject(layout, input, moduleRoot, prebuilt) {
|
|
|
6797
6996
|
))
|
|
6798
6997
|
for (const name2 of clangImportNames(contents)) importedModules.add(name2);
|
|
6799
6998
|
}
|
|
6800
|
-
const headerDirectory =
|
|
6999
|
+
const headerDirectory = import_node_path13.default.join(layout.root, ".build", "peach-cxx-headers");
|
|
6801
7000
|
let checkedToolchain;
|
|
6802
7001
|
const nativeToolchain = () => {
|
|
6803
7002
|
if (checkedToolchain) return checkedToolchain;
|
|
6804
|
-
const pin = distribution ?? JSON.parse((0,
|
|
7003
|
+
const pin = distribution ?? JSON.parse((0, import_node_fs9.readFileSync)(import_node_path13.default.join(moduleRoot, "toolchain.json"), "utf8"));
|
|
6805
7004
|
checkedToolchain = swiftToolchain(pin.release, swiftModuleSdk(moduleRoot));
|
|
6806
7005
|
return checkedToolchain;
|
|
6807
7006
|
};
|
|
6808
7007
|
const deploymentTarget = (name2) => input.nativeTargets?.find((value) => value.name === name2)?.deploymentTarget ?? targets.find((value) => value.name === name2)?.iosDeploymentTarget ?? null;
|
|
6809
7008
|
const targetStagedFiles = /* @__PURE__ */ new Map();
|
|
6810
7009
|
const stageTargetFile = (target, file, contents, options) => {
|
|
6811
|
-
const relative =
|
|
7010
|
+
const relative = import_node_path13.default.relative(layout.root, file).split(import_node_path13.default.sep).join(import_node_path13.default.posix.sep);
|
|
6812
7011
|
const prior = files.has(file) ? files.get(file) : Object.hasOwn(input.files, relative) ? input.files[relative] : void 0;
|
|
6813
7012
|
if (!options?.allowExisting && prior !== void 0)
|
|
6814
7013
|
throw new Error(`target ${target} already contains generated output ${relative}`);
|
|
@@ -6837,7 +7036,7 @@ function writeSwiftProject(layout, input, moduleRoot, prebuilt) {
|
|
|
6837
7036
|
targetStagedFiles.delete(target.name);
|
|
6838
7037
|
if (entries.some(([file]) => isSwiftNativeTranslationUnit(file)) && (swift || input.nativeTargets?.some((value) => value.name === target.name))) {
|
|
6839
7038
|
if (!swift) {
|
|
6840
|
-
const unprepared =
|
|
7039
|
+
const unprepared = import_node_path13.default.join(
|
|
6841
7040
|
layout.root,
|
|
6842
7041
|
target.path,
|
|
6843
7042
|
"PeachUnprepared.generated.swift"
|
|
@@ -6852,7 +7051,7 @@ function writeSwiftProject(layout, input, moduleRoot, prebuilt) {
|
|
|
6852
7051
|
native.set(target.name, {
|
|
6853
7052
|
mixed: true,
|
|
6854
7053
|
path: target.path,
|
|
6855
|
-
includeDirectory:
|
|
7054
|
+
includeDirectory: import_node_path13.default.join(layout.root, target.path, "include"),
|
|
6856
7055
|
sources: [],
|
|
6857
7056
|
lateSources: [],
|
|
6858
7057
|
exclude: entries.filter(([file]) => !file.endsWith(".swift") && !file.endsWith(".metal")).map(([file]) => file.slice(prefix.length))
|
|
@@ -6864,27 +7063,27 @@ function writeSwiftProject(layout, input, moduleRoot, prebuilt) {
|
|
|
6864
7063
|
const contents = input.files[file];
|
|
6865
7064
|
if (contents === void 0)
|
|
6866
7065
|
throw new Error(`missing original Objective-C header ${file}`);
|
|
6867
|
-
const destination =
|
|
6868
|
-
(0,
|
|
6869
|
-
(0,
|
|
7066
|
+
const destination = import_node_path13.default.join(layout.root, file);
|
|
7067
|
+
(0, import_node_fs9.mkdirSync)(import_node_path13.default.dirname(destination), { recursive: true });
|
|
7068
|
+
(0, import_node_fs9.writeFileSync)(destination, contents);
|
|
6870
7069
|
files.set(destination, contents);
|
|
6871
7070
|
}
|
|
6872
7071
|
if (!settings.flattensPublicHeaders) continue;
|
|
6873
7072
|
for (const header of settings.publicHeaders) {
|
|
6874
|
-
const destination =
|
|
7073
|
+
const destination = import_node_path13.default.join(headerDirectory, settings.name, import_node_path13.default.basename(header));
|
|
6875
7074
|
if (files.has(destination))
|
|
6876
7075
|
throw new Error(`duplicate product header ${destination}`);
|
|
6877
|
-
const contents = `#import ${JSON.stringify(
|
|
7076
|
+
const contents = `#import ${JSON.stringify(import_node_path13.default.join(layout.root, header))}
|
|
6878
7077
|
`;
|
|
6879
7078
|
files.set(destination, contents);
|
|
6880
|
-
(0,
|
|
6881
|
-
(0,
|
|
7079
|
+
(0, import_node_fs9.mkdirSync)(import_node_path13.default.dirname(destination), { recursive: true });
|
|
7080
|
+
(0, import_node_fs9.writeFileSync)(destination, contents);
|
|
6882
7081
|
}
|
|
6883
7082
|
}
|
|
6884
7083
|
const nativeTargets = input.nativeTargets ?? [];
|
|
6885
|
-
const fromInputRoot = (file) => file.startsWith(`${SWIFT_NATIVE_INPUT_ROOT}/`) ?
|
|
7084
|
+
const fromInputRoot = (file) => file.startsWith(`${SWIFT_NATIVE_INPUT_ROOT}/`) ? import_node_path13.default.join(layout.root, file.slice(SWIFT_NATIVE_INPUT_ROOT.length + 1)) : file;
|
|
6886
7085
|
const headerSearch = writeXcodeHeaderSearch(
|
|
6887
|
-
|
|
7086
|
+
import_node_path13.default.join(layout.root, ".build", "peach-xcode-headers"),
|
|
6888
7087
|
nativeTargets.map((settings) => ({
|
|
6889
7088
|
headerMaps: settings.headerMaps.map((map) => ({
|
|
6890
7089
|
flag: map.flag,
|
|
@@ -6895,12 +7094,12 @@ function writeSwiftProject(layout, input, moduleRoot, prebuilt) {
|
|
|
6895
7094
|
})),
|
|
6896
7095
|
productHeaders: Object.fromEntries(
|
|
6897
7096
|
Object.entries(settings.productHeaders).map(([product, file]) => [
|
|
6898
|
-
|
|
6899
|
-
|
|
7097
|
+
import_node_path13.default.join(layout.root, product),
|
|
7098
|
+
import_node_path13.default.join(layout.root, file)
|
|
6900
7099
|
])
|
|
6901
7100
|
),
|
|
6902
7101
|
userHeaderSearchPaths: settings.userHeaderSearchPaths.map(
|
|
6903
|
-
(directory) =>
|
|
7102
|
+
(directory) => import_node_path13.default.join(layout.root, directory)
|
|
6904
7103
|
)
|
|
6905
7104
|
}))
|
|
6906
7105
|
);
|
|
@@ -6924,7 +7123,7 @@ function writeSwiftProject(layout, input, moduleRoot, prebuilt) {
|
|
|
6924
7123
|
if (producer && targets.some((value) => value.name === producer))
|
|
6925
7124
|
producers2.add(producer);
|
|
6926
7125
|
const local = [
|
|
6927
|
-
|
|
7126
|
+
import_node_path13.default.posix.join(import_node_path13.default.posix.dirname(file), include2),
|
|
6928
7127
|
`${includes}${include2}`
|
|
6929
7128
|
].find((candidate) => input.files[candidate] !== void 0);
|
|
6930
7129
|
if (local) {
|
|
@@ -6958,12 +7157,12 @@ function writeSwiftProject(layout, input, moduleRoot, prebuilt) {
|
|
|
6958
7157
|
const headers = settings.headers;
|
|
6959
7158
|
const roots2 = settings.bridgingHeader ? [settings.bridgingHeader] : entries.some(([file]) => file.endsWith(".swift")) || importedModules.has(swiftTargetModuleName(target.name)) ? settings.publicHeaders : [];
|
|
6960
7159
|
for (const file of headers) {
|
|
6961
|
-
const destination =
|
|
6962
|
-
(0,
|
|
6963
|
-
(0,
|
|
7160
|
+
const destination = import_node_path13.default.join(layout.root, file);
|
|
7161
|
+
(0, import_node_fs9.mkdirSync)(import_node_path13.default.dirname(destination), { recursive: true });
|
|
7162
|
+
(0, import_node_fs9.writeFileSync)(destination, input.files[file]);
|
|
6964
7163
|
}
|
|
6965
7164
|
const search = [.../* @__PURE__ */ new Set([...settings?.headerSearchPaths ?? []])].flatMap(
|
|
6966
|
-
(dir) => ["-I",
|
|
7165
|
+
(dir) => ["-I", import_node_path13.default.join(layout.root, dir)]
|
|
6967
7166
|
);
|
|
6968
7167
|
const toolchainBin = nativeToolchain();
|
|
6969
7168
|
const stageFlags = (flags2, sdkInclude2) => flags2.map(
|
|
@@ -6975,7 +7174,7 @@ function writeSwiftProject(layout, input, moduleRoot, prebuilt) {
|
|
|
6975
7174
|
...search,
|
|
6976
7175
|
...(settings?.frameworkSearchPaths ?? []).flatMap((dir) => [
|
|
6977
7176
|
"-F",
|
|
6978
|
-
|
|
7177
|
+
import_node_path13.default.join(layout.root, dir)
|
|
6979
7178
|
]),
|
|
6980
7179
|
"-I",
|
|
6981
7180
|
headerDirectory
|
|
@@ -6986,13 +7185,13 @@ function writeSwiftProject(layout, input, moduleRoot, prebuilt) {
|
|
|
6986
7185
|
const flag = settings.flags[index];
|
|
6987
7186
|
if (flag === "-I" || flag === "-iquote") {
|
|
6988
7187
|
const directory = settings.flags[index + 1];
|
|
6989
|
-
if (directory === void 0 || !
|
|
7188
|
+
if (directory === void 0 || !import_node_path13.default.isAbsolute(directory)) {
|
|
6990
7189
|
index++;
|
|
6991
7190
|
continue;
|
|
6992
7191
|
}
|
|
6993
7192
|
}
|
|
6994
7193
|
const joined = /^-(?:I|iquote)(.+)$/.exec(flag);
|
|
6995
|
-
if (joined && !
|
|
7194
|
+
if (joined && !import_node_path13.default.isAbsolute(joined[1])) continue;
|
|
6996
7195
|
kept.push(flag);
|
|
6997
7196
|
}
|
|
6998
7197
|
return [
|
|
@@ -7001,18 +7200,18 @@ function writeSwiftProject(layout, input, moduleRoot, prebuilt) {
|
|
|
7001
7200
|
...search,
|
|
7002
7201
|
...(settings?.frameworkSearchPaths ?? []).flatMap((dir) => [
|
|
7003
7202
|
"-F",
|
|
7004
|
-
|
|
7203
|
+
import_node_path13.default.join(layout.root, dir)
|
|
7005
7204
|
]),
|
|
7006
7205
|
"-I",
|
|
7007
7206
|
headerDirectory
|
|
7008
7207
|
];
|
|
7009
7208
|
})();
|
|
7010
|
-
const sdkInclude =
|
|
7209
|
+
const sdkInclude = import_node_path13.default.join(
|
|
7011
7210
|
swiftSdkPaths(moduleRoot, toolchainBin).sysroot,
|
|
7012
7211
|
"darwin/usr/include"
|
|
7013
7212
|
);
|
|
7014
7213
|
const flags = stageFlags(originalFlags, sdkInclude);
|
|
7015
|
-
const prefixHeader = settings?.prefixHeader ? ["-include",
|
|
7214
|
+
const prefixHeader = settings?.prefixHeader ? ["-include", import_node_path13.default.join(layout.root, settings.prefixHeader)] : [];
|
|
7016
7215
|
const bundleName = entries.some(([file]) => file.endsWith(".swift")) ? void 0 : swiftObjCResourceBundleName({
|
|
7017
7216
|
target: target.name,
|
|
7018
7217
|
path: target.path,
|
|
@@ -7023,7 +7222,7 @@ function writeSwiftProject(layout, input, moduleRoot, prebuilt) {
|
|
|
7023
7222
|
bundles: input.resourceBundles
|
|
7024
7223
|
});
|
|
7025
7224
|
const accessor = bundleName === void 0 ? void 0 : swiftObjCResourceAccessor(bundleName);
|
|
7026
|
-
const accessorHeader =
|
|
7225
|
+
const accessorHeader = import_node_path13.default.join(
|
|
7027
7226
|
layout.root,
|
|
7028
7227
|
target.path,
|
|
7029
7228
|
OBJC_RESOURCE_ACCESSOR_HEADER
|
|
@@ -7034,7 +7233,7 @@ function writeSwiftProject(layout, input, moduleRoot, prebuilt) {
|
|
|
7034
7233
|
const nativeUnits = accessor ? [...units, [accessorUnit, accessor.body]] : units;
|
|
7035
7234
|
const unitSource = (file) => {
|
|
7036
7235
|
const relative = file.slice(prefix.length);
|
|
7037
|
-
return relative.split("/").some((part) => part.startsWith(".")) ?
|
|
7236
|
+
return relative.split("/").some((part) => part.startsWith(".")) ? import_node_path13.default.posix.join(HIDDEN_UNITS, relative.replaceAll(/(^|\/)\./g, "$1%2E")) : relative;
|
|
7038
7237
|
};
|
|
7039
7238
|
const accessorFlags = accessor ? ["-include", accessorHeader] : [];
|
|
7040
7239
|
const nativeC = !entries.some(([file]) => file.endsWith(".swift"));
|
|
@@ -7064,20 +7263,20 @@ function writeSwiftProject(layout, input, moduleRoot, prebuilt) {
|
|
|
7064
7263
|
)
|
|
7065
7264
|
].sort();
|
|
7066
7265
|
const topHeaders = settings.publicHeaders.filter(
|
|
7067
|
-
(file) =>
|
|
7266
|
+
(file) => import_node_path13.default.posix.dirname(file) === headerDir
|
|
7068
7267
|
);
|
|
7069
7268
|
if (input.files[custom] !== void 0) {
|
|
7070
7269
|
swiftpmModuleMap = { path: custom, contents: input.files[custom] };
|
|
7071
7270
|
} else if (input.files[umbrella] !== void 0) {
|
|
7072
7271
|
if (siblingDirs.length > 0)
|
|
7073
7272
|
throw new Error(
|
|
7074
|
-
`target ${target.name} has invalid header layout: umbrella header found at '${
|
|
7273
|
+
`target ${target.name} has invalid header layout: umbrella header found at '${import_node_path13.default.join(layout.root, umbrella)}', but directories exist next to it: ${siblingDirs.map((name2) => import_node_path13.default.join(layout.root, headerDir, name2)).join(", ")}; consider removing them`
|
|
7075
7274
|
);
|
|
7076
7275
|
swiftpmModuleMap = {
|
|
7077
7276
|
path: custom,
|
|
7078
7277
|
contents: swiftPackageClangModuleMap(moduleName, {
|
|
7079
7278
|
kind: "header",
|
|
7080
|
-
path:
|
|
7279
|
+
path: import_node_path13.default.join(layout.root, umbrella)
|
|
7081
7280
|
})
|
|
7082
7281
|
};
|
|
7083
7282
|
} else if (input.files[nestedUmbrella] !== void 0 && siblingDirs.length === 1 && siblingDirs[0] === moduleName && topHeaders.length === 0) {
|
|
@@ -7085,7 +7284,7 @@ function writeSwiftProject(layout, input, moduleRoot, prebuilt) {
|
|
|
7085
7284
|
path: custom,
|
|
7086
7285
|
contents: swiftPackageClangModuleMap(moduleName, {
|
|
7087
7286
|
kind: "header",
|
|
7088
|
-
path:
|
|
7287
|
+
path: import_node_path13.default.join(layout.root, nestedUmbrella)
|
|
7089
7288
|
})
|
|
7090
7289
|
};
|
|
7091
7290
|
} else {
|
|
@@ -7093,12 +7292,12 @@ function writeSwiftProject(layout, input, moduleRoot, prebuilt) {
|
|
|
7093
7292
|
path: custom,
|
|
7094
7293
|
contents: swiftPackageClangModuleMap(moduleName, {
|
|
7095
7294
|
kind: "directory",
|
|
7096
|
-
path:
|
|
7295
|
+
path: import_node_path13.default.join(layout.root, headerDir)
|
|
7097
7296
|
})
|
|
7098
7297
|
};
|
|
7099
7298
|
}
|
|
7100
7299
|
}
|
|
7101
|
-
const modulemap = originalModuleMap?.[0] ?? swiftpmModuleMap?.path ?? packageModuleMap?.[0] ??
|
|
7300
|
+
const modulemap = originalModuleMap?.[0] ?? swiftpmModuleMap?.path ?? packageModuleMap?.[0] ?? import_node_path13.default.posix.join(
|
|
7102
7301
|
".build",
|
|
7103
7302
|
"peach-objc-originals",
|
|
7104
7303
|
target.name,
|
|
@@ -7106,41 +7305,41 @@ function writeSwiftProject(layout, input, moduleRoot, prebuilt) {
|
|
|
7106
7305
|
);
|
|
7107
7306
|
const moduleContents = originalModuleMap ? input.files[originalModuleMap[1]] : swiftpmModuleMap?.contents ?? packageModuleMap?.[1] ?? swiftObjCModuleMap(
|
|
7108
7307
|
swiftTargetModuleName(target.name),
|
|
7109
|
-
roots2.map((file) =>
|
|
7308
|
+
roots2.map((file) => import_node_path13.default.join(layout.root, file))
|
|
7110
7309
|
);
|
|
7111
7310
|
if (moduleContents === void 0)
|
|
7112
7311
|
throw new Error("missing original module map " + modulemap);
|
|
7113
|
-
stageTargetFile(target.name,
|
|
7312
|
+
stageTargetFile(target.name, import_node_path13.default.join(layout.root, modulemap), moduleContents, {
|
|
7114
7313
|
allowExisting: true
|
|
7115
7314
|
});
|
|
7116
7315
|
const importFlags = [
|
|
7117
|
-
...stageFlags(importOriginalFlags, sdkInclude),
|
|
7118
|
-
"-fmodule-map-file=" +
|
|
7316
|
+
...swiftClangImporterFlags(stageFlags(importOriginalFlags, sdkInclude)),
|
|
7317
|
+
"-fmodule-map-file=" + import_node_path13.default.join(layout.root, modulemap),
|
|
7119
7318
|
...clangImportModuleMapFlags(settings, layout.root, importModuleMaps)
|
|
7120
7319
|
];
|
|
7121
7320
|
const groups = /* @__PURE__ */ new Map();
|
|
7122
7321
|
for (const [file, contents] of nativeUnits) {
|
|
7123
7322
|
const origin = settings?.sourceDirectories[file];
|
|
7124
7323
|
if (origin) {
|
|
7125
|
-
const original =
|
|
7126
|
-
(0,
|
|
7324
|
+
const original = import_node_path13.default.join(layout.root, origin, import_node_path13.default.posix.basename(file));
|
|
7325
|
+
(0, import_node_fs9.mkdirSync)(import_node_path13.default.dirname(original), { recursive: true });
|
|
7127
7326
|
stageTargetFile(target.name, original, contents, { allowExisting: true });
|
|
7128
7327
|
}
|
|
7129
7328
|
const source = unitSource(file);
|
|
7130
7329
|
if (source !== file.slice(prefix.length))
|
|
7131
7330
|
stageTargetFile(
|
|
7132
7331
|
target.name,
|
|
7133
|
-
|
|
7332
|
+
import_node_path13.default.join(layout.root, target.path, source),
|
|
7134
7333
|
contents,
|
|
7135
7334
|
{
|
|
7136
7335
|
allowExisting: true
|
|
7137
7336
|
}
|
|
7138
7337
|
);
|
|
7139
7338
|
const perFile = [
|
|
7140
|
-
...origin ? ["-iquote",
|
|
7339
|
+
...origin ? ["-iquote", import_node_path13.default.join(layout.root, origin)] : [],
|
|
7141
7340
|
...stageFlags(
|
|
7142
7341
|
settings?.fileFlags[file] ?? [],
|
|
7143
|
-
|
|
7342
|
+
import_node_path13.default.join(
|
|
7144
7343
|
swiftSdkPaths(moduleRoot, toolchainBin).sysroot,
|
|
7145
7344
|
"darwin/usr/include"
|
|
7146
7345
|
)
|
|
@@ -7158,7 +7357,7 @@ function writeSwiftProject(layout, input, moduleRoot, prebuilt) {
|
|
|
7158
7357
|
...accessorFlags,
|
|
7159
7358
|
...stageFlags(
|
|
7160
7359
|
cxx ? settings.cxxFlags : [],
|
|
7161
|
-
|
|
7360
|
+
import_node_path13.default.join(
|
|
7162
7361
|
swiftSdkPaths(moduleRoot, toolchainBin).sysroot,
|
|
7163
7362
|
"darwin/usr/include"
|
|
7164
7363
|
)
|
|
@@ -7173,7 +7372,7 @@ function writeSwiftProject(layout, input, moduleRoot, prebuilt) {
|
|
|
7173
7372
|
stageTargetFile(target.name, accessorHeader, accessor.header);
|
|
7174
7373
|
stageTargetFile(
|
|
7175
7374
|
target.name,
|
|
7176
|
-
|
|
7375
|
+
import_node_path13.default.join(layout.root, accessorUnit),
|
|
7177
7376
|
accessor.body
|
|
7178
7377
|
);
|
|
7179
7378
|
}
|
|
@@ -7188,7 +7387,7 @@ function writeSwiftProject(layout, input, moduleRoot, prebuilt) {
|
|
|
7188
7387
|
].sort();
|
|
7189
7388
|
native.set(target.name, {
|
|
7190
7389
|
path: target.path,
|
|
7191
|
-
includeDirectory:
|
|
7390
|
+
includeDirectory: import_node_path13.default.dirname(import_node_path13.default.join(layout.root, modulemap)),
|
|
7192
7391
|
importFlags,
|
|
7193
7392
|
sources: nativeUnits.map(([file]) => unitSource(file)),
|
|
7194
7393
|
lateSources: implementations.flatMap((group) => group.sources),
|
|
@@ -7206,15 +7405,15 @@ function writeSwiftProject(layout, input, moduleRoot, prebuilt) {
|
|
|
7206
7405
|
});
|
|
7207
7406
|
continue;
|
|
7208
7407
|
}
|
|
7209
|
-
const implementationHeaders =
|
|
7408
|
+
const implementationHeaders = import_node_path13.default.posix.join(
|
|
7210
7409
|
".build",
|
|
7211
7410
|
"peach-objc-implementations",
|
|
7212
7411
|
target.name
|
|
7213
7412
|
);
|
|
7214
|
-
const include2 =
|
|
7413
|
+
const include2 = import_node_path13.default.join(layout.root, implementationHeaders);
|
|
7215
7414
|
stageTargetFile(
|
|
7216
7415
|
target.name,
|
|
7217
|
-
|
|
7416
|
+
import_node_path13.default.join(include2, "module.modulemap"),
|
|
7218
7417
|
`module ${target.name}ImplementationDeclarations { export * }
|
|
7219
7418
|
`
|
|
7220
7419
|
);
|
|
@@ -7225,7 +7424,7 @@ function writeSwiftProject(layout, input, moduleRoot, prebuilt) {
|
|
|
7225
7424
|
implementationHeaders,
|
|
7226
7425
|
importFlags,
|
|
7227
7426
|
swiftFlags: [
|
|
7228
|
-
...settings.bridgingHeader ? ["-import-objc-header",
|
|
7427
|
+
...settings.bridgingHeader ? ["-import-objc-header", import_node_path13.default.join(layout.root, settings.bridgingHeader)] : roots2.length ? ["-import-underlying-module"] : [],
|
|
7229
7428
|
...importFlags.flatMap((flag) => ["-Xcc", flag])
|
|
7230
7429
|
],
|
|
7231
7430
|
sources: nativeUnits.map(([file]) => unitSource(file)),
|
|
@@ -7255,7 +7454,7 @@ function writeSwiftProject(layout, input, moduleRoot, prebuilt) {
|
|
|
7255
7454
|
}
|
|
7256
7455
|
native.set(target.name, {
|
|
7257
7456
|
path: target.path,
|
|
7258
|
-
includeDirectory:
|
|
7457
|
+
includeDirectory: import_node_path13.default.join(layout.root, includes),
|
|
7259
7458
|
sources: units.map(([file]) => file.slice(prefix.length)),
|
|
7260
7459
|
lateSources: late.map(([file]) => file.slice(prefix.length)),
|
|
7261
7460
|
...late.length > 0 ? {
|
|
@@ -7273,7 +7472,7 @@ function writeSwiftProject(layout, input, moduleRoot, prebuilt) {
|
|
|
7273
7472
|
([file]) => file.startsWith(includes) && /\.(?:h|hpp|hh|hxx)$/.test(file) && consumers.get(file).size === 0
|
|
7274
7473
|
);
|
|
7275
7474
|
files.set(
|
|
7276
|
-
|
|
7475
|
+
import_node_path13.default.join(layout.root, includes, "module.modulemap"),
|
|
7277
7476
|
[
|
|
7278
7477
|
`module ${target.name} {`,
|
|
7279
7478
|
...roots.map(
|
|
@@ -7285,16 +7484,16 @@ function writeSwiftProject(layout, input, moduleRoot, prebuilt) {
|
|
|
7285
7484
|
].join("\n")
|
|
7286
7485
|
);
|
|
7287
7486
|
}
|
|
7288
|
-
if (native.size > 0) (0,
|
|
7487
|
+
if (native.size > 0) (0, import_node_fs9.mkdirSync)(headerDirectory, { recursive: true });
|
|
7289
7488
|
const nativeHeaderFlags = [];
|
|
7290
7489
|
for (const name2 of new Set(
|
|
7291
7490
|
[...native.values()].flatMap((value) => value.late?.producers ?? [])
|
|
7292
7491
|
)) {
|
|
7293
7492
|
files.set(
|
|
7294
|
-
|
|
7493
|
+
import_node_path13.default.join(headerDirectory, name2, name2 + "-Swift.h"),
|
|
7295
7494
|
'#include "../' + name2 + '-Swift.h"\n'
|
|
7296
7495
|
);
|
|
7297
|
-
const modulemap =
|
|
7496
|
+
const modulemap = import_node_path13.default.join(
|
|
7298
7497
|
layout.root,
|
|
7299
7498
|
".build",
|
|
7300
7499
|
"peach-objc-swift-headers",
|
|
@@ -7304,8 +7503,8 @@ function writeSwiftProject(layout, input, moduleRoot, prebuilt) {
|
|
|
7304
7503
|
files.set(
|
|
7305
7504
|
modulemap,
|
|
7306
7505
|
swiftObjCModuleMap(swiftTargetModuleName(name2), [
|
|
7307
|
-
...(input.nativeTargets?.find((target) => target.name === name2)?.publicHeaders ?? []).map((header) =>
|
|
7308
|
-
|
|
7506
|
+
...(input.nativeTargets?.find((target) => target.name === name2)?.publicHeaders ?? []).map((header) => import_node_path13.default.join(layout.root, header)),
|
|
7507
|
+
import_node_path13.default.join(headerDirectory, name2 + "-Swift.h")
|
|
7309
7508
|
])
|
|
7310
7509
|
);
|
|
7311
7510
|
nativeHeaderFlags.push("-fmodule-map-file=" + modulemap);
|
|
@@ -7314,7 +7513,7 @@ function writeSwiftProject(layout, input, moduleRoot, prebuilt) {
|
|
|
7314
7513
|
swiftModuleInputFiles(moduleRoot).join("\n")
|
|
7315
7514
|
);
|
|
7316
7515
|
if (!distribution) {
|
|
7317
|
-
modulePlan.update((0,
|
|
7516
|
+
modulePlan.update((0, import_node_fs9.readFileSync)(import_node_path13.default.join(moduleRoot, "Package.swift")));
|
|
7318
7517
|
}
|
|
7319
7518
|
const resourcePlan = (0, import_node_crypto5.createHash)("sha256").update(
|
|
7320
7519
|
JSON.stringify(
|
|
@@ -7348,22 +7547,20 @@ function writeSwiftProject(layout, input, moduleRoot, prebuilt) {
|
|
|
7348
7547
|
)
|
|
7349
7548
|
);
|
|
7350
7549
|
const mains = entries.flatMap(([file, source]) => {
|
|
7351
|
-
const
|
|
7352
|
-
|
|
7353
|
-
);
|
|
7354
|
-
return match ? [{ file, source, match }] : [];
|
|
7550
|
+
const entry = swiftTypedApplicationEntry(source);
|
|
7551
|
+
return entry ? [{ file, source, ...entry }] : [];
|
|
7355
7552
|
});
|
|
7356
7553
|
let entryFile;
|
|
7357
7554
|
let entrySource;
|
|
7358
7555
|
if (mains.length === 1) {
|
|
7359
7556
|
const main = mains[0];
|
|
7360
7557
|
entryFile = main.file;
|
|
7361
|
-
entrySource = main.source.slice(0, main.
|
|
7362
|
-
@MainActor public func __peachRunApplication() { ${main.
|
|
7558
|
+
entrySource = main.source.slice(0, main.index) + " " + main.source.slice(main.index + 5) + `
|
|
7559
|
+
@MainActor public func __peachRunApplication() { ${main.name}.main() }
|
|
7363
7560
|
`;
|
|
7364
7561
|
} else if (mains.length === 0) {
|
|
7365
7562
|
const procedural = entries.filter(
|
|
7366
|
-
([file, source]) =>
|
|
7563
|
+
([file, source]) => import_node_path13.default.basename(file) === "main.swift" && swiftApplicationEntry(file, source)
|
|
7367
7564
|
);
|
|
7368
7565
|
const wrapped = procedural.length === 1 ? wrapUIApplicationMainEntry(procedural[0][1]) : null;
|
|
7369
7566
|
if (!wrapped)
|
|
@@ -7392,7 +7589,7 @@ function writeSwiftProject(layout, input, moduleRoot, prebuilt) {
|
|
|
7392
7589
|
exclude: []
|
|
7393
7590
|
});
|
|
7394
7591
|
files.set(
|
|
7395
|
-
|
|
7592
|
+
import_node_path13.default.join(layout.root, `PeachApplication/${name2}/Entry.swift`),
|
|
7396
7593
|
`import ${swiftTargetModuleName(target.name)}
|
|
7397
7594
|
@main struct __PeachApplicationEntry { @MainActor static func main() { __peachRunApplication() } }
|
|
7398
7595
|
`
|
|
@@ -7402,7 +7599,7 @@ function writeSwiftProject(layout, input, moduleRoot, prebuilt) {
|
|
|
7402
7599
|
const nativeFlags = native.size > 0 ? /* @__PURE__ */ new Map() : void 0;
|
|
7403
7600
|
if (nativeFlags) {
|
|
7404
7601
|
const toolchainBin = nativeToolchain();
|
|
7405
|
-
const headers =
|
|
7602
|
+
const headers = import_node_path13.default.join(swiftSdkPaths(moduleRoot, toolchainBin).sysroot, "darwin");
|
|
7406
7603
|
for (const target of targets) {
|
|
7407
7604
|
const version = deploymentTarget(target.name);
|
|
7408
7605
|
const minimum = iosDeploymentMinimum(version);
|
|
@@ -7421,6 +7618,10 @@ function writeSwiftProject(layout, input, moduleRoot, prebuilt) {
|
|
|
7421
7618
|
"-fobjc-exceptions",
|
|
7422
7619
|
"-fexceptions",
|
|
7423
7620
|
"-fwasm-exceptions",
|
|
7621
|
+
// the backend lowers direct setjmp-family calls; -lsetjmp is already
|
|
7622
|
+
// linked. no-op for units without setjmp calls (byte-identical).
|
|
7623
|
+
"-mllvm",
|
|
7624
|
+
"-wasm-enable-sjlj",
|
|
7424
7625
|
"-fobjc-arc",
|
|
7425
7626
|
...intake
|
|
7426
7627
|
]);
|
|
@@ -7429,10 +7630,10 @@ function writeSwiftProject(layout, input, moduleRoot, prebuilt) {
|
|
|
7429
7630
|
if (targets.length === 0 && !prebuilt) {
|
|
7430
7631
|
for (const [file, contents] of Object.entries(input.files)) {
|
|
7431
7632
|
if (file === "Package.swift") continue;
|
|
7432
|
-
files.set(
|
|
7633
|
+
files.set(import_node_path13.default.join(layout.sources, file), compiled.get(file) ?? contents);
|
|
7433
7634
|
}
|
|
7434
|
-
let manifest = (0,
|
|
7435
|
-
|
|
7635
|
+
let manifest = (0, import_node_fs9.readFileSync)(
|
|
7636
|
+
import_node_path13.default.join(moduleRoot, "scripts/contrast-app-Package.swift"),
|
|
7436
7637
|
"utf8"
|
|
7437
7638
|
).replaceAll("__SOOTSIM_SWIFT_PACKAGE__", moduleRoot);
|
|
7438
7639
|
const reactor = ` ${REACTOR_FLAG}`;
|
|
@@ -7476,30 +7677,37 @@ function writeSwiftProject(layout, input, moduleRoot, prebuilt) {
|
|
|
7476
7677
|
manifest = manifest.replace(anchor, `${anchor}
|
|
7477
7678
|
${SPRITEKIT_PRODUCT},`);
|
|
7478
7679
|
}
|
|
7479
|
-
files.set(
|
|
7680
|
+
files.set(import_node_path13.default.join(layout.root, "Package.swift"), manifest + moduleFiles);
|
|
7480
7681
|
} else {
|
|
7481
7682
|
const base = layout.multi ? layout.root : layout.sources;
|
|
7482
7683
|
const libraries = /* @__PURE__ */ new Map();
|
|
7483
7684
|
for (const [target, data] of Object.entries(input.libraries ?? {})) {
|
|
7484
|
-
const
|
|
7485
|
-
|
|
7685
|
+
const bytes = Buffer.from(data, "base64");
|
|
7686
|
+
const digest = (0, import_node_crypto5.createHash)("sha256").update(bytes).digest("hex");
|
|
7687
|
+
const file = import_node_path13.default.join(layout.root, ".peach-libraries", `lib${target}-${digest}.a`);
|
|
7688
|
+
files.set(file, bytes);
|
|
7486
7689
|
libraries.set(target, file);
|
|
7487
7690
|
}
|
|
7488
7691
|
for (const [file, contents] of Object.entries(input.files)) {
|
|
7489
7692
|
if (file === "Package.swift") continue;
|
|
7490
|
-
files.set(
|
|
7693
|
+
files.set(import_node_path13.default.join(base, file), compiled.get(file) ?? contents);
|
|
7491
7694
|
}
|
|
7492
7695
|
const manifestTargets = targets.length > 0 ? targets : [
|
|
7493
7696
|
{
|
|
7494
7697
|
name: "App",
|
|
7495
|
-
path:
|
|
7698
|
+
path: import_node_path13.default.relative(layout.root, layout.sources).split(import_node_path13.default.sep).join("/"),
|
|
7496
7699
|
executable: true,
|
|
7497
7700
|
languageMode: 5,
|
|
7498
7701
|
mainActorIsolation: false,
|
|
7499
7702
|
resources: false
|
|
7500
7703
|
}
|
|
7501
7704
|
];
|
|
7502
|
-
const
|
|
7705
|
+
const reachesFrameworks = !distribution || Object.entries(input.files).some(
|
|
7706
|
+
([file, source]) => file.endsWith(".swift") && file !== input.entry && file !== "Package.swift" || /\.mm?$/.test(file) || source.includes("dispatch_")
|
|
7707
|
+
) || [...importedModules].some(
|
|
7708
|
+
(name2) => distribution.modules.includes(name2) && !targets.some((target) => target.name === name2)
|
|
7709
|
+
);
|
|
7710
|
+
const frameworkLink = prebuilt ? import_node_path13.default.join(layout.root, ".peach-framework-objects.rsp") : void 0;
|
|
7503
7711
|
if (prebuilt && frameworkLink) {
|
|
7504
7712
|
files.set(
|
|
7505
7713
|
frameworkLink,
|
|
@@ -7507,7 +7715,7 @@ function writeSwiftProject(layout, input, moduleRoot, prebuilt) {
|
|
|
7507
7715
|
);
|
|
7508
7716
|
}
|
|
7509
7717
|
files.set(
|
|
7510
|
-
|
|
7718
|
+
import_node_path13.default.join(layout.root, "Package.swift"),
|
|
7511
7719
|
emitSwiftPackageManifest({
|
|
7512
7720
|
root: layout.root,
|
|
7513
7721
|
targets: manifestTargets,
|
|
@@ -7535,13 +7743,17 @@ function writeSwiftProject(layout, input, moduleRoot, prebuilt) {
|
|
|
7535
7743
|
oneModule: input.oneModule,
|
|
7536
7744
|
spriteKit: importsSpriteKit(input.files),
|
|
7537
7745
|
distribution: distribution ?? void 0,
|
|
7746
|
+
distributionExcludes,
|
|
7538
7747
|
deferDarwinOverlay: native.size > 0 && toolsetOrdersLibcxxBeforeDarwinOverlay(
|
|
7539
7748
|
swiftSdkPaths(moduleRoot, nativeToolchain()).cFlags
|
|
7540
7749
|
),
|
|
7541
|
-
|
|
7542
|
-
|
|
7543
|
-
|
|
7544
|
-
|
|
7750
|
+
...reachesFrameworks ? {
|
|
7751
|
+
distributionLink: {
|
|
7752
|
+
path: import_node_path13.default.join(layout.root, ".peach-distribution-objects.rsp"),
|
|
7753
|
+
files
|
|
7754
|
+
},
|
|
7755
|
+
lazyDistribution: input.lazyDistribution
|
|
7756
|
+
} : {},
|
|
7545
7757
|
...prebuilt && frameworkLink ? {
|
|
7546
7758
|
prebuilt: {
|
|
7547
7759
|
modules: prebuilt.modules,
|
|
@@ -7550,26 +7762,27 @@ function writeSwiftProject(layout, input, moduleRoot, prebuilt) {
|
|
|
7550
7762
|
moduleMaps: prebuilt.moduleMaps
|
|
7551
7763
|
}
|
|
7552
7764
|
} : {},
|
|
7553
|
-
libraries
|
|
7765
|
+
libraries,
|
|
7766
|
+
...input.defaultLocalization ? { defaultLocalization: input.defaultLocalization } : {}
|
|
7554
7767
|
}) + moduleFiles
|
|
7555
7768
|
);
|
|
7556
7769
|
}
|
|
7557
7770
|
for (const [file, bytes] of Object.entries(input.packageFiles ?? {}))
|
|
7558
|
-
files.set(
|
|
7771
|
+
files.set(import_node_path13.default.join(layout.root, file), Buffer.from(bytes, "base64"));
|
|
7559
7772
|
for (const [file, bytes] of Object.entries(input.projectFiles ?? {})) {
|
|
7560
|
-
const destination =
|
|
7773
|
+
const destination = import_node_path13.default.join(layout.root, file);
|
|
7561
7774
|
if (files.has(destination)) continue;
|
|
7562
7775
|
files.set(destination, Buffer.from(bytes, "base64"));
|
|
7563
7776
|
}
|
|
7564
7777
|
if (input.packageFiles || prebuilt) {
|
|
7565
7778
|
files.set(
|
|
7566
|
-
|
|
7779
|
+
import_node_path13.default.join(layout.root, ".peach-target-toolset.json"),
|
|
7567
7780
|
JSON.stringify({
|
|
7568
7781
|
schemaVersion: "1.0",
|
|
7569
7782
|
swiftCompiler: {
|
|
7570
7783
|
extraCLIOptions: [
|
|
7571
7784
|
"-I",
|
|
7572
|
-
distribution ?
|
|
7785
|
+
distribution ? distributionModulesPath(layout.root, moduleRoot, distributionExcludes) : prebuilt ? prebuilt.modules : import_node_path13.default.join(layout.root, ".build", WASM_TRIPLE, "release", "Modules"),
|
|
7573
7786
|
...prebuilt?.moduleMaps.flatMap((map) => [
|
|
7574
7787
|
"-Xcc",
|
|
7575
7788
|
`-fmodule-map-file=${map}`
|
|
@@ -7598,9 +7811,9 @@ function writeSwiftProject(layout, input, moduleRoot, prebuilt) {
|
|
|
7598
7811
|
throw new Error(
|
|
7599
7812
|
`swift resource target ${target.name} has no matching bundle assignment`
|
|
7600
7813
|
);
|
|
7601
|
-
const directory = layout.multi ?
|
|
7814
|
+
const directory = layout.multi ? import_node_path13.default.join(layout.root, target.path) : layout.sources;
|
|
7602
7815
|
files.set(
|
|
7603
|
-
|
|
7816
|
+
import_node_path13.default.join(directory, "ResourceBundleAccessor.generated.swift"),
|
|
7604
7817
|
[
|
|
7605
7818
|
"import Foundation",
|
|
7606
7819
|
"",
|
|
@@ -7617,7 +7830,7 @@ function writeSwiftProject(layout, input, moduleRoot, prebuilt) {
|
|
|
7617
7830
|
}
|
|
7618
7831
|
for (const [file, source] of compiled)
|
|
7619
7832
|
if (!Object.hasOwn(input.files, file))
|
|
7620
|
-
files.set(
|
|
7833
|
+
files.set(import_node_path13.default.join(layout.multi ? layout.root : layout.sources, file), source);
|
|
7621
7834
|
syncSwiftTree(layout.root, files);
|
|
7622
7835
|
const producers = [
|
|
7623
7836
|
.../* @__PURE__ */ new Set([...[...native.values()].flatMap((value) => value.late?.producers ?? [])])
|
|
@@ -7652,15 +7865,15 @@ function outputOf(error) {
|
|
|
7652
7865
|
return error instanceof Error ? error.message : String(error);
|
|
7653
7866
|
}
|
|
7654
7867
|
function builtArtifact(layout) {
|
|
7655
|
-
const binDir =
|
|
7656
|
-
const manifest = (0,
|
|
7868
|
+
const binDir = import_node_path13.default.join(layout.root, ".build", WASM_TRIPLE, "release");
|
|
7869
|
+
const manifest = (0, import_node_fs9.readFileSync)(import_node_path13.default.join(layout.root, "Package.swift"), "utf8");
|
|
7657
7870
|
const executable = swiftManifestTargets(manifest).find((target) => target.executable);
|
|
7658
7871
|
if (executable === void 0) {
|
|
7659
7872
|
throw new Error("swift-compile: the written manifest names no executable target");
|
|
7660
7873
|
}
|
|
7661
|
-
const file =
|
|
7662
|
-
if (!(0,
|
|
7663
|
-
const found = (0,
|
|
7874
|
+
const file = import_node_path13.default.join(binDir, `${executable.name}.wasm`);
|
|
7875
|
+
if (!(0, import_node_fs9.existsSync)(file)) {
|
|
7876
|
+
const found = (0, import_node_fs9.existsSync)(binDir) ? (0, import_node_fs9.readdirSync)(binDir).filter((name2) => name2.endsWith(".wasm")).sort() : [];
|
|
7664
7877
|
throw new Error(
|
|
7665
7878
|
`swift-compile: the build produced no ${executable.name}.wasm (found: ${found.join(", ") || "none"})`
|
|
7666
7879
|
);
|
|
@@ -7669,7 +7882,7 @@ function builtArtifact(layout) {
|
|
|
7669
7882
|
}
|
|
7670
7883
|
function projectDiagnostic(output, layout, files) {
|
|
7671
7884
|
const base = layout.multi ? layout.root : layout.sources;
|
|
7672
|
-
const prefix = `${base}${
|
|
7885
|
+
const prefix = `${base}${import_node_path13.default.sep}`;
|
|
7673
7886
|
return designTimeDiagnostic(output, files).split("\n").filter((line) => !SWIFTPM_NOISE.test(line)).map((line) => line.startsWith(prefix) ? line.slice(prefix.length) : line).join("\n").trim();
|
|
7674
7887
|
}
|
|
7675
7888
|
var ROOT_LOCKS = Symbol.for("peachsim.swiftCompile.rootLocks");
|
|
@@ -7705,12 +7918,12 @@ function serialize(root, work, signal) {
|
|
|
7705
7918
|
function readCompiledArtifact(directory, hash) {
|
|
7706
7919
|
try {
|
|
7707
7920
|
const receipt = JSON.parse(
|
|
7708
|
-
(0,
|
|
7921
|
+
(0, import_node_fs9.readFileSync)(import_node_path13.default.join(directory, "artifact.json"), "utf8")
|
|
7709
7922
|
);
|
|
7710
7923
|
if (!receipt || typeof receipt !== "object" || !("hash" in receipt) || receipt.hash !== hash || !("icu" in receipt) || typeof receipt.icu !== "string" || !("wasm" in receipt) || typeof receipt.wasm !== "string")
|
|
7711
7924
|
return null;
|
|
7712
|
-
const bytes = (0,
|
|
7713
|
-
const gzip2 = (0,
|
|
7925
|
+
const bytes = (0, import_node_fs9.readFileSync)(import_node_path13.default.join(directory, "app.wasm"));
|
|
7926
|
+
const gzip2 = (0, import_node_fs9.readFileSync)(import_node_path13.default.join(directory, "icu.gz"));
|
|
7714
7927
|
if ((0, import_node_crypto5.createHash)("sha256").update(bytes).digest("hex") !== receipt.wasm || (0, import_node_crypto5.createHash)("sha256").update(gzip2).digest("hex") !== receipt.icu || bytes.length < 8 || bytes.readUInt32LE(0) !== 1836278016 || bytes.readUInt32LE(4) !== 1)
|
|
7715
7928
|
return null;
|
|
7716
7929
|
return { hash, bytes, icu: { sha256: receipt.icu, gzip: gzip2 } };
|
|
@@ -7721,14 +7934,14 @@ function readCompiledArtifact(directory, hash) {
|
|
|
7721
7934
|
}
|
|
7722
7935
|
}
|
|
7723
7936
|
function saveCompiledArtifact(root, artifact) {
|
|
7724
|
-
const directory =
|
|
7725
|
-
(0,
|
|
7726
|
-
const pending = (0,
|
|
7937
|
+
const directory = import_node_path13.default.join(root, "artifact");
|
|
7938
|
+
(0, import_node_fs9.mkdirSync)(directory, { recursive: true });
|
|
7939
|
+
const pending = (0, import_node_fs9.mkdtempSync)(import_node_path13.default.join(root, ".artifact-"));
|
|
7727
7940
|
try {
|
|
7728
|
-
(0,
|
|
7729
|
-
(0,
|
|
7730
|
-
(0,
|
|
7731
|
-
|
|
7941
|
+
(0, import_node_fs9.writeFileSync)(import_node_path13.default.join(pending, "app.wasm"), artifact.bytes);
|
|
7942
|
+
(0, import_node_fs9.writeFileSync)(import_node_path13.default.join(pending, "icu.gz"), artifact.icu.gzip);
|
|
7943
|
+
(0, import_node_fs9.writeFileSync)(
|
|
7944
|
+
import_node_path13.default.join(pending, "artifact.json"),
|
|
7732
7945
|
JSON.stringify({
|
|
7733
7946
|
hash: artifact.hash,
|
|
7734
7947
|
wasm: (0, import_node_crypto5.createHash)("sha256").update(artifact.bytes).digest("hex"),
|
|
@@ -7736,10 +7949,10 @@ function saveCompiledArtifact(root, artifact) {
|
|
|
7736
7949
|
})
|
|
7737
7950
|
);
|
|
7738
7951
|
for (const file of ["app.wasm", "icu.gz", "artifact.json"]) {
|
|
7739
|
-
(0,
|
|
7952
|
+
(0, import_node_fs9.renameSync)(import_node_path13.default.join(pending, file), import_node_path13.default.join(directory, file));
|
|
7740
7953
|
}
|
|
7741
7954
|
} finally {
|
|
7742
|
-
(0,
|
|
7955
|
+
(0, import_node_fs9.rmSync)(pending, { recursive: true, force: true });
|
|
7743
7956
|
}
|
|
7744
7957
|
}
|
|
7745
7958
|
var SHARED_ARTIFACT_BUDGET_BYTES = 4 * 1024 ** 3;
|
|
@@ -7750,29 +7963,29 @@ function vanished(error) {
|
|
|
7750
7963
|
}
|
|
7751
7964
|
function renewSharedArtifact(sharedRoot) {
|
|
7752
7965
|
try {
|
|
7753
|
-
(0,
|
|
7966
|
+
(0, import_node_fs9.utimesSync)(sharedRoot, /* @__PURE__ */ new Date(), /* @__PURE__ */ new Date());
|
|
7754
7967
|
} catch (error) {
|
|
7755
7968
|
if (!vanished(error)) throw error;
|
|
7756
7969
|
}
|
|
7757
7970
|
}
|
|
7758
7971
|
function pruneSharedArtifacts(parent, keep) {
|
|
7759
7972
|
const entries = [];
|
|
7760
|
-
for (const name2 of (0,
|
|
7761
|
-
const directory =
|
|
7973
|
+
for (const name2 of (0, import_node_fs9.readdirSync)(parent)) {
|
|
7974
|
+
const directory = import_node_path13.default.join(parent, name2);
|
|
7762
7975
|
if (name2.startsWith(RETIRED_PREFIX)) {
|
|
7763
|
-
(0,
|
|
7976
|
+
(0, import_node_fs9.rmSync)(directory, { recursive: true, force: true });
|
|
7764
7977
|
continue;
|
|
7765
7978
|
}
|
|
7766
7979
|
try {
|
|
7767
7980
|
let bytes = 0;
|
|
7768
|
-
for (const file of (0,
|
|
7981
|
+
for (const file of (0, import_node_fs9.readdirSync)(import_node_path13.default.join(directory, "artifact"))) {
|
|
7769
7982
|
try {
|
|
7770
|
-
bytes += (0,
|
|
7983
|
+
bytes += (0, import_node_fs9.statSync)(import_node_path13.default.join(directory, "artifact", file)).size;
|
|
7771
7984
|
} catch (error) {
|
|
7772
7985
|
if (!vanished(error)) throw error;
|
|
7773
7986
|
}
|
|
7774
7987
|
}
|
|
7775
|
-
entries.push({ directory, used: (0,
|
|
7988
|
+
entries.push({ directory, used: (0, import_node_fs9.statSync)(directory).mtimeMs, bytes });
|
|
7776
7989
|
} catch (error) {
|
|
7777
7990
|
if (!vanished(error)) throw error;
|
|
7778
7991
|
}
|
|
@@ -7782,25 +7995,25 @@ function pruneSharedArtifacts(parent, keep) {
|
|
|
7782
7995
|
if (total <= SHARED_ARTIFACT_BUDGET_BYTES) break;
|
|
7783
7996
|
if (entry.directory === keep || Date.now() - entry.used < SHARED_ARTIFACT_GRACE_MS)
|
|
7784
7997
|
continue;
|
|
7785
|
-
const retired =
|
|
7998
|
+
const retired = import_node_path13.default.join(
|
|
7786
7999
|
parent,
|
|
7787
|
-
`${RETIRED_PREFIX}${process.pid}-${
|
|
8000
|
+
`${RETIRED_PREFIX}${process.pid}-${import_node_path13.default.basename(entry.directory)}`
|
|
7788
8001
|
);
|
|
7789
8002
|
try {
|
|
7790
|
-
if ((0,
|
|
7791
|
-
(0,
|
|
8003
|
+
if ((0, import_node_fs9.statSync)(entry.directory).mtimeMs !== entry.used) continue;
|
|
8004
|
+
(0, import_node_fs9.renameSync)(entry.directory, retired);
|
|
7792
8005
|
} catch (error) {
|
|
7793
8006
|
if (vanished(error)) continue;
|
|
7794
8007
|
throw error;
|
|
7795
8008
|
}
|
|
7796
|
-
(0,
|
|
8009
|
+
(0, import_node_fs9.rmSync)(retired, { recursive: true, force: true });
|
|
7797
8010
|
total -= entry.bytes;
|
|
7798
8011
|
}
|
|
7799
8012
|
}
|
|
7800
8013
|
function saveSharedArtifact(sharedRoot, artifact) {
|
|
7801
8014
|
saveCompiledArtifact(sharedRoot, artifact);
|
|
7802
8015
|
renewSharedArtifact(sharedRoot);
|
|
7803
|
-
pruneSharedArtifacts(
|
|
8016
|
+
pruneSharedArtifacts(import_node_path13.default.dirname(sharedRoot), sharedRoot);
|
|
7804
8017
|
}
|
|
7805
8018
|
var retainedArtifacts = /* @__PURE__ */ new Map();
|
|
7806
8019
|
function retain(root, artifact) {
|
|
@@ -7828,7 +8041,7 @@ function frameworkLibraryTargets(manifest) {
|
|
|
7828
8041
|
}
|
|
7829
8042
|
function linkedFrameworkTargets(moduleRoot, input) {
|
|
7830
8043
|
const libraries = frameworkLibraryTargets(
|
|
7831
|
-
(0,
|
|
8044
|
+
(0, import_node_fs9.readFileSync)(import_node_path13.default.join(moduleRoot, "Package.swift"), "utf8")
|
|
7832
8045
|
);
|
|
7833
8046
|
const targets = compileTargets(input);
|
|
7834
8047
|
const planning = targets.length > 0 ? targets : [{ name: "App", path: "." }];
|
|
@@ -7869,7 +8082,7 @@ function linkedFrameworkTargets(moduleRoot, input) {
|
|
|
7869
8082
|
return { products: linked, targets: linkedMembers };
|
|
7870
8083
|
}
|
|
7871
8084
|
function writeFrameworkLinkPackage(linkRoot, moduleRoot, products) {
|
|
7872
|
-
const identity =
|
|
8085
|
+
const identity = import_node_path13.default.basename(moduleRoot).toLowerCase();
|
|
7873
8086
|
const swiftString = (value) => `"${value.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`;
|
|
7874
8087
|
const dependencies = products.map(
|
|
7875
8088
|
(name2) => ` .product(name: ${swiftString(name2)}, package: ${swiftString(identity)}),`
|
|
@@ -7891,13 +8104,13 @@ ${dependencies}
|
|
|
7891
8104
|
]
|
|
7892
8105
|
)
|
|
7893
8106
|
`;
|
|
7894
|
-
const sourceDir =
|
|
7895
|
-
(0,
|
|
7896
|
-
const manifestPath =
|
|
7897
|
-
if (!(0,
|
|
7898
|
-
(0,
|
|
7899
|
-
const source =
|
|
7900
|
-
if (!(0,
|
|
8107
|
+
const sourceDir = import_node_path13.default.join(linkRoot, "Sources", FRAMEWORK_LINK_TARGET);
|
|
8108
|
+
(0, import_node_fs9.mkdirSync)(sourceDir, { recursive: true });
|
|
8109
|
+
const manifestPath = import_node_path13.default.join(linkRoot, "Package.swift");
|
|
8110
|
+
if (!(0, import_node_fs9.existsSync)(manifestPath) || (0, import_node_fs9.readFileSync)(manifestPath, "utf8") !== manifest)
|
|
8111
|
+
(0, import_node_fs9.writeFileSync)(manifestPath, manifest);
|
|
8112
|
+
const source = import_node_path13.default.join(sourceDir, "Link.swift");
|
|
8113
|
+
if (!(0, import_node_fs9.existsSync)(source)) (0, import_node_fs9.writeFileSync)(source, "");
|
|
7901
8114
|
}
|
|
7902
8115
|
function frameworkLinkClosure(scratch2, roots) {
|
|
7903
8116
|
const suffix = `${WASM_TRIPLE}-release`;
|
|
@@ -7908,7 +8121,7 @@ function frameworkLinkClosure(scratch2, roots) {
|
|
|
7908
8121
|
const moduleMaps = /* @__PURE__ */ new Map();
|
|
7909
8122
|
let pending = null;
|
|
7910
8123
|
let compiling = null;
|
|
7911
|
-
for (const line of (0,
|
|
8124
|
+
for (const line of (0, import_node_fs9.readFileSync)(import_node_path13.default.join(scratch2, "release.yaml"), "utf8").split(
|
|
7912
8125
|
"\n"
|
|
7913
8126
|
)) {
|
|
7914
8127
|
const phony = phonyHeader.exec(line);
|
|
@@ -7967,7 +8180,7 @@ function frameworkLinkClosure(scratch2, roots) {
|
|
|
7967
8180
|
for (const file of own) {
|
|
7968
8181
|
if (seen.has(file)) continue;
|
|
7969
8182
|
seen.add(file);
|
|
7970
|
-
if (!(0,
|
|
8183
|
+
if (!(0, import_node_fs9.existsSync)(file))
|
|
7971
8184
|
throw new Error(`swift-compile: framework object ${file} was not built`);
|
|
7972
8185
|
files.push(file);
|
|
7973
8186
|
}
|
|
@@ -7977,19 +8190,19 @@ function frameworkLinkClosure(scratch2, roots) {
|
|
|
7977
8190
|
return { objects: files, modules, moduleMaps: [...maps].sort() };
|
|
7978
8191
|
}
|
|
7979
8192
|
function removeUnbuiltModuleArtifacts(modulesDir, keep) {
|
|
7980
|
-
if (!(0,
|
|
7981
|
-
for (const name2 of (0,
|
|
8193
|
+
if (!(0, import_node_fs9.existsSync)(modulesDir)) return;
|
|
8194
|
+
for (const name2 of (0, import_node_fs9.readdirSync)(modulesDir)) {
|
|
7982
8195
|
const dot = name2.indexOf(".");
|
|
7983
8196
|
if (dot <= 0) continue;
|
|
7984
8197
|
if (keep.has(name2.slice(0, dot))) continue;
|
|
7985
|
-
(0,
|
|
8198
|
+
(0, import_node_fs9.rmSync)(import_node_path13.default.join(modulesDir, name2), { recursive: true, force: true });
|
|
7986
8199
|
}
|
|
7987
8200
|
}
|
|
7988
8201
|
async function compileFrameworkProducts(args) {
|
|
7989
8202
|
const scratch2 = swiftFrameworkScratch(args.appRoot);
|
|
7990
|
-
(0,
|
|
8203
|
+
(0, import_node_fs9.mkdirSync)(scratch2, { recursive: true });
|
|
7991
8204
|
const linkedTargets = linkedFrameworkTargets(args.moduleRoot, args.input);
|
|
7992
|
-
const linkRoot =
|
|
8205
|
+
const linkRoot = import_node_path13.default.join(scratch2, "link");
|
|
7993
8206
|
writeFrameworkLinkPackage(linkRoot, args.moduleRoot, linkedTargets.products);
|
|
7994
8207
|
await runCompiler(
|
|
7995
8208
|
args.swift,
|
|
@@ -8034,21 +8247,28 @@ async function compileFrameworkProducts(args) {
|
|
|
8034
8247
|
SWIFTPM_PROGRESS,
|
|
8035
8248
|
SWIFTPM_NOISE
|
|
8036
8249
|
);
|
|
8037
|
-
const release =
|
|
8250
|
+
const release = import_node_path13.default.join(scratch2, WASM_TRIPLE, "release");
|
|
8038
8251
|
const linked = frameworkLinkClosure(scratch2, linkedTargets.targets);
|
|
8039
8252
|
const objects = linked.objects;
|
|
8040
|
-
removeUnbuiltModuleArtifacts(
|
|
8041
|
-
const response =
|
|
8042
|
-
(0,
|
|
8253
|
+
removeUnbuiltModuleArtifacts(import_node_path13.default.join(release, "Modules"), linked.modules);
|
|
8254
|
+
const response = import_node_path13.default.join(scratch2, "autolink-objects.rsp");
|
|
8255
|
+
(0, import_node_fs9.writeFileSync)(response, objects.map((file) => JSON.stringify(file)).join("\n") + "\n");
|
|
8043
8256
|
const extracted = await runCompiler(
|
|
8044
|
-
|
|
8257
|
+
import_node_path13.default.join(args.toolchainBin, "swift-autolink-extract"),
|
|
8045
8258
|
[`@${response}`, "-o", "-"],
|
|
8046
8259
|
args.buildOptions
|
|
8047
8260
|
);
|
|
8048
|
-
(0,
|
|
8261
|
+
(0, import_node_fs9.rmSync)(response, { force: true });
|
|
8049
8262
|
const link = extracted.split("\n").map((line) => line.trim()).filter((flag, index, all) => flag.length > 0 && all.indexOf(flag) === index);
|
|
8263
|
+
if (link.includes("-lFoundation"))
|
|
8264
|
+
objects.push(
|
|
8265
|
+
import_node_path13.default.join(
|
|
8266
|
+
swiftSdkPaths(args.moduleRoot, args.toolchainBin).resources,
|
|
8267
|
+
"wasi/NSStringFormatting.objc.o"
|
|
8268
|
+
)
|
|
8269
|
+
);
|
|
8050
8270
|
return {
|
|
8051
|
-
modules:
|
|
8271
|
+
modules: import_node_path13.default.join(release, "Modules"),
|
|
8052
8272
|
objects,
|
|
8053
8273
|
link,
|
|
8054
8274
|
moduleMaps: linked.moduleMaps
|
|
@@ -8057,7 +8277,7 @@ async function compileFrameworkProducts(args) {
|
|
|
8057
8277
|
var SWIFT_LINK_STAMP = ".peach-link-stamp";
|
|
8058
8278
|
var SWIFT_FRAMEWORK_KEY = ".peach-framework-key";
|
|
8059
8279
|
function swiftFrameworkScratch(appRoot) {
|
|
8060
|
-
return
|
|
8280
|
+
return import_node_path13.default.join(import_node_path13.default.dirname(appRoot), `${import_node_path13.default.basename(appRoot)}.packages`);
|
|
8061
8281
|
}
|
|
8062
8282
|
function swiftLinkStamp(args) {
|
|
8063
8283
|
const hash = (0, import_node_crypto5.createHash)("sha256");
|
|
@@ -8066,7 +8286,7 @@ ${args.frameworkKey}
|
|
|
8066
8286
|
`);
|
|
8067
8287
|
if (!args.prebuilt) return hash.digest("hex");
|
|
8068
8288
|
const statOf = (file) => {
|
|
8069
|
-
const stat = (0,
|
|
8289
|
+
const stat = (0, import_node_fs9.statSync)(file, { bigint: true });
|
|
8070
8290
|
return `${stat.size}:${stat.mtimeNs}`;
|
|
8071
8291
|
};
|
|
8072
8292
|
for (const object of args.prebuilt.objects)
|
|
@@ -8083,54 +8303,54 @@ ${args.prebuilt.link.join("\n")}
|
|
|
8083
8303
|
hash.update(`modules
|
|
8084
8304
|
${args.prebuilt.modules}
|
|
8085
8305
|
`);
|
|
8086
|
-
for (const entry of (0,
|
|
8306
|
+
for (const entry of (0, import_node_fs9.readdirSync)(args.prebuilt.modules).sort())
|
|
8087
8307
|
hash.update(`${entry}
|
|
8088
|
-
${statOf(
|
|
8308
|
+
${statOf(import_node_path13.default.join(args.prebuilt.modules, entry))}`);
|
|
8089
8309
|
return hash.digest("hex");
|
|
8090
8310
|
}
|
|
8091
8311
|
function retireStaleSwiftFrameworks(root, key) {
|
|
8092
|
-
const receipt =
|
|
8312
|
+
const receipt = import_node_path13.default.join(root, SWIFT_FRAMEWORK_KEY);
|
|
8093
8313
|
let previous = null;
|
|
8094
8314
|
try {
|
|
8095
|
-
previous = (0,
|
|
8315
|
+
previous = (0, import_node_fs9.readFileSync)(receipt, "utf8").trim();
|
|
8096
8316
|
} catch (error) {
|
|
8097
8317
|
if (!vanished(error)) throw error;
|
|
8098
8318
|
}
|
|
8099
|
-
(0,
|
|
8319
|
+
(0, import_node_fs9.writeFileSync)(receipt, `${key}
|
|
8100
8320
|
`);
|
|
8101
8321
|
const scratch2 = swiftFrameworkScratch(root);
|
|
8102
|
-
if (previous === key || !(0,
|
|
8103
|
-
(0,
|
|
8322
|
+
if (previous === key || !(0, import_node_fs9.existsSync)(scratch2)) return false;
|
|
8323
|
+
(0, import_node_fs9.rmSync)(scratch2, { recursive: true, force: true });
|
|
8104
8324
|
return true;
|
|
8105
8325
|
}
|
|
8106
8326
|
function retireStaleSwiftLink(root, stamp) {
|
|
8107
|
-
const receipt =
|
|
8327
|
+
const receipt = import_node_path13.default.join(root, SWIFT_LINK_STAMP);
|
|
8108
8328
|
let previous = null;
|
|
8109
8329
|
try {
|
|
8110
|
-
previous = (0,
|
|
8330
|
+
previous = (0, import_node_fs9.readFileSync)(receipt, "utf8").trim();
|
|
8111
8331
|
} catch (error) {
|
|
8112
8332
|
if (!vanished(error)) throw error;
|
|
8113
8333
|
}
|
|
8114
|
-
(0,
|
|
8334
|
+
(0, import_node_fs9.writeFileSync)(receipt, `${stamp}
|
|
8115
8335
|
`);
|
|
8116
|
-
const retired =
|
|
8117
|
-
if (previous === stamp || !(0,
|
|
8118
|
-
(0,
|
|
8336
|
+
const retired = import_node_path13.default.join(root, ".build");
|
|
8337
|
+
if (previous === stamp || !(0, import_node_fs9.existsSync)(retired)) return false;
|
|
8338
|
+
(0, import_node_fs9.rmSync)(retired, { recursive: true, force: true });
|
|
8119
8339
|
return true;
|
|
8120
8340
|
}
|
|
8121
8341
|
function compileSwiftProjectUnit(input, options) {
|
|
8122
8342
|
options.signal?.throwIfAborted();
|
|
8123
|
-
(0,
|
|
8124
|
-
const root = (0,
|
|
8125
|
-
const moduleRoot =
|
|
8343
|
+
(0, import_node_fs9.mkdirSync)(options.buildRoot, { recursive: true });
|
|
8344
|
+
const root = (0, import_node_fs9.realpathSync)(options.buildRoot);
|
|
8345
|
+
const moduleRoot = import_node_path13.default.resolve(options.moduleRoot);
|
|
8126
8346
|
const layout = {
|
|
8127
8347
|
root,
|
|
8128
|
-
sources:
|
|
8348
|
+
sources: import_node_path13.default.join(root, "Sources", "App"),
|
|
8129
8349
|
multi: compileTargets(input).length > 0
|
|
8130
8350
|
};
|
|
8131
8351
|
const hash = swiftArtifactHash(input, options.release, moduleRoot);
|
|
8132
8352
|
const frameworkKey = swiftProjectBuildKey(moduleRoot, options.release);
|
|
8133
|
-
const sharedRoot =
|
|
8353
|
+
const sharedRoot = import_node_path13.default.join(swiftCacheDir(), "swift-projects", hash);
|
|
8134
8354
|
const report = (message) => {
|
|
8135
8355
|
console.error(`[swift-project ${hash.slice(0, 16)}] ${message}`);
|
|
8136
8356
|
options.onStage?.(message);
|
|
@@ -8144,8 +8364,8 @@ function compileSwiftProjectUnit(input, options) {
|
|
|
8144
8364
|
report("reusing memory artifact");
|
|
8145
8365
|
return retain(root, retained);
|
|
8146
8366
|
}
|
|
8147
|
-
const cached = readCompiledArtifact(
|
|
8148
|
-
const previous = cached ?? readCompiledArtifact(
|
|
8367
|
+
const cached = readCompiledArtifact(import_node_path13.default.join(sharedRoot, "artifact"), hash);
|
|
8368
|
+
const previous = cached ?? readCompiledArtifact(import_node_path13.default.join(root, "artifact"), hash);
|
|
8149
8369
|
if (previous) {
|
|
8150
8370
|
if (cached) renewSharedArtifact(sharedRoot);
|
|
8151
8371
|
else saveSharedArtifact(sharedRoot, previous);
|
|
@@ -8153,10 +8373,10 @@ function compileSwiftProjectUnit(input, options) {
|
|
|
8153
8373
|
return retain(root, previous);
|
|
8154
8374
|
}
|
|
8155
8375
|
if (process.platform === "darwin" && process.env.TM_SESSION && !admittedMacBuilderSlot() && process.env.CI !== "true" && moduleRoot === sourceSwiftCheckout() && !swiftDistributionAt(moduleRoot)) {
|
|
8156
|
-
const requestRoot = (0,
|
|
8157
|
-
const output =
|
|
8158
|
-
const request =
|
|
8159
|
-
(0,
|
|
8376
|
+
const requestRoot = (0, import_node_fs9.mkdtempSync)(`${root}.builder-request-`);
|
|
8377
|
+
const output = import_node_path13.default.join(requestRoot, "output");
|
|
8378
|
+
const request = import_node_path13.default.join(requestRoot, "request.json");
|
|
8379
|
+
(0, import_node_fs9.writeFileSync)(
|
|
8160
8380
|
request,
|
|
8161
8381
|
JSON.stringify({
|
|
8162
8382
|
input,
|
|
@@ -8169,12 +8389,12 @@ function compileSwiftProjectUnit(input, options) {
|
|
|
8169
8389
|
})
|
|
8170
8390
|
);
|
|
8171
8391
|
try {
|
|
8172
|
-
const repo =
|
|
8392
|
+
const repo = import_node_path13.default.resolve(moduleRoot, "../..");
|
|
8173
8393
|
report("requesting builder admission or cached result");
|
|
8174
8394
|
await runCompiler(
|
|
8175
8395
|
"bun",
|
|
8176
8396
|
[
|
|
8177
|
-
|
|
8397
|
+
import_node_path13.default.join(repo, "scripts/build/swift-project.ts"),
|
|
8178
8398
|
"--request",
|
|
8179
8399
|
request,
|
|
8180
8400
|
"--output",
|
|
@@ -8202,19 +8422,19 @@ function compileSwiftProjectUnit(input, options) {
|
|
|
8202
8422
|
report("builder artifact verified");
|
|
8203
8423
|
return retain(root, artifact);
|
|
8204
8424
|
} finally {
|
|
8205
|
-
(0,
|
|
8425
|
+
(0, import_node_fs9.rmSync)(requestRoot, { recursive: true, force: true });
|
|
8206
8426
|
}
|
|
8207
8427
|
}
|
|
8208
8428
|
return withSwiftRootLock(
|
|
8209
8429
|
root,
|
|
8210
8430
|
async (lease) => {
|
|
8211
|
-
const built = readCompiledArtifact(
|
|
8431
|
+
const built = readCompiledArtifact(import_node_path13.default.join(sharedRoot, "artifact"), hash);
|
|
8212
8432
|
if (built) {
|
|
8213
8433
|
report("reusing verified disk artifact");
|
|
8214
8434
|
return retain(root, built);
|
|
8215
8435
|
}
|
|
8216
|
-
const swift =
|
|
8217
|
-
if (!(0,
|
|
8436
|
+
const swift = import_node_path13.default.join(options.toolchainBin, "swift");
|
|
8437
|
+
if (!(0, import_node_fs9.existsSync)(swift)) {
|
|
8218
8438
|
throw new Error(
|
|
8219
8439
|
`swift-compile: no swift.org toolchain at ${options.toolchainBin}; install ${options.release} and its matching wasm sdk`
|
|
8220
8440
|
);
|
|
@@ -8236,8 +8456,8 @@ function compileSwiftProjectUnit(input, options) {
|
|
|
8236
8456
|
// shipped host plugins resolve against the selected compiler's runtime.
|
|
8237
8457
|
...process.platform === "linux" ? {
|
|
8238
8458
|
LD_LIBRARY_PATH: [
|
|
8239
|
-
|
|
8240
|
-
|
|
8459
|
+
import_node_path13.default.resolve(options.toolchainBin, "../lib/swift/linux"),
|
|
8460
|
+
import_node_path13.default.resolve(options.toolchainBin, "../lib/swift/host"),
|
|
8241
8461
|
process.env.LD_LIBRARY_PATH
|
|
8242
8462
|
].filter(Boolean).join(":")
|
|
8243
8463
|
} : {}
|
|
@@ -8286,7 +8506,7 @@ function compileSwiftProjectUnit(input, options) {
|
|
|
8286
8506
|
...swiftSdkOptions(),
|
|
8287
8507
|
"--swift-sdk",
|
|
8288
8508
|
sdk,
|
|
8289
|
-
...input.packageFiles || prebuilt ? ["--toolset",
|
|
8509
|
+
...input.packageFiles || prebuilt ? ["--toolset", import_node_path13.default.join(root, ".peach-target-toolset.json")] : [],
|
|
8290
8510
|
"-c",
|
|
8291
8511
|
"release",
|
|
8292
8512
|
"-Xswiftc",
|
|
@@ -8328,15 +8548,15 @@ function compileSwiftProjectUnit(input, options) {
|
|
|
8328
8548
|
);
|
|
8329
8549
|
} catch (error) {
|
|
8330
8550
|
const output = outputOf(error);
|
|
8331
|
-
const moduleCache =
|
|
8551
|
+
const moduleCache = import_node_path13.default.join(
|
|
8332
8552
|
root,
|
|
8333
8553
|
".build",
|
|
8334
8554
|
WASM_TRIPLE,
|
|
8335
8555
|
"release",
|
|
8336
8556
|
"ModuleCache"
|
|
8337
8557
|
);
|
|
8338
|
-
if (output.includes("was compiled with module cache path") && (0,
|
|
8339
|
-
(0,
|
|
8558
|
+
if (output.includes("was compiled with module cache path") && (0, import_node_fs9.existsSync)(moduleCache)) {
|
|
8559
|
+
(0, import_node_fs9.rmSync)(moduleCache, { recursive: true, force: true });
|
|
8340
8560
|
try {
|
|
8341
8561
|
await runCompiler(
|
|
8342
8562
|
swift,
|
|
@@ -8366,7 +8586,7 @@ function compileSwiftProjectUnit(input, options) {
|
|
|
8366
8586
|
if (unprepared.length) throw new Error(unprepared.join("\n"));
|
|
8367
8587
|
const artifact = {
|
|
8368
8588
|
hash,
|
|
8369
|
-
bytes: (0,
|
|
8589
|
+
bytes: (0, import_node_fs9.readFileSync)(builtArtifact(layout)),
|
|
8370
8590
|
icu: await icu
|
|
8371
8591
|
};
|
|
8372
8592
|
saveCompiledArtifact(root, artifact);
|
|
@@ -8414,7 +8634,10 @@ function compileSwiftProjectUnit(input, options) {
|
|
|
8414
8634
|
swiftSdkPaths,
|
|
8415
8635
|
swiftSourceAsIOS,
|
|
8416
8636
|
swiftSourceClosure,
|
|
8637
|
+
swiftSystemLibraryExclusions,
|
|
8638
|
+
swiftSystemLibrarySurface,
|
|
8417
8639
|
swiftTargetDependencies,
|
|
8640
|
+
swiftTypedApplicationEntry,
|
|
8418
8641
|
syncSwiftTree,
|
|
8419
8642
|
withNativeSourceGlue,
|
|
8420
8643
|
wrapUIApplicationMainEntry,
|