peachsim 0.1.2224 → 0.1.2225
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/internal-child.ts +4 -2
- 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 +858 -451
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +1 -1
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +1 -1
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +795 -388
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +853 -446
- package/dist-lib/host/fetch-proxy-handler.cjs +54 -11
- 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 +59 -15
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/jump-to-source-native.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +59 -15
- package/dist-lib/native-app-identity-project.cjs +53 -9
- package/dist-lib/native-app-identity-project.mjs +84 -37
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +1 -1
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +1 -1
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +26 -24
- package/dist-lib/public-origins-lib.json +65 -54
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/reap-browser.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +901 -494
- package/dist-lib/swift-compile.cjs +491 -119
- package/dist-lib/swift-compile.mjs +629 -257
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +1 -1
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +1 -1
- package/dist-lib/swift-toolchain.cjs +38 -2
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +1654 -1206
- package/dist-lib/vite.cjs +54 -11
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/engine/scene-table.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/preview/preview-room-contract.d.ts +6 -0
- package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +12 -0
- package/kotlin/sdk.tar.gz +0 -0
- package/package.json +1 -1
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCGTypes.h +0 -6
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/NSCharacterSet.h +1 -1
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/NSURL.h +1 -1
- package/sdk/ios/usr/include/AvailabilityInternal.h +2 -2
- package/sdk/ios/usr/include/peach/pthread.h +1 -7
- package/sdk/ios/wasm/include/TargetConditionals.h +2 -3
- package/sdk/ios/wasm/include/__struct_timeval.h +15 -0
- package/sdk/ios/wasm/include/__typedef_suseconds_t.h +9 -0
- package/sdk/ios/wasm/include/limits.h +1 -1
- package/sdk/ios/wasm/include/machine/_types.h +1 -1
- package/sdk/ios/wasm/include/machine/limits.h +1 -1
- package/sdk/ios/wasm/include/machine/param.h +2 -2
- package/sdk/ios/wasm/include/math.h +13 -0
- package/sdk/ios/wasm/include/pthread.h +1 -13
- package/sdk/ios/wasm/include/sys/resource.h +3 -0
- package/sdk/ios/wasm/include/sys/socket.h +0 -10
- package/sdk/ios/wasm/include/sys/stat.h +5 -2
- package/sdk/ios/wasm/include/sys/time.h +16 -3
- package/sdk/ios/wasm/include/sys/types.h +4 -1
- package/sdk/ios/wasm/include/time.h +2 -0
- package/sdk/ios/wasm/storage-include/TargetConditionals.h +2 -3
- package/sdk/native-hashes.json +14 -14
- package/src/native-slices.ts +3 -2
- package/src/native-static-libraries.ts +23 -23
- package/src/native-swift-slices.ts +2 -2
- package/src/nitro-adapter.lock.json +288 -288
- package/src/nitro-compiler-digest.ts +0 -1
- package/src/nitro-dependencies.ts +8 -9
- package/src/nitro-superset.lock.json +4 -4
- package/src/react-native-core-build.ts +2 -2
- package/src/swift-compile.ts +132 -45
- package/src/swift-compiler-digest.ts +2 -0
- package/src/swift-cxx-standin.ts +1 -1
- package/src/swift-darwin-records.ts +4 -4
- package/src/swift-distribution-contract.ts +2 -2
- package/src/swift-distribution.lock.json +13 -12
- package/src/swift-guest-compile.ts +6 -5
- package/src/swift-guest-image-ledger.ts +5 -5
- package/src/swift-guest-link.ts +1 -1
- package/src/swift-guest-linked-spans.ts +7 -4
- package/src/swift-guest-manifest.ts +2 -2
- package/src/swift-guest-source-inputs.ts +16 -5
- package/src/swift-host.ts +10 -5
- package/src/swift-icu.ts +1 -1
- package/src/swift-objc-compile.ts +9 -4
- package/src/swift-objc-standin.ts +1 -4
- package/src/swift-package-manifest.ts +5 -1
- package/src/swift-packages.ts +2 -2
- package/src/swift-shared-sdk.ts +1 -1
- package/src/swift-standin-emit.ts +2 -16
- package/src/swift-standins.ts +111 -87
- package/src/swift-toolchain.ts +37 -1
- package/src/swift-uniform-type-constants.ts +1 -1
- package/src/swift-wasm-prune.ts +17 -12
- package/src/swiftGuestImageContract.ts +4 -4
- package/src/swiftNativePinContract.ts +1 -1
- package/src/swiftRuntimeProductContract.ts +1 -1
- package/src/turbo-runtime.lock.json +28 -28
- package/src/wasm-narrow-boundary.ts +296 -0
- package/src/wasm-optimize.ts +59 -14
- package/src/xcode-project.ts +6 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2225 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -39,7 +39,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
39
39
|
var define_SWIFT_COVERAGE_SOURCE_DIGESTS_default;
|
|
40
40
|
var init_define_SWIFT_COVERAGE_SOURCE_DIGESTS = __esm({
|
|
41
41
|
"<define:__SWIFT_COVERAGE_SOURCE_DIGESTS__>"() {
|
|
42
|
-
define_SWIFT_COVERAGE_SOURCE_DIGESTS_default = { "swift-coverage/indexdump.ts": "0d82d8eeb96bf377f409ea7e33274c341a710c0e071f6b6e17571a23d8d92412", "swift-coverage/indexing.ts": "633ccf19eec1f382a8847d0ee1dca42a2792a3c60aafd43622ed5152b09b8272", "swift-coverage/types.ts": "bd8fae54ea6c53e110cd8a5d7b57c1d532dd0166e09fdaea63c4f270c3780dd1", "swift-coverage/source.ts": "c151758a9f67631bc61473c375df0dc017da6902a34533b2cf4fc4fd7d19b6ee", "swift-coverage/package.ts": "1f0068be7461fa7c5a7a891faf318f305cbed2e94c19667ba76627f7e5be260b", "swift-coverage/xcode.ts": "65a500b806ce1c3a496de27f2e0ad77287c0f6795c618342c08af647f92af1fa", "swift-coverage/xcode-assets.ts": "d98d6294b359528f7733b26db6f80f554782354faa235605f9562be4ad98b8a3", "swift-coverage/xcode-asset-symbols.ts": "1b2a67733bc9d139b351466270205452a6172140bc25080d72619e2952c44671", "swift-coverage/xcode-bridging.ts": "33184be8c5daf6646aa5a1276a4e15531f1be27b7c26f56550e0fbb1fc678a11", "swift-coverage/xcode-packages.ts": "8e6020d17d24474150a5a50d042aca6261819ef75c79680a287a66f395909915", "swift-coverage/xcode-strings.ts": "f2dd4c7cd8ef77035184b0132909c2fa09fd20ed06b7757c2f1f960bfdde031c", "swift-coverage/reader.ts": "da559b67ecd1161dea70c980b5f98f2c55af3550f0714479100fa5e9e813625c", "swift-coverage/provenance.ts": "eb3b41ae8b58b48f6758f084800f188dfb1edb227e483abdd6b80cde66e849b9", "swift-package-manifest.ts": "
|
|
42
|
+
define_SWIFT_COVERAGE_SOURCE_DIGESTS_default = { "swift-coverage/indexdump.ts": "0d82d8eeb96bf377f409ea7e33274c341a710c0e071f6b6e17571a23d8d92412", "swift-coverage/indexing.ts": "633ccf19eec1f382a8847d0ee1dca42a2792a3c60aafd43622ed5152b09b8272", "swift-coverage/types.ts": "bd8fae54ea6c53e110cd8a5d7b57c1d532dd0166e09fdaea63c4f270c3780dd1", "swift-coverage/source.ts": "c151758a9f67631bc61473c375df0dc017da6902a34533b2cf4fc4fd7d19b6ee", "swift-coverage/package.ts": "1f0068be7461fa7c5a7a891faf318f305cbed2e94c19667ba76627f7e5be260b", "swift-coverage/xcode.ts": "65a500b806ce1c3a496de27f2e0ad77287c0f6795c618342c08af647f92af1fa", "swift-coverage/xcode-assets.ts": "d98d6294b359528f7733b26db6f80f554782354faa235605f9562be4ad98b8a3", "swift-coverage/xcode-asset-symbols.ts": "1b2a67733bc9d139b351466270205452a6172140bc25080d72619e2952c44671", "swift-coverage/xcode-bridging.ts": "33184be8c5daf6646aa5a1276a4e15531f1be27b7c26f56550e0fbb1fc678a11", "swift-coverage/xcode-packages.ts": "8e6020d17d24474150a5a50d042aca6261819ef75c79680a287a66f395909915", "swift-coverage/xcode-strings.ts": "f2dd4c7cd8ef77035184b0132909c2fa09fd20ed06b7757c2f1f960bfdde031c", "swift-coverage/reader.ts": "da559b67ecd1161dea70c980b5f98f2c55af3550f0714479100fa5e9e813625c", "swift-coverage/provenance.ts": "eb3b41ae8b58b48f6758f084800f188dfb1edb227e483abdd6b80cde66e849b9", "swift-package-manifest.ts": "bfde06f157f52d3dd76577b3c6059c95c0393180b054ced773624ea89558992b", "swift-package.ts": "338cfef9a34a930206ac2e1a8a90b85c8d61f776d9a41e6445dc18e0c5385cdb", "swift-source-file.ts": "93fd659ed63a27b67f54a7c229a7ceb636dc9c59e68414920ba36cff1eda1f94", "swift-toolchain.ts": "8deef5a824ed49209458a4b398cd8e88df260a0c8f1894d568279f6211866547", "home-paths.ts": "d1606390f0e8e50f0ff72544eadb3d49dfabf08e004c1218f2998c36fb8995dd", "xcode-header-search.ts": "f8c3d557b4eca5ddad32907545353eb7ad53b2ebd0969d9ed8f7275e109a13b1", "xcode-project.ts": "40ec039e7a2920e6b4e7610986eb3ba75c5811eed4ea41570c2a7e2424911721", "xcode-target-members.ts": "d49af77a690cff481b38333b5f63f6600123b1bb57f410b0adb298b010d2047b", "xcode-json-project.ts": "41990ebbe4b488eef34e74c4608b4b48e5a5b299ba98ca7fbcfdfa0e77be63b6", "openstep-plist.ts": "74e6ce1dac80c9c318e0e9f5e3e8cd19a898a8820c36fc160609695bcb59dcd3" };
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
45
|
|
|
@@ -869,7 +869,7 @@ function glogSources() {
|
|
|
869
869
|
for (const unit2 of GLOG_UNITS) sources.push(read(unit2));
|
|
870
870
|
return sources;
|
|
871
871
|
}
|
|
872
|
-
var import_node_child_process2, import_node_crypto2, import_node_fs5, import_node_path5, import_node_util2, run2,
|
|
872
|
+
var import_node_child_process2, import_node_crypto2, import_node_fs5, import_node_path5, import_node_util2, run2, DOUBLE_CONVERSION_WASM64_BACKPORT, RN_SHARED_DEPENDENCIES, RN_FMT_11_DEPENDENCIES, RN_FAST_FLOAT_6_DEPENDENCIES, RN_FMT_12_DEPENDENCIES, HEADER, GLOG, GLOG_SUBSTITUTIONS, GLOG_CONFIGURE, GLOG_CONFIG_APPENDIX, GLOG_UNITS;
|
|
873
873
|
var init_nitro_dependencies = __esm({
|
|
874
874
|
"src/nitro-dependencies.ts"() {
|
|
875
875
|
"use strict";
|
|
@@ -885,12 +885,12 @@ var init_nitro_dependencies = __esm({
|
|
|
885
885
|
init_swift_source_file();
|
|
886
886
|
init_swift_submit();
|
|
887
887
|
run2 = (0, import_node_util2.promisify)(import_node_child_process2.execFile);
|
|
888
|
-
|
|
888
|
+
DOUBLE_CONVERSION_WASM64_BACKPORT = {
|
|
889
889
|
upstreamCommit: "8857767d5b2f5a035321e3712e8cd0008840ba6b",
|
|
890
890
|
originalSha256: "b495b11f7b61693486894f747add5b454894b8b3ca41aa1610d370ba16407ab7",
|
|
891
|
-
derivedSha256: "
|
|
891
|
+
derivedSha256: "d8e40c283479c1d8682646a65a869ed42c68b6dc3fb27e502aed5291d7dd223c",
|
|
892
892
|
before: " defined(__AARCH64EL__)\n",
|
|
893
|
-
after: " defined(__AARCH64EL__) || defined(
|
|
893
|
+
after: " defined(__AARCH64EL__) || defined(__wasm64__)\n"
|
|
894
894
|
};
|
|
895
895
|
RN_SHARED_DEPENDENCIES = [
|
|
896
896
|
{
|
|
@@ -917,7 +917,7 @@ var init_nitro_dependencies = __esm({
|
|
|
917
917
|
prefix: "double-conversion-1.1.6",
|
|
918
918
|
headers: { from: "src", to: "double-conversion" },
|
|
919
919
|
files: /\.(?:h|cc)$/,
|
|
920
|
-
backport: { file: "src/utils.h", ...
|
|
920
|
+
backport: { file: "src/utils.h", ...DOUBLE_CONVERSION_WASM64_BACKPORT }
|
|
921
921
|
},
|
|
922
922
|
{
|
|
923
923
|
name: "fast_float",
|
|
@@ -1030,7 +1030,7 @@ var init_nitro_dependencies = __esm({
|
|
|
1030
1030
|
PACKAGE_TARNAME: '"glog"',
|
|
1031
1031
|
PACKAGE_URL: '""',
|
|
1032
1032
|
PACKAGE_VERSION: '"0.3.5"',
|
|
1033
|
-
SIZEOF_VOID_P: "
|
|
1033
|
+
SIZEOF_VOID_P: "8",
|
|
1034
1034
|
STDC_HEADERS: "1",
|
|
1035
1035
|
STL_NAMESPACE: "std",
|
|
1036
1036
|
TEST_SRC_DIR: '"."',
|
|
@@ -3885,7 +3885,7 @@ function parseOpenStepPlist(text6) {
|
|
|
3885
3885
|
} else return;
|
|
3886
3886
|
}
|
|
3887
3887
|
};
|
|
3888
|
-
const
|
|
3888
|
+
const quoted2 = () => {
|
|
3889
3889
|
i++;
|
|
3890
3890
|
let out = "";
|
|
3891
3891
|
for (; ; ) {
|
|
@@ -3943,7 +3943,7 @@ function parseOpenStepPlist(text6) {
|
|
|
3943
3943
|
else if (text6[i] !== ")") fail("expected , or )");
|
|
3944
3944
|
}
|
|
3945
3945
|
}
|
|
3946
|
-
if (ch === '"') return
|
|
3946
|
+
if (ch === '"') return quoted2();
|
|
3947
3947
|
const start = i;
|
|
3948
3948
|
while (i < text6.length && /[A-Za-z0-9_$+/:.\-<>]/.test(text6[i])) i++;
|
|
3949
3949
|
if (i === start) fail(`unexpected ${JSON.stringify(ch ?? "end of file")}`);
|
|
@@ -8210,7 +8210,7 @@ function validateSwiftSdkIdentity(sdk) {
|
|
|
8210
8210
|
function swiftSdkBundle(swift, id, options) {
|
|
8211
8211
|
const configuration = (0, import_node_child_process13.execFileSync)(
|
|
8212
8212
|
swift,
|
|
8213
|
-
["sdk", "configure", ...options, "--show-configuration", id, "
|
|
8213
|
+
["sdk", "configure", ...options, "--show-configuration", id, "wasm64-unknown-wasip1"],
|
|
8214
8214
|
{ encoding: "utf8", env: swiftEnvironment(), stdio: ["ignore", "pipe", "pipe"] }
|
|
8215
8215
|
);
|
|
8216
8216
|
const sysroot = /^sdkRootPath: (.+)$/m.exec(configuration)?.[1]?.trim();
|
|
@@ -8553,6 +8553,42 @@ var init_swift_toolchain = __esm({
|
|
|
8553
8553
|
SWIFT_HOST_COMPILER_RELEASE = "swift-6.4.0-RELEASE-custom-81b2c791c27276bf";
|
|
8554
8554
|
SWIFT_HOST_COMPILER_ID = "81b2c791c27276bf";
|
|
8555
8555
|
compilerArchives = {
|
|
8556
|
+
"swift-6.4.0-RELEASE-custom-fb42d2535739dfd2": {
|
|
8557
|
+
identity: "fb42d2535739dfd2",
|
|
8558
|
+
archive: "tar.zst",
|
|
8559
|
+
hosts: {
|
|
8560
|
+
"darwin-arm64": {
|
|
8561
|
+
checksum: "5e417d415ca74a435755e298a1d2d19ec47637fd03479de7a7d958eb382941f1",
|
|
8562
|
+
manifest: "eb5a0356aebabe89c7b2780f8809e13d6e2ad6f342fed87cf99f9a5834344363"
|
|
8563
|
+
},
|
|
8564
|
+
"linux-arm64": {
|
|
8565
|
+
checksum: "8ac7ad97f3d68bf485423001d1ce3cd92a8d4625313c47c8071867a9aeed3af9",
|
|
8566
|
+
manifest: "6126266dd65b43c43d719e4dc4d33c4ea6a3267f99f34e3638637439a995af2e"
|
|
8567
|
+
},
|
|
8568
|
+
"linux-x64": {
|
|
8569
|
+
checksum: "7d76463079619ba822123d250601bd35f6744ed5f8054a657ce472ce4dac76c8",
|
|
8570
|
+
manifest: "f1a6c0c61d15eddb2ecfa4c3a72a5154621881ac2f0c413162ff1d0f4343bd0e"
|
|
8571
|
+
}
|
|
8572
|
+
}
|
|
8573
|
+
},
|
|
8574
|
+
"swift-6.4.0-RELEASE-custom-44ecd25f163bb359": {
|
|
8575
|
+
identity: "44ecd25f163bb359",
|
|
8576
|
+
archive: "tar.zst",
|
|
8577
|
+
hosts: {
|
|
8578
|
+
"darwin-arm64": {
|
|
8579
|
+
checksum: "d06dda4435f99d8376179cc7a3804907aa7305513135ece6288fd8e6d4695ae6",
|
|
8580
|
+
manifest: "bc0d8b955f923f096dda2aa8bbb1d56176a73f3d4a4df4cc9a1f59d31417061a"
|
|
8581
|
+
},
|
|
8582
|
+
"linux-x64": {
|
|
8583
|
+
checksum: "f95b56440693c5de7995f10ea14c57fc7e659a161018a17f17a74b61a98e88a4",
|
|
8584
|
+
manifest: "c18a60b14d5c89a8b2e1dbb2b4b52342c5fb92c7f3069fdc55c985bce61683a7"
|
|
8585
|
+
},
|
|
8586
|
+
"linux-arm64": {
|
|
8587
|
+
checksum: "afb74ae60df2b5bd7792bfbcf29bcea03675a5c814b758dd6cb91a760c220cd2",
|
|
8588
|
+
manifest: "ac037f6b0fdc4a6ae582eebc22bcf811fa2becdc30d083057137fc857f3c456a"
|
|
8589
|
+
}
|
|
8590
|
+
}
|
|
8591
|
+
},
|
|
8556
8592
|
"swift-6.4.0-RELEASE-custom-11345d60dca47496": {
|
|
8557
8593
|
identity: "11345d60dca47496",
|
|
8558
8594
|
archive: "tar.zst",
|
|
@@ -10090,8 +10126,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
10090
10126
|
for (const member of members2) {
|
|
10091
10127
|
if (raw2 && (leaf(member) === "rawValue" || leaf(member) === "init(rawValue:)" || leaf(member) === "init(_:)" || synthesizedEquality(member, list2)))
|
|
10092
10128
|
continue;
|
|
10093
|
-
const
|
|
10094
|
-
const value = header2 === void 0 ? void 0 : atWidth(header2, raw2);
|
|
10129
|
+
const value = values.get(member.identifier.precise);
|
|
10095
10130
|
if (value !== void 0 && member.kind.identifier === "swift.type.property") {
|
|
10096
10131
|
emit(
|
|
10097
10132
|
`${inner}public static let ${tick(leaf(member))} = ${shape.name}(rawValue: ${value})`
|
|
@@ -10137,8 +10172,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
10137
10172
|
);
|
|
10138
10173
|
const seenValues = /* @__PURE__ */ new Map();
|
|
10139
10174
|
for (const member of cases) {
|
|
10140
|
-
const
|
|
10141
|
-
const value = header2 === void 0 ? void 0 : atWidth(header2, raw2);
|
|
10175
|
+
const value = values.get(member.identifier.precise);
|
|
10142
10176
|
if (value !== void 0 && seenValues.has(value)) {
|
|
10143
10177
|
emit(
|
|
10144
10178
|
`${inner}public static var ${tick(leaf(member))}: ${shape.name} { .${seenValues.get(value)} }`
|
|
@@ -10303,7 +10337,6 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
10303
10337
|
}
|
|
10304
10338
|
return null;
|
|
10305
10339
|
};
|
|
10306
|
-
const atWidth = (value, raw2) => (raw2 === "UInt" || raw2 === "Swift.UInt") && value === "18446744073709551615" ? "4294967295" : (raw2 === "Int" || raw2 === "Swift.Int") && value === "9223372036854775807" ? "2147483647" : (raw2 === "Int" || raw2 === "Swift.Int") && value === "-9223372036854775808" ? "-2147483648" : value;
|
|
10307
10340
|
const emitGlobal = scoped((symbol2) => {
|
|
10308
10341
|
const path74 = pathOf(symbol2);
|
|
10309
10342
|
const kind = symbol2.kind.identifier;
|
|
@@ -10697,14 +10730,11 @@ function objcSdkIntakeFlags(headers, toolchainBin, minimum) {
|
|
|
10697
10730
|
return [
|
|
10698
10731
|
...swiftObjCPlatformFlags(toolchainBin, minimum),
|
|
10699
10732
|
// AvailabilityInternal.h derives these through __is_target_os(ios), which
|
|
10700
|
-
// is false for
|
|
10733
|
+
// is false for wasm64. the maximum is the sdk the headers come from, as
|
|
10701
10734
|
// xcode defines it, so `#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_26_0`
|
|
10702
10735
|
// sources see the members the sdk declares instead of a 17.0 default.
|
|
10703
10736
|
`-D__IPHONE_OS_VERSION_MIN_REQUIRED=${minimum}`,
|
|
10704
10737
|
`-D__IPHONE_OS_VERSION_MAX_ALLOWED=__IPHONE_${NATIVE_GRAPH_SDK_VERSION.replace(".", "_")}`,
|
|
10705
|
-
// apple's build setting for a 32-bit target to keep NSInteger and
|
|
10706
|
-
// NSUInteger long, the nominal types they have on arm64.
|
|
10707
|
-
"-DNS_BUILD_32_LIKE_64=1",
|
|
10708
10738
|
// the installed libc's default feature set otherwise defines
|
|
10709
10739
|
// _XOPEN_SOURCE, which darwin's sys/cdefs.h turns into a strict posix
|
|
10710
10740
|
// level; iOS compiles at darwin's full level with neither defined.
|
|
@@ -12035,7 +12065,7 @@ function swiftSharedSdkViewOptions(moduleRoot, distribution, toolchainBin, sdk)
|
|
|
12035
12065
|
...swiftSdkOptions(),
|
|
12036
12066
|
"--show-configuration",
|
|
12037
12067
|
sdk,
|
|
12038
|
-
"
|
|
12068
|
+
"wasm64-unknown-wasip1"
|
|
12039
12069
|
],
|
|
12040
12070
|
{ encoding: "utf8", env: swiftEnvironment(), stdio: ["ignore", "pipe", "pipe"] }
|
|
12041
12071
|
);
|
|
@@ -12194,7 +12224,7 @@ function compileDarwinRecords(args) {
|
|
|
12194
12224
|
(0, import_node_child_process17.execFileSync)(
|
|
12195
12225
|
import_node_path31.default.join(args.bin, "clang"),
|
|
12196
12226
|
[
|
|
12197
|
-
"--target=
|
|
12227
|
+
"--target=wasm64-unknown-wasip1",
|
|
12198
12228
|
`--sysroot=${args.sysroot}`,
|
|
12199
12229
|
"-Oz",
|
|
12200
12230
|
"-g0",
|
|
@@ -12205,7 +12235,7 @@ function compileDarwinRecords(args) {
|
|
|
12205
12235
|
`-ffile-prefix-map=${records}${import_node_path31.default.sep}=DarwinRecords/`,
|
|
12206
12236
|
// apple's headers select on the ios identity original units compile
|
|
12207
12237
|
// with, and TargetConditionals.h refuses a compiler without it
|
|
12208
|
-
...file.endsWith(".m") ? objcSdkIntakeFlags(args.darwin, args.bin, args.minimum) : [
|
|
12238
|
+
...file === "sysctl.c" || file.endsWith(".m") ? objcSdkIntakeFlags(args.darwin, args.bin, args.minimum) : [
|
|
12209
12239
|
...swiftObjCPlatformFlags(args.bin, args.minimum),
|
|
12210
12240
|
...WASI_EMULATION_FLAGS,
|
|
12211
12241
|
// the sdk build compiles these with libobjc2's headers in
|
|
@@ -12826,7 +12856,7 @@ var init_swiftRuntimeProductContract = __esm({
|
|
|
12826
12856
|
v.object({
|
|
12827
12857
|
id: v.string(),
|
|
12828
12858
|
installName: v.string(),
|
|
12829
|
-
target: v.literal("
|
|
12859
|
+
target: v.literal("wasm64-unknown-wasip1"),
|
|
12830
12860
|
linkNames: v.array(v.string()),
|
|
12831
12861
|
// absent records declare no framework namespace, even when a library name matches.
|
|
12832
12862
|
frameworkAliases: v.optional(
|
|
@@ -13756,7 +13786,7 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
13756
13786
|
} else {
|
|
13757
13787
|
lazyBuildObjects.set(t, parseWasmObjectCached(t, false, false));
|
|
13758
13788
|
}
|
|
13759
|
-
} else if (!inStartLib && t.endsWith(".a") && !t.endsWith("libclang_rt.builtins-
|
|
13789
|
+
} else if (!inStartLib && t.endsWith(".a") && !t.endsWith("libclang_rt.builtins-wasm64.a") && import_node_fs35.default.existsSync(t)) {
|
|
13760
13790
|
const members2 = readArMembers(new Uint8Array(import_node_fs35.default.readFileSync(t)));
|
|
13761
13791
|
for (const m of members2) {
|
|
13762
13792
|
extraArchiveObjs.push(parseWasmObjectBytes(`${t}(${m.name})`, m.bytes, false));
|
|
@@ -14238,7 +14268,11 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
14238
14268
|
}
|
|
14239
14269
|
}
|
|
14240
14270
|
const keptDataRelocBytes = [];
|
|
14241
|
-
const
|
|
14271
|
+
const zeroDataRelocs = [];
|
|
14272
|
+
const zeroDataReloc = (r) => zeroDataRelocs.push({
|
|
14273
|
+
ro: r.ro,
|
|
14274
|
+
width: WIDE_DATA_RELOCS.has(r.rawBytes[0]) ? 8 : 4
|
|
14275
|
+
});
|
|
14242
14276
|
const usedSyms = /* @__PURE__ */ new Set();
|
|
14243
14277
|
for (const r of keptCodeRelocs) if (r.rawBytes[0] !== 6) usedSyms.add(r.rs);
|
|
14244
14278
|
for (const r of obj.dataRelocList) {
|
|
@@ -14249,7 +14283,7 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
14249
14283
|
keptDataRelocBytes.push(r.rawBytes);
|
|
14250
14284
|
usedSyms.add(r.rs);
|
|
14251
14285
|
} else if (sName === "__objc_classes") {
|
|
14252
|
-
|
|
14286
|
+
zeroDataReloc(r);
|
|
14253
14287
|
} else {
|
|
14254
14288
|
const repl = firstLiveInSpecialSeg.get(r.segIdx);
|
|
14255
14289
|
const roBytes = encodeULEB(r.ro);
|
|
@@ -14262,17 +14296,17 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
14262
14296
|
} else if (r.ownerSymIdx !== -1) {
|
|
14263
14297
|
if (dLive.has(r.ownerSymIdx)) {
|
|
14264
14298
|
if (obj.isDist && dropsReflection(obj, obj.symNames[r.rs])) {
|
|
14265
|
-
|
|
14299
|
+
zeroDataReloc(r);
|
|
14266
14300
|
} else {
|
|
14267
14301
|
keptDataRelocBytes.push(r.rawBytes);
|
|
14268
14302
|
usedSyms.add(r.rs);
|
|
14269
14303
|
}
|
|
14270
14304
|
} else if (sName === "__objc_class_refs") {
|
|
14271
|
-
|
|
14305
|
+
zeroDataReloc(r);
|
|
14272
14306
|
}
|
|
14273
14307
|
} else if (sLive[r.segIdx] === 1) {
|
|
14274
14308
|
if (obj.isDist && obj.symNames[r.rs]?.startsWith("l__swift5_reflection_descriptor") && dropsReflection(obj, obj.symNames[r.rs])) {
|
|
14275
|
-
|
|
14309
|
+
zeroDataReloc(r);
|
|
14276
14310
|
} else {
|
|
14277
14311
|
keptDataRelocBytes.push(r.rawBytes);
|
|
14278
14312
|
usedSyms.add(r.rs);
|
|
@@ -14455,11 +14489,8 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
14455
14489
|
outChunks.push(buf.subarray(secStart, end));
|
|
14456
14490
|
}
|
|
14457
14491
|
} else {
|
|
14458
|
-
if (id === 11
|
|
14459
|
-
for (const ro of
|
|
14460
|
-
buf.fill(0, p + ro, p + ro + 4);
|
|
14461
|
-
}
|
|
14462
|
-
}
|
|
14492
|
+
if (id === 11)
|
|
14493
|
+
for (const { ro, width } of zeroDataRelocs) buf.fill(0, p + ro, p + ro + width);
|
|
14463
14494
|
outChunks.push(buf.subarray(secStart, end));
|
|
14464
14495
|
}
|
|
14465
14496
|
pos = end;
|
|
@@ -14558,7 +14589,7 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
14558
14589
|
});
|
|
14559
14590
|
import_node_fs35.default.rmSync(rspPath, { force: true });
|
|
14560
14591
|
}
|
|
14561
|
-
var import_node_child_process18, import_node_crypto14, import_node_fs35, import_node_os7, import_node_path32, v2, HAS_ADDEND, ROOT_SEG_PREFIXES, RECORD_SEGS, PARTITIONED_SEGS, PRUNED_SDK_ARCHIVES, OMIT_SDK_LIB_FLAGS, NEUTRALIZED_SWIFTRT_SECTIONS, parsedObjectCache, SWIFTUI_WRAPPER_HOST_PROTOCOLS;
|
|
14592
|
+
var import_node_child_process18, import_node_crypto14, import_node_fs35, import_node_os7, import_node_path32, v2, HAS_ADDEND, WIDE_DATA_RELOCS, ROOT_SEG_PREFIXES, RECORD_SEGS, PARTITIONED_SEGS, PRUNED_SDK_ARCHIVES, OMIT_SDK_LIB_FLAGS, NEUTRALIZED_SWIFTRT_SECTIONS, parsedObjectCache, SWIFTUI_WRAPPER_HOST_PROTOCOLS;
|
|
14562
14593
|
var init_swift_wasm_prune = __esm({
|
|
14563
14594
|
"src/swift-wasm-prune.ts"() {
|
|
14564
14595
|
"use strict";
|
|
@@ -14571,7 +14602,8 @@ var init_swift_wasm_prune = __esm({
|
|
|
14571
14602
|
v2 = __toESM(require("valibot"), 1);
|
|
14572
14603
|
init_swift_foundation();
|
|
14573
14604
|
init_swiftRuntimeProductContract();
|
|
14574
|
-
HAS_ADDEND = /* @__PURE__ */ new Set([3, 4, 5, 8, 9, 11,
|
|
14605
|
+
HAS_ADDEND = /* @__PURE__ */ new Set([3, 4, 5, 8, 9, 11, 14, 15, 16, 17, 21, 22, 23, 25]);
|
|
14606
|
+
WIDE_DATA_RELOCS = /* @__PURE__ */ new Set([16, 19, 22]);
|
|
14575
14607
|
ROOT_SEG_PREFIXES = [
|
|
14576
14608
|
".init_array",
|
|
14577
14609
|
"__objc_init_func",
|
|
@@ -14733,7 +14765,7 @@ function readNumber(bytes, position) {
|
|
|
14733
14765
|
let value = 0;
|
|
14734
14766
|
let shift = 0;
|
|
14735
14767
|
for (; ; ) {
|
|
14736
|
-
if (position >= bytes.length || shift >
|
|
14768
|
+
if (position >= bytes.length || shift > 63) throw new Error("invalid wasm integer");
|
|
14737
14769
|
const byte = bytes[position++];
|
|
14738
14770
|
value += (byte & 127) * 2 ** shift;
|
|
14739
14771
|
if (!(byte & 128)) return [value, position];
|
|
@@ -14779,7 +14811,7 @@ function llvmType(value) {
|
|
|
14779
14811
|
function rewriteObject(bytes, names, callerAlias, bindings, instrumentDynamicLookups, preserveCanonical) {
|
|
14780
14812
|
if (Buffer.from(bytes.subarray(0, 8)).toString("hex") !== "0061736d01000000")
|
|
14781
14813
|
throw new Error("expected wasm object");
|
|
14782
|
-
const
|
|
14814
|
+
const sections2 = [Buffer.from(bytes.subarray(0, 8))];
|
|
14783
14815
|
const types = [];
|
|
14784
14816
|
const functionTypes = [];
|
|
14785
14817
|
const definitions = [];
|
|
@@ -14836,12 +14868,12 @@ function rewriteObject(bytes, names, callerAlias, bindings, instrumentDynamicLoo
|
|
|
14836
14868
|
if (referenceType !== 112 && referenceType !== 111)
|
|
14837
14869
|
throw new Error("unsupported table type");
|
|
14838
14870
|
const flags = number3();
|
|
14839
|
-
if (flags & ~
|
|
14871
|
+
if (flags & ~7) throw new Error("unsupported table limits");
|
|
14840
14872
|
number3();
|
|
14841
14873
|
if (flags & 1) number3();
|
|
14842
14874
|
} else if (kind === 2) {
|
|
14843
14875
|
const flags = number3();
|
|
14844
|
-
if (flags & ~
|
|
14876
|
+
if (flags & ~7) throw new Error("unsupported memory limits");
|
|
14845
14877
|
number3();
|
|
14846
14878
|
if (flags & 1) number3();
|
|
14847
14879
|
} else if (kind === 3) offset += 2;
|
|
@@ -14854,7 +14886,7 @@ function rewriteObject(bytes, names, callerAlias, bindings, instrumentDynamicLoo
|
|
|
14854
14886
|
if (module2 === "env" && names.has(name3)) usedSymbols.add(name3);
|
|
14855
14887
|
if (isDlsym || isDlerror) {
|
|
14856
14888
|
const type = types[functionType2];
|
|
14857
|
-
const expected = isDlsym ? "
|
|
14889
|
+
const expected = isDlsym ? "126,126:126" : ":126";
|
|
14858
14890
|
if (!type || `${type.parameters.join(",")}:${type.results.join(",")}` !== expected)
|
|
14859
14891
|
throw new Error(`unexpected ${name3} import type`);
|
|
14860
14892
|
}
|
|
@@ -14996,10 +15028,10 @@ function rewriteObject(bytes, names, callerAlias, bindings, instrumentDynamicLoo
|
|
|
14996
15028
|
section = Buffer.concat(parts);
|
|
14997
15029
|
}
|
|
14998
15030
|
}
|
|
14999
|
-
|
|
15031
|
+
sections2.push(Buffer.from([id]), encodeNumber(section.length), section);
|
|
15000
15032
|
}
|
|
15001
15033
|
return {
|
|
15002
|
-
bytes: Buffer.concat(
|
|
15034
|
+
bytes: Buffer.concat(sections2),
|
|
15003
15035
|
definitions,
|
|
15004
15036
|
usesDlsym,
|
|
15005
15037
|
usedSymbols: [...usedSymbols]
|
|
@@ -15166,7 +15198,7 @@ function createGuestImageLedger(input) {
|
|
|
15166
15198
|
return [...bytes].map((byte) => `\\${byte.toString(16).padStart(2, "0")}`).join("");
|
|
15167
15199
|
}).join("");
|
|
15168
15200
|
const ir = [
|
|
15169
|
-
'target triple = "
|
|
15201
|
+
'target triple = "wasm64-unknown-wasip1"',
|
|
15170
15202
|
`@.names = private constant [${nameSize} x i8] c"${nameContents}"`
|
|
15171
15203
|
];
|
|
15172
15204
|
for (const definition2 of exported.values()) {
|
|
@@ -15297,8 +15329,8 @@ function selectedGuestManifestInputs(plan, selection, identities) {
|
|
|
15297
15329
|
}
|
|
15298
15330
|
function createGuestImageManifest(image) {
|
|
15299
15331
|
const target = {
|
|
15300
|
-
triple: "
|
|
15301
|
-
pointerWidth:
|
|
15332
|
+
triple: "wasm64-unknown-wasip1",
|
|
15333
|
+
pointerWidth: 64,
|
|
15302
15334
|
byteOrder: "little",
|
|
15303
15335
|
cpuType: -1,
|
|
15304
15336
|
cpuSubtype: 0
|
|
@@ -15378,16 +15410,16 @@ function signedAddress(bytes, start) {
|
|
|
15378
15410
|
function layout(bytes) {
|
|
15379
15411
|
if (Buffer.from(bytes.subarray(0, 8)).toString("hex") !== "0061736d01000000")
|
|
15380
15412
|
throw new Error("expected linked wasm module");
|
|
15381
|
-
const
|
|
15413
|
+
const sections2 = /* @__PURE__ */ new Map();
|
|
15382
15414
|
let offset = 8;
|
|
15383
15415
|
while (offset < bytes.length) {
|
|
15384
15416
|
const id = bytes[offset++];
|
|
15385
15417
|
const [size, start] = number2(bytes, offset);
|
|
15386
15418
|
if (start + size > bytes.length) throw new Error("invalid wasm section");
|
|
15387
|
-
if (id)
|
|
15419
|
+
if (id) sections2.set(id, [start, start + size]);
|
|
15388
15420
|
offset = start + size;
|
|
15389
15421
|
}
|
|
15390
|
-
const exports2 =
|
|
15422
|
+
const exports2 = sections2.get(7);
|
|
15391
15423
|
if (!exports2) throw new Error("guest wasm does not export memory and table");
|
|
15392
15424
|
let exportPosition = exports2[0];
|
|
15393
15425
|
const readExport = () => {
|
|
@@ -15408,7 +15440,7 @@ function layout(bytes) {
|
|
|
15408
15440
|
throw new Error("guest wasm does not export memory and table");
|
|
15409
15441
|
let imports2 = 0;
|
|
15410
15442
|
let memoryPages;
|
|
15411
|
-
const section =
|
|
15443
|
+
const section = sections2.get(2);
|
|
15412
15444
|
if (section) {
|
|
15413
15445
|
let pos = section[0];
|
|
15414
15446
|
const read = () => {
|
|
@@ -15423,7 +15455,7 @@ function layout(bytes) {
|
|
|
15423
15455
|
};
|
|
15424
15456
|
const limits = () => {
|
|
15425
15457
|
const flags = read();
|
|
15426
|
-
if (flags & ~
|
|
15458
|
+
if (flags & ~7) throw new Error("unsupported wasm limits");
|
|
15427
15459
|
const minimum = read();
|
|
15428
15460
|
if (flags & 1) read();
|
|
15429
15461
|
return minimum;
|
|
@@ -15451,7 +15483,7 @@ function layout(bytes) {
|
|
|
15451
15483
|
}
|
|
15452
15484
|
if (pos !== section[1]) throw new Error("invalid wasm imports");
|
|
15453
15485
|
}
|
|
15454
|
-
const memory =
|
|
15486
|
+
const memory = sections2.get(5);
|
|
15455
15487
|
if (memory) {
|
|
15456
15488
|
let pos = memory[0];
|
|
15457
15489
|
const read = () => {
|
|
@@ -15462,14 +15494,14 @@ function layout(bytes) {
|
|
|
15462
15494
|
if (read() !== 1 || memoryPages !== void 0)
|
|
15463
15495
|
throw new Error("unsupported wasm memories");
|
|
15464
15496
|
const flags = read();
|
|
15465
|
-
if (flags & ~
|
|
15497
|
+
if (flags & ~7) throw new Error("unsupported wasm memory limits");
|
|
15466
15498
|
memoryPages = read();
|
|
15467
15499
|
if (flags & 1) read();
|
|
15468
15500
|
if (pos !== memory[1]) throw new Error("invalid wasm memory section");
|
|
15469
15501
|
}
|
|
15470
15502
|
if (memoryPages === void 0) throw new Error("guest wasm has no memory");
|
|
15471
15503
|
const functionsByCodeOffset = /* @__PURE__ */ new Map();
|
|
15472
|
-
const code =
|
|
15504
|
+
const code = sections2.get(10);
|
|
15473
15505
|
if (code) {
|
|
15474
15506
|
let pos = code[0];
|
|
15475
15507
|
let count;
|
|
@@ -15485,7 +15517,7 @@ function layout(bytes) {
|
|
|
15485
15517
|
if (pos !== code[1]) throw new Error("invalid wasm code section");
|
|
15486
15518
|
}
|
|
15487
15519
|
const functionsByTableSlot = /* @__PURE__ */ new Map();
|
|
15488
|
-
const elements =
|
|
15520
|
+
const elements = sections2.get(9);
|
|
15489
15521
|
if (elements) {
|
|
15490
15522
|
let pos = elements[0];
|
|
15491
15523
|
const read = () => {
|
|
@@ -15499,7 +15531,7 @@ function layout(bytes) {
|
|
|
15499
15531
|
if (flags !== 0 && flags !== 2)
|
|
15500
15532
|
throw new Error(`unsupported wasm element segment ${flags}`);
|
|
15501
15533
|
if (flags === 2 && read() !== 0) throw new Error("unsupported wasm table index");
|
|
15502
|
-
if (bytes[pos++]
|
|
15534
|
+
if (!constant(bytes[pos++])) throw new Error("nonconstant wasm table offset");
|
|
15503
15535
|
let base;
|
|
15504
15536
|
[base, pos] = signedAddress(bytes, pos);
|
|
15505
15537
|
if (bytes[pos++] !== 11) throw new Error("invalid wasm table offset");
|
|
@@ -15516,7 +15548,7 @@ function layout(bytes) {
|
|
|
15516
15548
|
if (pos !== elements[1]) throw new Error("invalid wasm element section");
|
|
15517
15549
|
}
|
|
15518
15550
|
const data = [];
|
|
15519
|
-
const dataSection =
|
|
15551
|
+
const dataSection = sections2.get(11);
|
|
15520
15552
|
if (dataSection) {
|
|
15521
15553
|
let pos = dataSection[0];
|
|
15522
15554
|
const read = () => {
|
|
@@ -15530,7 +15562,7 @@ function layout(bytes) {
|
|
|
15530
15562
|
if (flags !== 0 && flags !== 2)
|
|
15531
15563
|
throw new Error(`unsupported wasm data segment ${flags}`);
|
|
15532
15564
|
if (flags === 2 && read() !== 0) throw new Error("unsupported wasm memory index");
|
|
15533
|
-
if (bytes[pos++]
|
|
15565
|
+
if (!constant(bytes[pos++])) throw new Error("nonconstant wasm data offset");
|
|
15534
15566
|
let address;
|
|
15535
15567
|
[address, pos] = signedAddress(bytes, pos);
|
|
15536
15568
|
if (bytes[pos++] !== 11) throw new Error("invalid wasm data offset");
|
|
@@ -15645,10 +15677,12 @@ function guestLinkedSpans(map2, before, after, owners, sectionOwners = /* @__PUR
|
|
|
15645
15677
|
}
|
|
15646
15678
|
return spans;
|
|
15647
15679
|
}
|
|
15680
|
+
var constant;
|
|
15648
15681
|
var init_swift_guest_linked_spans = __esm({
|
|
15649
15682
|
"src/swift-guest-linked-spans.ts"() {
|
|
15650
15683
|
"use strict";
|
|
15651
15684
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
15685
|
+
constant = (opcode) => opcode === 65 || opcode === 66;
|
|
15652
15686
|
}
|
|
15653
15687
|
});
|
|
15654
15688
|
|
|
@@ -15658,7 +15692,7 @@ function isSwiftGuestImageManifest(value) {
|
|
|
15658
15692
|
const text6 = (value2) => typeof value2 === "string" && value2.length > 0 && value2.length <= 4096 && !value2.includes("\0");
|
|
15659
15693
|
const name3 = (value2) => text6(value2) && new TextEncoder().encode(value2).length <= 16;
|
|
15660
15694
|
const version2 = (value2) => isRecord(value2) && uint(value2.major, 65535) && uint(value2.minor, 255) && uint(value2.patch, 255);
|
|
15661
|
-
if (!isRecord(value) || value.version !== 1 || !text6(value.id) || !text6(value.installName) || value.fileType !== "executable" && value.fileType !== "dylib" || !isRecord(value.target) || value.target.triple !== "
|
|
15695
|
+
if (!isRecord(value) || value.version !== 1 || !text6(value.id) || !text6(value.installName) || value.fileType !== "executable" && value.fileType !== "dylib" || !isRecord(value.target) || value.target.triple !== "wasm64-unknown-wasip1" || value.target.pointerWidth !== 64 || value.target.byteOrder !== "little" || value.target.cpuType !== -1 || value.target.cpuSubtype !== 0 || typeof value.inputsSha256 !== "string" || !/^[a-f0-9]{64}$/.test(value.inputsSha256) || value.uuid !== value.inputsSha256.slice(0, 32) || !isRecord(value.buildVersion) || !uint(value.buildVersion.platform, 4294967295) || !version2(value.buildVersion.minimum) || !version2(value.buildVersion.sdk) || !Array.isArray(value.regions))
|
|
15662
15696
|
return false;
|
|
15663
15697
|
return value.regions.every((region) => {
|
|
15664
15698
|
if (!isRecord(region) || !name3(region.name) || region.space !== "linear-memory" && region.space !== "function-table" || !uint(region.address, 4294967295) || !uint(region.length, 4294967295) || region.address + region.length > 4294967296 || !uint(region.initialProtection, 7) || !uint(region.maximumProtection, 7) || (region.initialProtection & region.maximumProtection) !== region.initialProtection || !Array.isArray(region.sections))
|
|
@@ -17141,7 +17175,7 @@ function linkGuestImages(options) {
|
|
|
17141
17175
|
import_node_fs39.default.writeFileSync(irPath, ledger.llvmIR);
|
|
17142
17176
|
(0, import_node_child_process20.execFileSync)(
|
|
17143
17177
|
clang,
|
|
17144
|
-
["--target=
|
|
17178
|
+
["--target=wasm64-unknown-wasip1", "-c", irPath, "-o", ledgerObject],
|
|
17145
17179
|
{ stdio: "pipe" }
|
|
17146
17180
|
);
|
|
17147
17181
|
linkedOwners.set(ledgerObject, options.ledgerDataImage);
|
|
@@ -17871,10 +17905,16 @@ function sourceGuestClangLinkOptions(options) {
|
|
|
17871
17905
|
throw new Error(`unsupported source object producer ${file}`);
|
|
17872
17906
|
continue;
|
|
17873
17907
|
}
|
|
17874
|
-
|
|
17908
|
+
const compiler = command.args[0] ? (0, import_node_fs40.realpathSync)(command.args[0]) : "";
|
|
17909
|
+
if (command.tool !== "clang" || compiler !== (0, import_node_fs40.realpathSync)(import_node_path37.default.join(options.toolchainBin, "clang")) && compiler !== (0, import_node_fs40.realpathSync)(import_node_path37.default.join(options.buildDirectory, CLANG_TARGET_MODULE_WRAPPER)))
|
|
17875
17910
|
throw new Error(`unsupported source object producer ${file}`);
|
|
17876
17911
|
const args = command.args.slice(1).filter((arg) => arg !== "-c");
|
|
17877
|
-
const
|
|
17912
|
+
const outputDirectory = import_node_path37.default.join(
|
|
17913
|
+
options.directory,
|
|
17914
|
+
import_node_path37.default.basename(import_node_path37.default.dirname(file))
|
|
17915
|
+
);
|
|
17916
|
+
(0, import_node_fs40.mkdirSync)(outputDirectory, { recursive: true });
|
|
17917
|
+
const output2 = import_node_path37.default.join(outputDirectory, `clang-link-${index}.ll`);
|
|
17878
17918
|
for (const flag of ["-o", "-MF"]) {
|
|
17879
17919
|
const index2 = args.lastIndexOf(flag);
|
|
17880
17920
|
if (index2 < 0 || index2 + 1 >= args.length)
|
|
@@ -18112,7 +18152,7 @@ function logicalGuestLinkOptions(args, identities, roots) {
|
|
|
18112
18152
|
}
|
|
18113
18153
|
return output2;
|
|
18114
18154
|
}
|
|
18115
|
-
var import_node_child_process21, import_node_crypto18, import_node_fs40, import_node_path37;
|
|
18155
|
+
var import_node_child_process21, import_node_crypto18, import_node_fs40, import_node_path37, CLANG_TARGET_MODULE_WRAPPER;
|
|
18116
18156
|
var init_swift_guest_source_inputs = __esm({
|
|
18117
18157
|
"src/swift-guest-source-inputs.ts"() {
|
|
18118
18158
|
"use strict";
|
|
@@ -18123,11 +18163,254 @@ var init_swift_guest_source_inputs = __esm({
|
|
|
18123
18163
|
import_node_path37 = __toESM(require("node:path"), 1);
|
|
18124
18164
|
init_swift_guest_source_plan();
|
|
18125
18165
|
init_swift_runtime_products();
|
|
18166
|
+
CLANG_TARGET_MODULE_WRAPPER = ".peach-clang";
|
|
18167
|
+
}
|
|
18168
|
+
});
|
|
18169
|
+
|
|
18170
|
+
// src/wasm-narrow-boundary.ts
|
|
18171
|
+
function encodeNumber2(value) {
|
|
18172
|
+
const bytes = [];
|
|
18173
|
+
for (let rest = value; ; ) {
|
|
18174
|
+
const byte = rest % 128;
|
|
18175
|
+
rest = Math.floor(rest / 128);
|
|
18176
|
+
if (rest === 0) return [...bytes, byte];
|
|
18177
|
+
bytes.push(byte | 128);
|
|
18178
|
+
}
|
|
18179
|
+
}
|
|
18180
|
+
function encodeName(name3) {
|
|
18181
|
+
const bytes = [...Buffer.from(name3)];
|
|
18182
|
+
return [...encodeNumber2(bytes.length), ...bytes];
|
|
18183
|
+
}
|
|
18184
|
+
function reader(bytes, start, end) {
|
|
18185
|
+
let at = start;
|
|
18186
|
+
const number3 = () => {
|
|
18187
|
+
let value = 0;
|
|
18188
|
+
for (let shift = 0; ; shift += 7) {
|
|
18189
|
+
if (at >= end || shift > 63) throw new Error("invalid wasm integer");
|
|
18190
|
+
const byte = bytes[at++];
|
|
18191
|
+
value += (byte & 127) * 2 ** shift;
|
|
18192
|
+
if (!(byte & 128)) return value;
|
|
18193
|
+
}
|
|
18194
|
+
};
|
|
18195
|
+
return {
|
|
18196
|
+
number: number3,
|
|
18197
|
+
byte: () => {
|
|
18198
|
+
if (at >= end) throw new Error("truncated wasm section");
|
|
18199
|
+
return bytes[at++];
|
|
18200
|
+
},
|
|
18201
|
+
name: () => {
|
|
18202
|
+
const length = number3();
|
|
18203
|
+
at += length;
|
|
18204
|
+
if (at > end) throw new Error("truncated wasm name");
|
|
18205
|
+
return Buffer.from(bytes.subarray(at - length, at)).toString();
|
|
18206
|
+
},
|
|
18207
|
+
position: () => at,
|
|
18208
|
+
done: () => at === end
|
|
18209
|
+
};
|
|
18210
|
+
}
|
|
18211
|
+
function sections(bytes) {
|
|
18212
|
+
if (Buffer.from(bytes.subarray(0, 8)).toString("hex") !== "0061736d01000000")
|
|
18213
|
+
throw new Error("not a wasm module");
|
|
18214
|
+
const found = [];
|
|
18215
|
+
for (let at = 8; at < bytes.length; ) {
|
|
18216
|
+
const header = reader(bytes, at, bytes.length);
|
|
18217
|
+
const id = header.byte();
|
|
18218
|
+
const size = header.number();
|
|
18219
|
+
const start = header.position();
|
|
18220
|
+
found.push({ id, start, end: start + size });
|
|
18221
|
+
at = start + size;
|
|
18222
|
+
}
|
|
18223
|
+
return found;
|
|
18224
|
+
}
|
|
18225
|
+
function withSections(bytes, layout2, replacements) {
|
|
18226
|
+
const parts = [bytes.subarray(0, 8)];
|
|
18227
|
+
let at = 8;
|
|
18228
|
+
for (const section of layout2) {
|
|
18229
|
+
const body = replacements.get(section.id);
|
|
18230
|
+
parts.push(
|
|
18231
|
+
body ? Uint8Array.from([section.id, ...encodeNumber2(body.length), ...body]) : bytes.subarray(at, section.end)
|
|
18232
|
+
);
|
|
18233
|
+
at = section.end;
|
|
18234
|
+
}
|
|
18235
|
+
return Buffer.concat(parts);
|
|
18236
|
+
}
|
|
18237
|
+
function narrowWasmBoundary(bytes) {
|
|
18238
|
+
const layout2 = sections(bytes);
|
|
18239
|
+
const section = (id) => {
|
|
18240
|
+
const found = layout2.find((entry) => entry.id === id);
|
|
18241
|
+
return found && reader(bytes, found.start, found.end);
|
|
18242
|
+
};
|
|
18243
|
+
const types = [];
|
|
18244
|
+
const typeSection = section(1);
|
|
18245
|
+
if (typeSection) {
|
|
18246
|
+
for (let count = typeSection.number(); count > 0; count--) {
|
|
18247
|
+
if (typeSection.byte() !== 96) throw new Error("unsupported wasm type");
|
|
18248
|
+
const values = () => Array.from({ length: typeSection.number() }, () => typeSection.byte());
|
|
18249
|
+
types.push({ parameters: values(), results: values() });
|
|
18250
|
+
}
|
|
18251
|
+
}
|
|
18252
|
+
const typeAt = (index) => {
|
|
18253
|
+
const type = types[index];
|
|
18254
|
+
if (!type) throw new Error("invalid wasm type index");
|
|
18255
|
+
return type;
|
|
18256
|
+
};
|
|
18257
|
+
const thunks = [];
|
|
18258
|
+
const functionTypes = [];
|
|
18259
|
+
const importBody = [];
|
|
18260
|
+
const importSection = section(2);
|
|
18261
|
+
if (importSection) {
|
|
18262
|
+
const count = importSection.number();
|
|
18263
|
+
importBody.push(...encodeNumber2(count));
|
|
18264
|
+
for (let index = 0; index < count; index++) {
|
|
18265
|
+
const module2 = importSection.name();
|
|
18266
|
+
const name3 = importSection.name();
|
|
18267
|
+
const start = importSection.position();
|
|
18268
|
+
const kind = importSection.byte();
|
|
18269
|
+
const limits = () => {
|
|
18270
|
+
const flags = importSection.number();
|
|
18271
|
+
importSection.number();
|
|
18272
|
+
if (flags & 1) importSection.number();
|
|
18273
|
+
};
|
|
18274
|
+
let type;
|
|
18275
|
+
if (kind === 0) {
|
|
18276
|
+
type = typeAt(importSection.number());
|
|
18277
|
+
functionTypes.push(type);
|
|
18278
|
+
} else if (kind === 1) {
|
|
18279
|
+
importSection.byte();
|
|
18280
|
+
limits();
|
|
18281
|
+
} else if (kind === 2) limits();
|
|
18282
|
+
else if (kind === 3) {
|
|
18283
|
+
importSection.byte();
|
|
18284
|
+
importSection.byte();
|
|
18285
|
+
} else if (kind === 4) {
|
|
18286
|
+
importSection.byte();
|
|
18287
|
+
importSection.number();
|
|
18288
|
+
} else throw new Error("unsupported wasm import");
|
|
18289
|
+
const scalar64 = (parameter) => module2 === "wasi_snapshot_preview1" && (!name3.startsWith("peach_") || name3 === "peach_fs_path_birthtime_set" && parameter === 2) || module2 === "peach" && name3 === "hw_memsize" && parameter === null || module2 === "peach_notify" && name3 === "set" && parameter === 1;
|
|
18290
|
+
const parameters = type?.parameters.map(
|
|
18291
|
+
(value, index2) => value === I64 && !scalar64(index2) ? 127 : value
|
|
18292
|
+
);
|
|
18293
|
+
const results = type?.results.map(
|
|
18294
|
+
(value) => value === I64 && !scalar64(null) ? 127 : value
|
|
18295
|
+
);
|
|
18296
|
+
if (type && parameters && results && (parameters.some((value, index2) => value !== type.parameters[index2]) || results.some((value, index2) => value !== type.results[index2]))) {
|
|
18297
|
+
if (type.results.length > 1)
|
|
18298
|
+
throw new Error(`import ${module2}.${name3} returns several values`);
|
|
18299
|
+
const id = thunks.length;
|
|
18300
|
+
const call = `(call $host${id}${type.parameters.map(
|
|
18301
|
+
(value, at) => value !== parameters[at] ? ` (i32.wrap_i64 (local.get ${at}))` : ` (local.get ${at})`
|
|
18302
|
+
).join("")})`;
|
|
18303
|
+
thunks.push(
|
|
18304
|
+
`(import ${quoted(module2)} ${quoted(name3)} (func $host${id}${signature(parameters, "param", false)}${signature(results, "result", false)}))`,
|
|
18305
|
+
`(func (export "${NARROW}${id}")${signature(type.parameters, "param", false)}${signature(type.results, "result", false)} ${type.results[0] !== results[0] ? `(i64.extend_i32_u ${call})` : call})`
|
|
18306
|
+
);
|
|
18307
|
+
importBody.push(...encodeName(BOUNDARY), ...encodeName(`${NARROW}${id}`));
|
|
18308
|
+
} else importBody.push(...encodeName(module2), ...encodeName(name3));
|
|
18309
|
+
importBody.push(...bytes.subarray(start, importSection.position()));
|
|
18310
|
+
}
|
|
18311
|
+
if (!importSection.done()) throw new Error("invalid wasm imports");
|
|
18312
|
+
}
|
|
18313
|
+
const functionSection = section(3);
|
|
18314
|
+
if (functionSection)
|
|
18315
|
+
for (let count = functionSection.number(); count > 0; count--)
|
|
18316
|
+
functionTypes.push(typeAt(functionSection.number()));
|
|
18317
|
+
const exportBody = [];
|
|
18318
|
+
const exportSection = section(7);
|
|
18319
|
+
if (exportSection) {
|
|
18320
|
+
const count = exportSection.number();
|
|
18321
|
+
exportBody.push(...encodeNumber2(count));
|
|
18322
|
+
for (let index = 0; index < count; index++) {
|
|
18323
|
+
const name3 = exportSection.name();
|
|
18324
|
+
const kind = exportSection.byte();
|
|
18325
|
+
const target = exportSection.number();
|
|
18326
|
+
const type = kind === 0 ? functionTypes[target] : void 0;
|
|
18327
|
+
if (kind === 0 && !type) throw new Error("invalid wasm export");
|
|
18328
|
+
if (type && wide(type)) {
|
|
18329
|
+
if (type.results.length > 1)
|
|
18330
|
+
throw new Error(`export ${name3} returns several values`);
|
|
18331
|
+
const id = thunks.length;
|
|
18332
|
+
const call = `(call $guest${id}${type.parameters.map(
|
|
18333
|
+
(value, at) => value === I64 ? ` (i64.extend_i32_u (local.get ${at}))` : ` (local.get ${at})`
|
|
18334
|
+
).join("")})`;
|
|
18335
|
+
thunks.push(
|
|
18336
|
+
`(import "${GUEST}" "${WIDE}${id}" (func $guest${id}${signature(type.parameters, "param", false)}${signature(type.results, "result", false)}))`,
|
|
18337
|
+
`(func (export ${quoted(name3)})${signature(type.parameters, "param", true)}${signature(type.results, "result", true)} ${type.results[0] === I64 ? `(i32.wrap_i64 ${call})` : call})`
|
|
18338
|
+
);
|
|
18339
|
+
exportBody.push(...encodeName(`${WIDE}${id}`));
|
|
18340
|
+
} else exportBody.push(...encodeName(name3));
|
|
18341
|
+
exportBody.push(kind, ...encodeNumber2(target));
|
|
18342
|
+
}
|
|
18343
|
+
if (!exportSection.done()) throw new Error("invalid wasm exports");
|
|
18344
|
+
}
|
|
18345
|
+
if (thunks.length === 0) return void 0;
|
|
18346
|
+
const imports2 = thunks.filter((line) => line.startsWith("(import"));
|
|
18347
|
+
const functions = thunks.filter((line) => !line.startsWith("(import"));
|
|
18348
|
+
return {
|
|
18349
|
+
module: withSections(
|
|
18350
|
+
bytes,
|
|
18351
|
+
layout2,
|
|
18352
|
+
/* @__PURE__ */ new Map([
|
|
18353
|
+
[2, importBody],
|
|
18354
|
+
[7, exportBody]
|
|
18355
|
+
])
|
|
18356
|
+
),
|
|
18357
|
+
thunks: `(module
|
|
18358
|
+
${[...imports2, ...functions].join("\n")}
|
|
18359
|
+
)
|
|
18360
|
+
`
|
|
18361
|
+
};
|
|
18362
|
+
}
|
|
18363
|
+
function dropBoundaryExports(bytes) {
|
|
18364
|
+
const layout2 = sections(bytes);
|
|
18365
|
+
const found = layout2.find((entry) => entry.id === 7);
|
|
18366
|
+
if (!found) throw new Error("merged module has no exports");
|
|
18367
|
+
const exportSection = reader(bytes, found.start, found.end);
|
|
18368
|
+
const kept = [];
|
|
18369
|
+
for (let count = exportSection.number(); count > 0; count--) {
|
|
18370
|
+
const name3 = exportSection.name();
|
|
18371
|
+
const kind = exportSection.byte();
|
|
18372
|
+
const target = exportSection.number();
|
|
18373
|
+
if (!name3.startsWith(WIDE) && !name3.startsWith(NARROW))
|
|
18374
|
+
kept.push([...encodeName(name3), kind, ...encodeNumber2(target)]);
|
|
18375
|
+
}
|
|
18376
|
+
return withSections(
|
|
18377
|
+
bytes,
|
|
18378
|
+
layout2,
|
|
18379
|
+
/* @__PURE__ */ new Map([[7, [...encodeNumber2(kept.length), ...kept.flat()]]])
|
|
18380
|
+
);
|
|
18381
|
+
}
|
|
18382
|
+
var I64, VALUE_TYPES, GUEST, BOUNDARY, WIDE, NARROW, quoted, signature, wide, NARROW_MERGE_NAMES;
|
|
18383
|
+
var init_wasm_narrow_boundary = __esm({
|
|
18384
|
+
"src/wasm-narrow-boundary.ts"() {
|
|
18385
|
+
"use strict";
|
|
18386
|
+
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
18387
|
+
I64 = 126;
|
|
18388
|
+
VALUE_TYPES = /* @__PURE__ */ new Map([
|
|
18389
|
+
[127, "i32"],
|
|
18390
|
+
[I64, "i64"],
|
|
18391
|
+
[125, "f32"],
|
|
18392
|
+
[124, "f64"],
|
|
18393
|
+
[123, "v128"],
|
|
18394
|
+
[112, "funcref"],
|
|
18395
|
+
[111, "externref"]
|
|
18396
|
+
]);
|
|
18397
|
+
GUEST = "guest";
|
|
18398
|
+
BOUNDARY = "boundary";
|
|
18399
|
+
WIDE = "$wide.";
|
|
18400
|
+
NARROW = "$narrow.";
|
|
18401
|
+
quoted = (name3) => `"${[...Buffer.from(name3)].map((byte) => `\\${byte.toString(16).padStart(2, "0")}`).join("")}"`;
|
|
18402
|
+
signature = (types, keyword, narrow) => types.length === 0 ? "" : ` (${keyword} ${types.map((type) => {
|
|
18403
|
+
const name3 = VALUE_TYPES.get(narrow && type === I64 ? 127 : type);
|
|
18404
|
+
if (!name3) throw new Error(`unsupported wasm boundary type ${type}`);
|
|
18405
|
+
return name3;
|
|
18406
|
+
}).join(" ")})`;
|
|
18407
|
+
wide = (type) => type.parameters.includes(I64) || type.results.includes(I64);
|
|
18408
|
+
NARROW_MERGE_NAMES = { guest: GUEST, boundary: BOUNDARY };
|
|
18126
18409
|
}
|
|
18127
18410
|
});
|
|
18128
18411
|
|
|
18129
18412
|
// src/wasm-optimize.ts
|
|
18130
|
-
async function runWasmOpt(file, output2, skipPasses, binary2) {
|
|
18413
|
+
async function runWasmOpt(file, output2, optimize, skipPasses, binary2) {
|
|
18131
18414
|
const admittedCores = windowAdmission()?.cores ?? Number(process.env.TM_EXEC_CPU_CORES);
|
|
18132
18415
|
const requestedCores = Number(process.env.BINARYEN_CORES);
|
|
18133
18416
|
const environment = { ...process.env, WASM_OPT_PATH: binary2 };
|
|
@@ -18135,18 +18418,43 @@ async function runWasmOpt(file, output2, skipPasses, binary2) {
|
|
|
18135
18418
|
environment.BINARYEN_CORES = String(
|
|
18136
18419
|
Number.isInteger(requestedCores) && requestedCores > 0 ? Math.min(admittedCores, requestedCores) : admittedCores
|
|
18137
18420
|
);
|
|
18421
|
+
const features = FEATURES.map((feature) => `--enable-${feature}`);
|
|
18422
|
+
const names = optimize && !KEEP_WASM_NAMES ? [] : ["-g"];
|
|
18423
|
+
const narrowed = narrowWasmBoundary((0, import_node_fs41.readFileSync)(file));
|
|
18424
|
+
const merged = `${output2}.narrowed`;
|
|
18425
|
+
if (narrowed) {
|
|
18426
|
+
const guest = `${output2}.guest`;
|
|
18427
|
+
const thunks = `${output2}.thunks.wat`;
|
|
18428
|
+
(0, import_node_fs41.writeFileSync)(guest, narrowed.module);
|
|
18429
|
+
(0, import_node_fs41.writeFileSync)(thunks, narrowed.thunks);
|
|
18430
|
+
await (0, import_node_util7.promisify)(import_node_child_process22.execFile)((0, import_node_path38.join)((0, import_node_path38.dirname)(binary2), "wasm-merge"), [
|
|
18431
|
+
...features,
|
|
18432
|
+
...names,
|
|
18433
|
+
guest,
|
|
18434
|
+
NARROW_MERGE_NAMES.guest,
|
|
18435
|
+
thunks,
|
|
18436
|
+
NARROW_MERGE_NAMES.boundary,
|
|
18437
|
+
"-o",
|
|
18438
|
+
merged
|
|
18439
|
+
]);
|
|
18440
|
+
(0, import_node_fs41.writeFileSync)(merged, dropBoundaryExports((0, import_node_fs41.readFileSync)(merged)));
|
|
18441
|
+
(0, import_node_fs41.rmSync)(guest);
|
|
18442
|
+
(0, import_node_fs41.rmSync)(thunks);
|
|
18443
|
+
}
|
|
18138
18444
|
const result = await (0, import_wasm_opt.wasmOpt)(
|
|
18139
18445
|
[
|
|
18140
|
-
|
|
18141
|
-
...
|
|
18446
|
+
...LOWERING,
|
|
18447
|
+
...optimize ? ["-Oz"] : [],
|
|
18448
|
+
...names,
|
|
18142
18449
|
...skipPasses.flatMap((pass) => ["--skip-pass", pass]),
|
|
18143
|
-
...
|
|
18144
|
-
file,
|
|
18450
|
+
...features,
|
|
18451
|
+
narrowed ? merged : file,
|
|
18145
18452
|
"-o",
|
|
18146
18453
|
output2
|
|
18147
18454
|
],
|
|
18148
18455
|
{ env: environment }
|
|
18149
18456
|
);
|
|
18457
|
+
if (narrowed) (0, import_node_fs41.rmSync)(merged);
|
|
18150
18458
|
if (result.status !== 0)
|
|
18151
18459
|
throw new Error(`wasm-opt exited ${result.status}: ${result.stderr}`);
|
|
18152
18460
|
}
|
|
@@ -18169,21 +18477,31 @@ async function installWasmOpt() {
|
|
|
18169
18477
|
});
|
|
18170
18478
|
return binary2;
|
|
18171
18479
|
}
|
|
18172
|
-
async function
|
|
18173
|
-
await runWasmOpt(
|
|
18480
|
+
async function lowerWasm(file, output2, options) {
|
|
18481
|
+
await runWasmOpt(
|
|
18482
|
+
file,
|
|
18483
|
+
output2,
|
|
18484
|
+
options.optimize,
|
|
18485
|
+
options.skipPasses ?? [],
|
|
18486
|
+
await installWasmOpt()
|
|
18487
|
+
);
|
|
18174
18488
|
}
|
|
18175
|
-
var import_node_fs41, import_node_path38, import_wasm_opt, FEATURES, KEEP_WASM_NAMES,
|
|
18489
|
+
var import_node_child_process22, import_node_fs41, import_node_path38, import_node_util7, import_wasm_opt, FEATURES, KEEP_WASM_NAMES, LOWERING, WASM_LOWER_IDENTITY, PINNED_BINARYEN_VERSION, BINARYEN_RELEASES;
|
|
18176
18490
|
var init_wasm_optimize = __esm({
|
|
18177
18491
|
"src/wasm-optimize.ts"() {
|
|
18178
18492
|
"use strict";
|
|
18179
18493
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
18494
|
+
import_node_child_process22 = require("node:child_process");
|
|
18180
18495
|
import_node_fs41 = require("node:fs");
|
|
18181
18496
|
import_node_path38 = require("node:path");
|
|
18497
|
+
import_node_util7 = require("node:util");
|
|
18182
18498
|
init_src();
|
|
18183
18499
|
import_wasm_opt = require("wasm-opt");
|
|
18184
18500
|
init_admitted_mac_build();
|
|
18185
18501
|
init_home_paths();
|
|
18502
|
+
init_wasm_narrow_boundary();
|
|
18186
18503
|
FEATURES = [
|
|
18504
|
+
"memory64",
|
|
18187
18505
|
"threads",
|
|
18188
18506
|
"bulk-memory",
|
|
18189
18507
|
"bulk-memory-opt",
|
|
@@ -18196,7 +18514,8 @@ var init_wasm_optimize = __esm({
|
|
|
18196
18514
|
"sign-ext"
|
|
18197
18515
|
];
|
|
18198
18516
|
KEEP_WASM_NAMES = process.env.PEACH_SWIFT_NAMES === "1";
|
|
18199
|
-
|
|
18517
|
+
LOWERING = ["--memory64-lowering", "--table64-lowering"];
|
|
18518
|
+
WASM_LOWER_IDENTITY = `binaryen ${import_wasm_opt.BINARYEN_VERSION} narrow ${LOWERING.join(" ")} ${FEATURES.join(",")} unoptimized-names`;
|
|
18200
18519
|
PINNED_BINARYEN_VERSION = "132";
|
|
18201
18520
|
BINARYEN_RELEASES = /* @__PURE__ */ new Map([
|
|
18202
18521
|
[
|
|
@@ -18255,7 +18574,7 @@ async function compileGuestLink(options) {
|
|
|
18255
18574
|
};
|
|
18256
18575
|
const buildVersion = imageBuildVersion(entry.buildVersion);
|
|
18257
18576
|
const clangOptions = [
|
|
18258
|
-
"--target=
|
|
18577
|
+
"--target=wasm64-unknown-wasip1",
|
|
18259
18578
|
`--sysroot=${options.sysroot}`,
|
|
18260
18579
|
`-I${import_node_path39.default.join(options.moduleRoot, "include")}`
|
|
18261
18580
|
];
|
|
@@ -18265,7 +18584,7 @@ async function compileGuestLink(options) {
|
|
|
18265
18584
|
stubSource,
|
|
18266
18585
|
'#include "guest-image-projection.h"\nconst struct peach_guest_image __peach_guest_images[] = {{0}};\nconst uint32_t __peach_guest_image_count = 0;\n'
|
|
18267
18586
|
);
|
|
18268
|
-
(0,
|
|
18587
|
+
(0, import_node_child_process23.execFileSync)(
|
|
18269
18588
|
import_node_path39.default.join(options.toolchainBin, "clang"),
|
|
18270
18589
|
[...clangOptions, "-c", stubSource, "-o", stub],
|
|
18271
18590
|
{ stdio: "pipe" }
|
|
@@ -18563,9 +18882,10 @@ async function compileGuestLink(options) {
|
|
|
18563
18882
|
}
|
|
18564
18883
|
});
|
|
18565
18884
|
if (!reserved2 || !projectionObject) throw new Error("guest projection was not reserved");
|
|
18566
|
-
await
|
|
18567
|
-
|
|
18568
|
-
|
|
18885
|
+
await lowerWasm(options.output, options.optimized, {
|
|
18886
|
+
optimize: true,
|
|
18887
|
+
skipPasses: ["duplicate-function-elimination"]
|
|
18888
|
+
});
|
|
18569
18889
|
const map2 = (0, import_node_fs42.readFileSync)(result.mapPath, "utf8");
|
|
18570
18890
|
if (!/ __peach_guest_images$/m.test(map2)) return;
|
|
18571
18891
|
const finalized = finalizeGuestProjectionStorage({
|
|
@@ -18579,12 +18899,12 @@ async function compileGuestLink(options) {
|
|
|
18579
18899
|
});
|
|
18580
18900
|
(0, import_node_fs42.writeFileSync)(options.optimized, finalized.wasm);
|
|
18581
18901
|
}
|
|
18582
|
-
var
|
|
18902
|
+
var import_node_child_process23, import_node_fs42, import_node_path39;
|
|
18583
18903
|
var init_swift_guest_compile = __esm({
|
|
18584
18904
|
"src/swift-guest-compile.ts"() {
|
|
18585
18905
|
"use strict";
|
|
18586
18906
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
18587
|
-
|
|
18907
|
+
import_node_child_process23 = require("node:child_process");
|
|
18588
18908
|
import_node_fs42 = require("node:fs");
|
|
18589
18909
|
import_node_path39 = __toESM(require("node:path"), 1);
|
|
18590
18910
|
init_swift_guest_archive();
|
|
@@ -18710,7 +19030,7 @@ async function load(toolchainBin, sdk) {
|
|
|
18710
19030
|
...swiftSdkOptions(),
|
|
18711
19031
|
"--show-configuration",
|
|
18712
19032
|
sdk,
|
|
18713
|
-
"
|
|
19033
|
+
"wasm64-unknown-wasip1"
|
|
18714
19034
|
],
|
|
18715
19035
|
{ env: swiftEnvironment() }
|
|
18716
19036
|
);
|
|
@@ -18804,25 +19124,25 @@ async function swiftIcuBundleAsset(icu) {
|
|
|
18804
19124
|
contentType: "application/octet-stream"
|
|
18805
19125
|
};
|
|
18806
19126
|
}
|
|
18807
|
-
var
|
|
19127
|
+
var import_node_child_process24, import_node_crypto19, import_node_fs43, import_promises4, import_node_os8, import_node_path40, import_node_util8, import_node_zlib2, run5, deflate, compressBrotli, inflateGzip, ARCHIVE, MEMBER, raw, assets, packedFiles;
|
|
18808
19128
|
var init_swift_icu = __esm({
|
|
18809
19129
|
"src/swift-icu.ts"() {
|
|
18810
19130
|
"use strict";
|
|
18811
19131
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
18812
|
-
|
|
19132
|
+
import_node_child_process24 = require("node:child_process");
|
|
18813
19133
|
import_node_crypto19 = require("node:crypto");
|
|
18814
19134
|
import_node_fs43 = require("node:fs");
|
|
18815
19135
|
import_promises4 = require("node:fs/promises");
|
|
18816
19136
|
import_node_os8 = __toESM(require("node:os"), 1);
|
|
18817
19137
|
import_node_path40 = __toESM(require("node:path"), 1);
|
|
18818
|
-
|
|
19138
|
+
import_node_util8 = require("node:util");
|
|
18819
19139
|
import_node_zlib2 = require("node:zlib");
|
|
18820
19140
|
init_icuData();
|
|
18821
19141
|
init_swift_toolchain();
|
|
18822
|
-
run5 = (0,
|
|
18823
|
-
deflate = (0,
|
|
18824
|
-
compressBrotli = (0,
|
|
18825
|
-
inflateGzip = (0,
|
|
19142
|
+
run5 = (0, import_node_util8.promisify)(import_node_child_process24.execFile);
|
|
19143
|
+
deflate = (0, import_node_util8.promisify)(import_node_zlib2.gzip);
|
|
19144
|
+
compressBrotli = (0, import_node_util8.promisify)(import_node_zlib2.brotliCompress);
|
|
19145
|
+
inflateGzip = (0, import_node_util8.promisify)(import_node_zlib2.gunzip);
|
|
18826
19146
|
ARCHIVE = "wasi/lib_FoundationICU.a";
|
|
18827
19147
|
MEMBER = "icu_packaged_data.cpp.obj";
|
|
18828
19148
|
raw = /* @__PURE__ */ new Map();
|
|
@@ -19006,7 +19326,7 @@ function prepareSwiftProjectProcess(root, user) {
|
|
|
19006
19326
|
(0, import_node_fs45.mkdirSync)(tmp, { recursive: true });
|
|
19007
19327
|
const caches = ["cache", "config", "security"].map((name3) => import_node_path42.default.join(swiftpm, name3));
|
|
19008
19328
|
for (const directory2 of caches) (0, import_node_fs45.mkdirSync)(directory2, { recursive: true });
|
|
19009
|
-
(0,
|
|
19329
|
+
(0, import_node_child_process25.execFileSync)("chown", ["-R", "-P", `${user.uid}:${user.gid}`, root, home]);
|
|
19010
19330
|
(0, import_node_fs45.chmodSync)(root, 448);
|
|
19011
19331
|
(0, import_node_fs45.chmodSync)(home, 448);
|
|
19012
19332
|
return {
|
|
@@ -19029,7 +19349,7 @@ function prepareSwiftProjectProcess(root, user) {
|
|
|
19029
19349
|
};
|
|
19030
19350
|
}
|
|
19031
19351
|
function endSwiftProjectProcesses(user) {
|
|
19032
|
-
(0,
|
|
19352
|
+
(0, import_node_child_process25.execFileSync)("sh", ["-c", "kill -s KILL -- -1 2>/dev/null || true"], {
|
|
19033
19353
|
uid: user.uid,
|
|
19034
19354
|
gid: user.gid
|
|
19035
19355
|
});
|
|
@@ -19056,12 +19376,12 @@ function removeProjectLinks(root) {
|
|
|
19056
19376
|
}
|
|
19057
19377
|
}
|
|
19058
19378
|
}
|
|
19059
|
-
var
|
|
19379
|
+
var import_node_child_process25, import_node_fs45, import_node_path42;
|
|
19060
19380
|
var init_swift_project_user = __esm({
|
|
19061
19381
|
"src/swift-project-user.ts"() {
|
|
19062
19382
|
"use strict";
|
|
19063
19383
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
19064
|
-
|
|
19384
|
+
import_node_child_process25 = require("node:child_process");
|
|
19065
19385
|
import_node_fs45 = require("node:fs");
|
|
19066
19386
|
import_node_path42 = __toESM(require("node:path"), 1);
|
|
19067
19387
|
}
|
|
@@ -19256,7 +19576,7 @@ async function withSwiftRootLock(root, work, signal, wait = true) {
|
|
|
19256
19576
|
}
|
|
19257
19577
|
},
|
|
19258
19578
|
spawn(command, args, options, companion) {
|
|
19259
|
-
const child = (0,
|
|
19579
|
+
const child = (0, import_node_child_process26.spawn)(
|
|
19260
19580
|
"/bin/sh",
|
|
19261
19581
|
["-c", 'IFS= read -r go || exit 1; exec "$@" </dev/null', "sh", command, ...args],
|
|
19262
19582
|
{ ...options, detached: true, stdio: ["pipe", "pipe", "pipe"] }
|
|
@@ -19286,12 +19606,12 @@ async function withSwiftRootLock(root, work, signal, wait = true) {
|
|
|
19286
19606
|
(0, import_node_fs47.writeFileSync)(import_node_path43.default.join(directory2, name2(held, "released")), "");
|
|
19287
19607
|
}
|
|
19288
19608
|
}
|
|
19289
|
-
var
|
|
19609
|
+
var import_node_child_process26, import_node_crypto20, import_node_fs47, import_node_os10, import_node_path43, POLL_MS, INSPECT_ATTEMPTS, START_TOLERANCE_MS, name2;
|
|
19290
19610
|
var init_swift_root_lock = __esm({
|
|
19291
19611
|
"src/swift-root-lock.ts"() {
|
|
19292
19612
|
"use strict";
|
|
19293
19613
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
19294
|
-
|
|
19614
|
+
import_node_child_process26 = require("node:child_process");
|
|
19295
19615
|
import_node_crypto20 = require("node:crypto");
|
|
19296
19616
|
import_node_fs47 = require("node:fs");
|
|
19297
19617
|
import_node_os10 = require("node:os");
|
|
@@ -19309,10 +19629,10 @@ var init_swift_root_lock = __esm({
|
|
|
19309
19629
|
function compileUniformTypeConstants(args) {
|
|
19310
19630
|
const source = import_node_path44.default.join(args.packageRoot, "runtime/UniformTypeIdentifiersConstants.m");
|
|
19311
19631
|
const object6 = import_node_path44.default.join(args.out, "UniformTypeIdentifiers-NativeConstants.o");
|
|
19312
|
-
(0,
|
|
19632
|
+
(0, import_node_child_process27.execFileSync)(
|
|
19313
19633
|
import_node_path44.default.join(args.bin, "clang"),
|
|
19314
19634
|
[
|
|
19315
|
-
"--target=
|
|
19635
|
+
"--target=wasm64-unknown-wasip1",
|
|
19316
19636
|
`--sysroot=${args.sysroot}`,
|
|
19317
19637
|
"-Oz",
|
|
19318
19638
|
"-g0",
|
|
@@ -19330,12 +19650,12 @@ function compileUniformTypeConstants(args) {
|
|
|
19330
19650
|
);
|
|
19331
19651
|
return object6;
|
|
19332
19652
|
}
|
|
19333
|
-
var
|
|
19653
|
+
var import_node_child_process27, import_node_path44;
|
|
19334
19654
|
var init_swift_uniform_type_constants = __esm({
|
|
19335
19655
|
"src/swift-uniform-type-constants.ts"() {
|
|
19336
19656
|
"use strict";
|
|
19337
19657
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
19338
|
-
|
|
19658
|
+
import_node_child_process27 = require("node:child_process");
|
|
19339
19659
|
import_node_path44 = __toESM(require("node:path"), 1);
|
|
19340
19660
|
init_swift_objc_runtime();
|
|
19341
19661
|
init_swift_objc_standin();
|
|
@@ -19477,7 +19797,7 @@ async function runCompiler(command, args, options, stream = false, quiet) {
|
|
|
19477
19797
|
detached: true,
|
|
19478
19798
|
stdio: ["ignore", "pipe", "pipe"]
|
|
19479
19799
|
};
|
|
19480
|
-
const child = options.lease ? options.lease.spawn(command, args, launch, options.frameworkLease) : (0,
|
|
19800
|
+
const child = options.lease ? options.lease.spawn(command, args, launch, options.frameworkLease) : (0, import_node_child_process28.spawn)(command, args, launch);
|
|
19481
19801
|
let stopping;
|
|
19482
19802
|
try {
|
|
19483
19803
|
return await new Promise((resolve3, reject) => {
|
|
@@ -19877,10 +20197,11 @@ function swiftCondition(text6, available) {
|
|
|
19877
20197
|
const call = /^(\w+)\s*\(\s*([^,()]*?)\s*(?:,[^()]*)?\)$/.exec(token ?? "");
|
|
19878
20198
|
if (!call) return void 0;
|
|
19879
20199
|
const [, name3, argument] = call;
|
|
19880
|
-
if (name3 === "os") return argument === "iOS"
|
|
19881
|
-
if (name3 === "canImport")
|
|
20200
|
+
if (name3 === "os") return argument === "iOS";
|
|
20201
|
+
if (name3 === "canImport")
|
|
20202
|
+
return argument !== "FoundationNetworking" && available?.has(argument);
|
|
19882
20203
|
if (name3 === "targetEnvironment") return argument === "simulator";
|
|
19883
|
-
if (name3 === "arch") return argument === "
|
|
20204
|
+
if (name3 === "arch") return argument === "wasm64";
|
|
19884
20205
|
return void 0;
|
|
19885
20206
|
};
|
|
19886
20207
|
const both = () => {
|
|
@@ -19948,7 +20269,7 @@ function swiftSdkPaths(moduleRoot, toolchainBin) {
|
|
|
19948
20269
|
const key2 = JSON.stringify([toolchainBin, sdk, options]);
|
|
19949
20270
|
const cached2 = sdkPaths.get(key2);
|
|
19950
20271
|
if (cached2) return cached2;
|
|
19951
|
-
const configuration = (0,
|
|
20272
|
+
const configuration = (0, import_node_child_process28.execFileSync)(
|
|
19952
20273
|
import_node_path47.default.join(toolchainBin, "swift"),
|
|
19953
20274
|
[
|
|
19954
20275
|
"sdk",
|
|
@@ -19956,7 +20277,7 @@ function swiftSdkPaths(moduleRoot, toolchainBin) {
|
|
|
19956
20277
|
...options,
|
|
19957
20278
|
"--show-configuration",
|
|
19958
20279
|
sdk,
|
|
19959
|
-
"
|
|
20280
|
+
"wasm64-unknown-wasip1"
|
|
19960
20281
|
],
|
|
19961
20282
|
{ encoding: "utf8", env: swiftEnvironment(), stdio: ["ignore", "pipe", "pipe"] }
|
|
19962
20283
|
);
|
|
@@ -20257,6 +20578,13 @@ function swiftTargetDependencies(files2, targets, frameworks = OPTIONAL_FRAMEWOR
|
|
|
20257
20578
|
}
|
|
20258
20579
|
return siblings;
|
|
20259
20580
|
}
|
|
20581
|
+
function withPreconcurrencyFoundationModules(source) {
|
|
20582
|
+
if (!PRECONCURRENCY_FOUNDATION_IMPORT.test(source)) return source;
|
|
20583
|
+
return `${source}${source.endsWith("\n") ? "" : "\n"}#if canImport(PeachObjC)
|
|
20584
|
+
${["ObjectiveC", ...FOUNDATION_IMPLICIT_MODULES].map((module2) => `@preconcurrency import ${module2}
|
|
20585
|
+
`).join("")}#endif
|
|
20586
|
+
`;
|
|
20587
|
+
}
|
|
20260
20588
|
function swiftArtifactHash(input, release, moduleRoot) {
|
|
20261
20589
|
const hash = (0, import_node_crypto21.createHash)("sha256");
|
|
20262
20590
|
hash.update(`swift-compile
|
|
@@ -20266,9 +20594,10 @@ ${release}
|
|
|
20266
20594
|
if (input.oneModule) hash.update("one-module\n");
|
|
20267
20595
|
if (KEEP_WASM_NAMES) hash.update("names\n");
|
|
20268
20596
|
hash.update(swiftModuleDigest(moduleRoot));
|
|
20269
|
-
|
|
20270
|
-
${
|
|
20597
|
+
hash.update(`lower
|
|
20598
|
+
${WASM_LOWER_IDENTITY}
|
|
20271
20599
|
`);
|
|
20600
|
+
if (input.optimize) hash.update("optimize\n");
|
|
20272
20601
|
for (const file of Object.keys(input.files).sort()) {
|
|
20273
20602
|
hash.update((0, import_node_crypto21.createHash)("sha256").update(file).digest());
|
|
20274
20603
|
hash.update((0, import_node_crypto21.createHash)("sha256").update(input.files[file]).digest());
|
|
@@ -20440,7 +20769,7 @@ function emitSwiftPackageManifest(args) {
|
|
|
20440
20769
|
(name3) => !object6.startsWith(`lib/${name3}-`) || reachedFrameworks.has(name3)
|
|
20441
20770
|
)
|
|
20442
20771
|
);
|
|
20443
|
-
const
|
|
20772
|
+
const quoted2 = (object6) => `"${import_node_path47.default.join(moduleRoot, object6).replaceAll("\\", "\\\\").replaceAll('"', '\\"')}"`;
|
|
20444
20773
|
const categoryObjects = new Set(
|
|
20445
20774
|
foundationCategoryObjects.map((name3) => `lib/Foundation-${name3}.o`)
|
|
20446
20775
|
);
|
|
@@ -20449,11 +20778,11 @@ function emitSwiftPackageManifest(args) {
|
|
|
20449
20778
|
objects.filter((object6) => roots.has(object6) || categoryObjects.has(object6))
|
|
20450
20779
|
);
|
|
20451
20780
|
const list2 = [
|
|
20452
|
-
...[...eager].map(
|
|
20781
|
+
...[...eager].map(quoted2),
|
|
20453
20782
|
"-Wl,--start-lib",
|
|
20454
|
-
...available.filter((object6) => !eager.has(object6)).map(
|
|
20783
|
+
...available.filter((object6) => !eager.has(object6)).map(quoted2),
|
|
20455
20784
|
"-Wl,--end-lib",
|
|
20456
|
-
...darwinRecordsRegion(distribution.objects.filter(isProvider).map(
|
|
20785
|
+
...darwinRecordsRegion(distribution.objects.filter(isProvider).map(quoted2))
|
|
20457
20786
|
].join("\n") + "\n";
|
|
20458
20787
|
distributionLinkPath = distributionLink.path.replace(
|
|
20459
20788
|
/\.rsp$/,
|
|
@@ -20575,7 +20904,8 @@ function emitSwiftPackageManifest(args) {
|
|
|
20575
20904
|
(value) => value.late?.producers.includes(target.name)
|
|
20576
20905
|
)) ? `, "-emit-objc-header-path", ${JSON.stringify(import_node_path47.default.join(args.headerDirectory, `${target.name}-Swift${args.nativeHeaderDeclarations?.[target.name] ? ".original" : ""}.h`))}` : "";
|
|
20577
20906
|
const clangMode = target.cxxInterop ? "" : ', "-Xcc", "-fno-cxx-modules"';
|
|
20578
|
-
const
|
|
20907
|
+
const deployment = `, "-Xfrontend", "-peach-ios-deployment-target", "-Xfrontend", ${JSON.stringify(target.iosDeploymentTarget ?? SWIFTPM_DEFAULT_IOS_DEPLOYMENT_TARGET)}`;
|
|
20908
|
+
const swiftSettings = `swiftSettings: [.swiftLanguageMode(.v${target.languageMode}),${isolation}${interoperability}${defines}${features}${upcoming} .unsafeFlags(${swiftFlagArray(`["-Osize", "-Xfrontend", "-enable-cross-import-overlays"${overlayFlags}${FOUNDATION_IMPLICIT_FLAGS}${oneModule ? ONE_IMPLICIT_FLAGS : ""}${imports2}${nativeImportFlags}${objcFlags}${header}${clangMode}${deployment}${upstream}]`)})]`;
|
|
20579
20909
|
const deps = [
|
|
20580
20910
|
.../* @__PURE__ */ new Set([
|
|
20581
20911
|
...(target.dependencies ?? []).flatMap(
|
|
@@ -20771,14 +21101,14 @@ function compiledSwiftSources(files2, targets, overlayFrameworks) {
|
|
|
20771
21101
|
);
|
|
20772
21102
|
});
|
|
20773
21103
|
const manifest = /(?:^|\/)Package(?:@swift-[\d.]+)?\.swift$/.test(file);
|
|
20774
|
-
|
|
20775
|
-
file,
|
|
20776
|
-
|
|
20777
|
-
|
|
20778
|
-
|
|
20779
|
-
|
|
20780
|
-
|
|
20781
|
-
];
|
|
21104
|
+
if (manifest && (!owner || /^Package(?:@swift-[\d.]+)?\.swift$/.test(file)))
|
|
21105
|
+
return [file, source];
|
|
21106
|
+
const ios = swiftSourceAsIOS(
|
|
21107
|
+
source,
|
|
21108
|
+
overlayFrameworks,
|
|
21109
|
+
owner?.defines?.includes(SWIFT_XCODE_BUILD_CONDITION) && !owner.defines.includes("SWIFT_PACKAGE") ? false : void 0
|
|
21110
|
+
);
|
|
21111
|
+
return [file, withPreconcurrencyFoundationModules(ios)];
|
|
20782
21112
|
})
|
|
20783
21113
|
);
|
|
20784
21114
|
}
|
|
@@ -20918,16 +21248,22 @@ function foundationOwnerOf(name3) {
|
|
|
20918
21248
|
return "PeachFoundation";
|
|
20919
21249
|
return void 0;
|
|
20920
21250
|
}
|
|
20921
|
-
function
|
|
20922
|
-
|
|
21251
|
+
function swiftPackageSourceAsIOS(source) {
|
|
21252
|
+
return swiftConditionsAsIOS(source, swiftCodeScan(source).lineStarts);
|
|
21253
|
+
}
|
|
21254
|
+
function swiftConditionsAsIOS(source, lineStarts, swiftPackage) {
|
|
20923
21255
|
let offset = 0;
|
|
20924
|
-
|
|
21256
|
+
return source.split("\n").map((line) => {
|
|
20925
21257
|
const start = offset;
|
|
20926
21258
|
offset += line.length + 1;
|
|
20927
21259
|
if (!lineStarts.has(start) || !DIRECTIVE.test(line)) return line;
|
|
20928
|
-
const platform = line.replace(OS_IOS, (match) => "true".padEnd(match.length));
|
|
21260
|
+
const platform = line.replace(OS_IOS, (match) => "true".padEnd(match.length)).replace(NOT_ON_IOS, (match) => "false".padEnd(match.length));
|
|
20929
21261
|
return swiftPackage === false ? platform.replace(/\bSWIFT_PACKAGE\b/g, (match) => "false".padEnd(match.length)) : platform;
|
|
20930
21262
|
}).join("\n");
|
|
21263
|
+
}
|
|
21264
|
+
function swiftSourceAsIOS(source, overlayFrameworks, swiftPackage) {
|
|
21265
|
+
const { lineStarts, tokens: tokens2 } = swiftCodeScan(source);
|
|
21266
|
+
const conditioned = swiftConditionsAsIOS(source, lineStarts, swiftPackage);
|
|
20931
21267
|
let out = "";
|
|
20932
21268
|
let copied = 0;
|
|
20933
21269
|
const sceneLifecycleBodies = /* @__PURE__ */ new Set();
|
|
@@ -22791,8 +23127,15 @@ module ${moduleName}.Swift {
|
|
|
22791
23127
|
}) + moduleFiles
|
|
22792
23128
|
);
|
|
22793
23129
|
}
|
|
22794
|
-
for (const [file, bytes] of Object.entries(input.packageFiles ?? {}))
|
|
22795
|
-
|
|
23130
|
+
for (const [file, bytes] of Object.entries(input.packageFiles ?? {})) {
|
|
23131
|
+
const contents = Buffer.from(bytes, "base64");
|
|
23132
|
+
files2.set(
|
|
23133
|
+
import_node_path47.default.join(layout2.root, file),
|
|
23134
|
+
file.endsWith(".swift") && !/(?:^|\/)Package(?:@swift-[\d.]+)?\.swift$/.test(file) ? withPreconcurrencyFoundationModules(
|
|
23135
|
+
swiftPackageSourceAsIOS(contents.toString("utf8"))
|
|
23136
|
+
) : contents
|
|
23137
|
+
);
|
|
23138
|
+
}
|
|
22796
23139
|
for (const [file, bytes] of Object.entries(input.projectFiles ?? {})) {
|
|
22797
23140
|
const destination = import_node_path47.default.join(layout2.root, file);
|
|
22798
23141
|
if (files2.has(destination)) continue;
|
|
@@ -22809,14 +23152,36 @@ module ${moduleName}.Swift {
|
|
|
22809
23152
|
)
|
|
22810
23153
|
] : []
|
|
22811
23154
|
];
|
|
23155
|
+
const clangWrapper2 = import_node_path47.default.join(layout2.root, CLANG_TARGET_MODULE_WRAPPER);
|
|
23156
|
+
files2.set(
|
|
23157
|
+
clangWrapper2,
|
|
23158
|
+
[
|
|
23159
|
+
"#!/bin/sh",
|
|
23160
|
+
"name=",
|
|
23161
|
+
"prev=",
|
|
23162
|
+
'for arg in "$@"; do',
|
|
23163
|
+
' if [ "$prev" = -o ]; then name=${arg%/*}; name=${name##*/}; fi',
|
|
23164
|
+
" prev=$arg",
|
|
23165
|
+
"done",
|
|
23166
|
+
"case $name in",
|
|
23167
|
+
` *.build) exec '${import_node_path47.default.join(nativeToolchain(), "clang")}' "-fmodule-name=\${name%.build}" "$@" ;;`,
|
|
23168
|
+
` *) exec '${import_node_path47.default.join(nativeToolchain(), "clang")}' "$@" ;;`,
|
|
23169
|
+
"esac",
|
|
23170
|
+
""
|
|
23171
|
+
].join("\n")
|
|
23172
|
+
);
|
|
22812
23173
|
files2.set(
|
|
22813
23174
|
import_node_path47.default.join(layout2.root, ".peach-target-toolset.json"),
|
|
22814
23175
|
JSON.stringify({
|
|
22815
23176
|
schemaVersion: "1.0",
|
|
22816
|
-
|
|
22817
|
-
|
|
22818
|
-
|
|
22819
|
-
|
|
23177
|
+
cCompiler: {
|
|
23178
|
+
extraCLIOptions: [
|
|
23179
|
+
...nativeToolsetFlags,
|
|
23180
|
+
"-fmodules",
|
|
23181
|
+
`-fmodules-cache-path=${import_node_path47.default.join(layout2.root, ".build", "ModuleCache")}`
|
|
23182
|
+
]
|
|
23183
|
+
},
|
|
23184
|
+
...nativeToolsetFlags.length > 0 ? { cxxCompiler: { extraCLIOptions: nativeToolsetFlags } } : {},
|
|
22820
23185
|
swiftCompiler: {
|
|
22821
23186
|
extraCLIOptions: [
|
|
22822
23187
|
...headerAliasFlags.flatMap((flag) => ["-Xcc", flag]),
|
|
@@ -22897,6 +23262,8 @@ module ${moduleName}.Swift {
|
|
|
22897
23262
|
"// dependency targets emit their native compatibility headers.\n"
|
|
22898
23263
|
);
|
|
22899
23264
|
syncSwiftTree(layout2.root, files2);
|
|
23265
|
+
const clangWrapper = import_node_path47.default.join(layout2.root, CLANG_TARGET_MODULE_WRAPPER);
|
|
23266
|
+
if (files2.has(clangWrapper)) (0, import_node_fs50.chmodSync)(clangWrapper, 493);
|
|
22900
23267
|
const dependencies = new Map(
|
|
22901
23268
|
swiftManifestTargets(
|
|
22902
23269
|
(0, import_node_fs50.readFileSync)(import_node_path47.default.join(layout2.root, "Package.swift"), "utf8")
|
|
@@ -23335,6 +23702,9 @@ async function buildFrameworkProducts(scratch2, args) {
|
|
|
23335
23702
|
"release",
|
|
23336
23703
|
"-Xswiftc",
|
|
23337
23704
|
"-Osize",
|
|
23705
|
+
// the release link strips all debug info, so none is generated
|
|
23706
|
+
"-Xswiftc",
|
|
23707
|
+
"-gnone",
|
|
23338
23708
|
"-Xswiftc",
|
|
23339
23709
|
"-num-threads",
|
|
23340
23710
|
"-Xswiftc",
|
|
@@ -23831,12 +24201,13 @@ function compileSwiftProjectOnce(input, options) {
|
|
|
23831
24201
|
] : []
|
|
23832
24202
|
);
|
|
23833
24203
|
const projectProcess = options.project ? prepareSwiftProjectProcess(root, options.project) : void 0;
|
|
24204
|
+
const compiler = preparation.targetToolset ? { CC: import_node_path47.default.join(root, CLANG_TARGET_MODULE_WRAPPER) } : {};
|
|
23834
24205
|
const appOptions = projectProcess ? {
|
|
23835
24206
|
...buildOptions,
|
|
23836
24207
|
uid: projectProcess.uid,
|
|
23837
24208
|
gid: projectProcess.gid,
|
|
23838
|
-
confined: projectProcess.env
|
|
23839
|
-
} : buildOptions;
|
|
24209
|
+
confined: { ...projectProcess.env, ...compiler }
|
|
24210
|
+
} : { ...buildOptions, env: { ...buildOptions.env, ...compiler } };
|
|
23840
24211
|
const unprepared = preparation.targetFailures.map(
|
|
23841
24212
|
(failure2) => `error: target ${failure2}`
|
|
23842
24213
|
);
|
|
@@ -23866,6 +24237,9 @@ function compileSwiftProjectOnce(input, options) {
|
|
|
23866
24237
|
...preparation.targetToolset ? ["--toolset", import_node_path47.default.join(root, ".peach-target-toolset.json")] : [],
|
|
23867
24238
|
"-c",
|
|
23868
24239
|
"release",
|
|
24240
|
+
// the link strips debug info, so none is generated (as for the framework)
|
|
24241
|
+
"-Xswiftc",
|
|
24242
|
+
"-gnone",
|
|
23869
24243
|
"-Xswiftc",
|
|
23870
24244
|
"-num-threads",
|
|
23871
24245
|
"-Xswiftc",
|
|
@@ -24043,16 +24417,15 @@ function compileSwiftProjectOnce(input, options) {
|
|
|
24043
24417
|
output: output2,
|
|
24044
24418
|
optimized
|
|
24045
24419
|
});
|
|
24046
|
-
else
|
|
24047
|
-
const executable = input.optimize ? optimized : output2;
|
|
24420
|
+
else await lowerWasm(output2, optimized, { optimize: input.optimize === true });
|
|
24048
24421
|
await runCompiler(
|
|
24049
24422
|
import_node_path47.default.join(options.toolchainBin, "llvm-objcopy"),
|
|
24050
|
-
["--remove-section=.swift1_autolink_entries",
|
|
24423
|
+
["--remove-section=.swift1_autolink_entries", optimized],
|
|
24051
24424
|
buildOptions
|
|
24052
24425
|
);
|
|
24053
24426
|
const artifact = {
|
|
24054
24427
|
hash,
|
|
24055
|
-
bytes: (0, import_node_fs50.readFileSync)(
|
|
24428
|
+
bytes: (0, import_node_fs50.readFileSync)(optimized),
|
|
24056
24429
|
icu: await icu
|
|
24057
24430
|
};
|
|
24058
24431
|
if (artifact.bytes.length <= 8)
|
|
@@ -24069,12 +24442,12 @@ function compileSwiftProjectOnce(input, options) {
|
|
|
24069
24442
|
options.signal
|
|
24070
24443
|
);
|
|
24071
24444
|
}
|
|
24072
|
-
var
|
|
24445
|
+
var import_node_child_process28, import_node_crypto21, import_node_fs50, import_node_os11, import_node_path47, v5, WASM_TRIPLE, SWIFTPM_PROGRESS, SWIFTPM_NOISE, SWIFT_BUILDER_TRANSPORT_MARGIN_MS, SWIFT_BUILDER_DEFAULT_COMPILE_MS, clangInterfaceHeader, swiftInterfaceDeclarations, linkedModuleDigests, SYSTEM_MODULE_LIBRARIES, SYSTEM_MODULE_IMPORT, OPTIONAL_FRAMEWORK_DEPENDENCIES, OPTIONAL_FRAMEWORKS, SWIFT_IMPORT, kleeneNot, kleeneAnd, kleeneOr, sdkPaths, availableModules, sdkOverlayFrameworks, DISTRIBUTION_CLANG_MODULES, ONE_PRODUCT, GAME_FAMILY, gameProducts, gameProduct, GAME_REACH, FOUNDATION_IMPLICIT_MODULES, PRECONCURRENCY_FOUNDATION_IMPORT, FOUNDATION_IMPLICIT_FLAGS, ONE_IMPLICIT_FLAGS, executableLinkFlags, darwinRecordsRegion, REACTOR_FLAG, MULTI_MANIFEST_VERSION, SWIFT_HEADER_PRODUCTS_TARGET, compilerSourceDigest, nativeCxxCompilerFlags, cFlagArray, cxxFlagArray, SWIFTPM_DEFAULT_IOS_DEPLOYMENT_TARGET, DIRECTIVE, OS_IOS, NOT_ON_IOS, DELEGATE_CLASS, FOUNDATION_NETWORKING_TYPES, FOUNDATION_OVERLAY_TYPES, FOUNDATION_OVERLAY_GLOBALS, CORE_FOUNDATION_OVERLAY_GLOBALS, CORE_FOUNDATION_GEOMETRY_TYPES, CORE_FOUNDATION_GRAPHICS_TYPES, CORE_FOUNDATION_HANDLE_IMPORTS, emptyMacroEnvironment, wasmMacroEnvironment, HIDDEN_UNITS, LIBXML_REFERENCE, LIBXML_SOURCE, ROOT_LOCKS, host, rootLocks, SHARED_ARTIFACT_BUDGET_BYTES, SHARED_ARTIFACT_GRACE_MS, RETIRED_PREFIX, retainedArtifacts, FRAMEWORK_LINK_TARGET, SWIFT_LINK_STAMP, SWIFT_FRAMEWORK_SLOTS, SWIFT_FRAMEWORK_SLOT_KEY, SWIFT_FRAMEWORK_SLOT_ORIGIN;
|
|
24073
24446
|
var init_swift_compile = __esm({
|
|
24074
24447
|
"src/swift-compile.ts"() {
|
|
24075
24448
|
"use strict";
|
|
24076
24449
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
24077
|
-
|
|
24450
|
+
import_node_child_process28 = require("node:child_process");
|
|
24078
24451
|
import_node_crypto21 = require("node:crypto");
|
|
24079
24452
|
import_node_fs50 = require("node:fs");
|
|
24080
24453
|
import_node_os11 = __toESM(require("node:os"), 1);
|
|
@@ -24089,6 +24462,7 @@ var init_swift_compile = __esm({
|
|
|
24089
24462
|
init_swift_distribution_contract();
|
|
24090
24463
|
init_swift_foundation();
|
|
24091
24464
|
init_swift_guest_compile();
|
|
24465
|
+
init_swift_guest_source_inputs();
|
|
24092
24466
|
init_swift_icu();
|
|
24093
24467
|
init_swift_link_roots();
|
|
24094
24468
|
init_swift_objc_import();
|
|
@@ -24107,7 +24481,7 @@ var init_swift_compile = __esm({
|
|
|
24107
24481
|
init_wasm_optimize();
|
|
24108
24482
|
init_write_build_file();
|
|
24109
24483
|
init_xcode_header_search();
|
|
24110
|
-
WASM_TRIPLE = "
|
|
24484
|
+
WASM_TRIPLE = "wasm64-unknown-wasip1";
|
|
24111
24485
|
SWIFTPM_PROGRESS = /^\[\d+\/\d+\] /;
|
|
24112
24486
|
SWIFTPM_NOISE = /^(?:\[\d+\/\d+\] |Building for production\.\.\.$|warning: '--build-system native' has been deprecated)/;
|
|
24113
24487
|
SWIFT_BUILDER_TRANSPORT_MARGIN_MS = 3e5;
|
|
@@ -24278,6 +24652,7 @@ int EXUpdatesApplyBSDiffPatch(const char * _Nonnull oldFilePath,
|
|
|
24278
24652
|
"PeachFoundationCombine",
|
|
24279
24653
|
"Darwin"
|
|
24280
24654
|
];
|
|
24655
|
+
PRECONCURRENCY_FOUNDATION_IMPORT = /^[ \t]*@preconcurrency[ \t]+(?:(?:public|package|internal|fileprivate|private)[ \t]+)?import[ \t]+(?:Foundation|UIKit|SwiftUI)[ \t]*(?:\/\/.*)?$/m;
|
|
24281
24656
|
FOUNDATION_IMPLICIT_FLAGS = FOUNDATION_IMPLICIT_MODULES.map(
|
|
24282
24657
|
(module2) => `, "-Xfrontend", "-import-module", "-Xfrontend", "${module2}"`
|
|
24283
24658
|
).join("");
|
|
@@ -24293,16 +24668,18 @@ int EXUpdatesApplyBSDiffPatch(const char * _Nonnull oldFilePath,
|
|
|
24293
24668
|
"-Xlinker", "--wrap=swift_udata_open",
|
|
24294
24669
|
"-Xlinker", "--wrap=swift_udata_openChoice",
|
|
24295
24670
|
`;
|
|
24296
|
-
darwinRecordsRegion = (
|
|
24671
|
+
darwinRecordsRegion = (quoted2) => quoted2.length ? ["-Wl,--start-lib", ...quoted2, "-Wl,--end-lib"] : [];
|
|
24297
24672
|
REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
24298
24673
|
MULTI_MANIFEST_VERSION = 68;
|
|
24299
24674
|
SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
|
|
24300
|
-
compilerSourceDigest = true ? "
|
|
24675
|
+
compilerSourceDigest = true ? "645b0e6bc4e374f7c82da4d402e0ec9ddedfc49d6e5a74b73284852f1fbd4efc" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
|
|
24301
24676
|
nativeCxxCompilerFlags = ["-fno-cxx-modules"];
|
|
24302
24677
|
cFlagArray = (flags) => JSON.stringify(withoutGlogModuleMap(flags));
|
|
24303
24678
|
cxxFlagArray = (flags) => JSON.stringify([...nativeCxxCompilerFlags, ...withoutGlogModuleMap(flags)]);
|
|
24679
|
+
SWIFTPM_DEFAULT_IOS_DEPLOYMENT_TARGET = "12.0";
|
|
24304
24680
|
DIRECTIVE = /^[ \t]*#(?:if|elseif)\b/;
|
|
24305
24681
|
OS_IOS = /\b(?:os\(\s*iOS\s*\)|targetEnvironment\(\s*simulator\s*\))/g;
|
|
24682
|
+
NOT_ON_IOS = /\b(?:os\(\s*WASI\s*\)|canImport\(\s*FoundationNetworking\s*\))/g;
|
|
24306
24683
|
DELEGATE_CLASS = /^class\s+[A-Za-z_]\w*\s*(?:<[^>{]*>)?\s*:[^{]*\b(?:UIApplicationDelegate|UISceneDelegate|UIWindowSceneDelegate)\b[^{]*\{/;
|
|
24307
24684
|
FOUNDATION_NETWORKING_TYPES = /* @__PURE__ */ new Set([
|
|
24308
24685
|
"NSURLConnection",
|
|
@@ -24824,7 +25201,7 @@ int EXUpdatesApplyBSDiffPatch(const char * _Nonnull oldFilePath,
|
|
|
24824
25201
|
...emptyMacroEnvironment,
|
|
24825
25202
|
defines: /* @__PURE__ */ new Map([
|
|
24826
25203
|
["__wasm__", "1"],
|
|
24827
|
-
["
|
|
25204
|
+
["__wasm64__", "1"],
|
|
24828
25205
|
["__wasi__", "1"]
|
|
24829
25206
|
])
|
|
24830
25207
|
};
|
|
@@ -24985,7 +25362,7 @@ var init_swiftNativePinContract = __esm({
|
|
|
24985
25362
|
init_nitroAdapterContract();
|
|
24986
25363
|
init_swift_distribution_contract();
|
|
24987
25364
|
SWIFT_NATIVE_PIN_PATH = "node/swift-native.json";
|
|
24988
|
-
SWIFT_NATIVE_PIN_SCHEMA =
|
|
25365
|
+
SWIFT_NATIVE_PIN_SCHEMA = 3;
|
|
24989
25366
|
DIGEST = /^[a-f0-9]{64}$/;
|
|
24990
25367
|
}
|
|
24991
25368
|
});
|
|
@@ -25329,7 +25706,7 @@ function dumpInputs(dir) {
|
|
|
25329
25706
|
path: command,
|
|
25330
25707
|
realpath: import_node_fs52.default.realpathSync(command),
|
|
25331
25708
|
sha256: (0, import_node_crypto22.createHash)("sha256").update(import_node_fs52.default.readFileSync(command)).digest("hex"),
|
|
25332
|
-
version: (0,
|
|
25709
|
+
version: (0, import_node_child_process29.execFileSync)(command, ["--version"], {
|
|
25333
25710
|
encoding: "utf8",
|
|
25334
25711
|
env: swiftEnvironment(),
|
|
25335
25712
|
stdio: ["ignore", "pipe", "pipe"]
|
|
@@ -25392,7 +25769,7 @@ function dump(dir, requirePrepared = false) {
|
|
|
25392
25769
|
if (requirePrepared) throw new SwiftManifestPreparationRequired(dir);
|
|
25393
25770
|
let output2;
|
|
25394
25771
|
try {
|
|
25395
|
-
output2 = (0,
|
|
25772
|
+
output2 = (0, import_node_child_process29.execFileSync)(
|
|
25396
25773
|
command,
|
|
25397
25774
|
[
|
|
25398
25775
|
"package",
|
|
@@ -25531,7 +25908,10 @@ function swiftPackageManifest(dir, platform = GUEST_PLATFORMS, requirePrepared =
|
|
|
25531
25908
|
(highest, mode) => Number(mode) > Number(highest) ? mode : highest
|
|
25532
25909
|
) : tools >= 6 ? "6" : tools >= 5 ? "5" : string4(record(raw2.toolsVersion)._version) ?? "unknown";
|
|
25533
25910
|
let mainActorIsolation = false;
|
|
25534
|
-
const defines = []
|
|
25911
|
+
const defines = [...traits].map((name5) => ({
|
|
25912
|
+
name: name5,
|
|
25913
|
+
configuration: null
|
|
25914
|
+
}));
|
|
25535
25915
|
const libraries = [];
|
|
25536
25916
|
const frameworks = [];
|
|
25537
25917
|
const experimentalFeatures = [];
|
|
@@ -25769,7 +26149,7 @@ async function resolveSwiftPackageRequirementsAsync(requirements, destination, s
|
|
|
25769
26149
|
const { dir, args, options, failed, publish } = resolveRequest(requirements);
|
|
25770
26150
|
try {
|
|
25771
26151
|
try {
|
|
25772
|
-
await (0,
|
|
26152
|
+
await (0, import_node_util9.promisify)(import_node_child_process29.execFile)(swiftCommand(), args, { ...options, signal });
|
|
25773
26153
|
} catch (error) {
|
|
25774
26154
|
throw failed(error);
|
|
25775
26155
|
}
|
|
@@ -25810,17 +26190,17 @@ function swiftTargetFiles(manifest, target) {
|
|
|
25810
26190
|
}
|
|
25811
26191
|
return [...new Set(files2)].sort();
|
|
25812
26192
|
}
|
|
25813
|
-
var
|
|
26193
|
+
var import_node_child_process29, import_node_crypto22, import_node_fs52, import_node_os13, import_node_path49, import_node_util9, TARGET_TYPES, targetRelative, isTargetType, record, array3, string4, cacheDir3, evaluated, execFileAsync, cachedToolchain, SwiftManifestPreparationRequired, manifestPreparations, GUEST_PLATFORMS, within, requirementClause;
|
|
25814
26194
|
var init_swift_package_manifest = __esm({
|
|
25815
26195
|
"src/swift-package-manifest.ts"() {
|
|
25816
26196
|
"use strict";
|
|
25817
26197
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
25818
|
-
|
|
26198
|
+
import_node_child_process29 = require("node:child_process");
|
|
25819
26199
|
import_node_crypto22 = require("node:crypto");
|
|
25820
26200
|
import_node_fs52 = __toESM(require("node:fs"), 1);
|
|
25821
26201
|
import_node_os13 = __toESM(require("node:os"), 1);
|
|
25822
26202
|
import_node_path49 = __toESM(require("node:path"), 1);
|
|
25823
|
-
|
|
26203
|
+
import_node_util9 = require("node:util");
|
|
25824
26204
|
init_home_paths();
|
|
25825
26205
|
init_swift_distribution();
|
|
25826
26206
|
init_swift_native_pin();
|
|
@@ -25842,7 +26222,7 @@ var init_swift_package_manifest = __esm({
|
|
|
25842
26222
|
string4 = (value) => typeof value === "string" ? value : void 0;
|
|
25843
26223
|
cacheDir3 = import_node_path49.default.join(cacheDir(), "swift-manifests");
|
|
25844
26224
|
evaluated = /* @__PURE__ */ new Map();
|
|
25845
|
-
execFileAsync = (0,
|
|
26225
|
+
execFileAsync = (0, import_node_util9.promisify)(import_node_child_process29.execFile);
|
|
25846
26226
|
SwiftManifestPreparationRequired = class extends Error {
|
|
25847
26227
|
constructor(dir) {
|
|
25848
26228
|
super(`swift package manifest requires preparation: ${dir}`);
|
|
@@ -26587,7 +26967,7 @@ function targetSettings(ref, configuration, builtins, options = {}, overrides =
|
|
|
26587
26967
|
const derivedSettings = {
|
|
26588
26968
|
DEVELOPER_DIR: () => options.environment?.DEVELOPER_DIR ?? process.env.DEVELOPER_DIR ?? (developerDir ??= process.platform === "darwin" ? (
|
|
26589
26969
|
// runner-toolchain-platform: darwin
|
|
26590
|
-
(0,
|
|
26970
|
+
(0, import_node_child_process30.execFileSync)("xcode-select", ["-p"], {
|
|
26591
26971
|
encoding: "utf8",
|
|
26592
26972
|
stdio: ["ignore", "pipe", "pipe"]
|
|
26593
26973
|
}).trim()
|
|
@@ -26628,7 +27008,7 @@ function settingList(value) {
|
|
|
26628
27008
|
items2.push(
|
|
26629
27009
|
word.replace(
|
|
26630
27010
|
/"((?:\\.|[^"\\])*)"|\\(.)/g,
|
|
26631
|
-
(_,
|
|
27011
|
+
(_, quoted2, escaped) => quoted2 !== void 0 ? quoted2.replace(/\\(.)/g, "$1") : escaped
|
|
26632
27012
|
)
|
|
26633
27013
|
);
|
|
26634
27014
|
return items2;
|
|
@@ -26880,17 +27260,17 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
26880
27260
|
);
|
|
26881
27261
|
});
|
|
26882
27262
|
}
|
|
26883
|
-
const
|
|
27263
|
+
const signature2 = (0, import_node_crypto23.createHash)("sha256").update(
|
|
26884
27264
|
JSON.stringify([phase, [...settingKeys].map((key3) => [key3, settings(key3)])])
|
|
26885
27265
|
);
|
|
26886
27266
|
for (const file of inputFiles) {
|
|
26887
|
-
|
|
27267
|
+
signature2.update(file);
|
|
26888
27268
|
if (import_node_fs53.default.existsSync(file)) {
|
|
26889
27269
|
const stat = import_node_fs53.default.statSync(file);
|
|
26890
|
-
|
|
26891
|
-
} else
|
|
27270
|
+
signature2.update(`${stat.mtimeMs}:${stat.ctimeMs}:${stat.size}`);
|
|
27271
|
+
} else signature2.update("missing");
|
|
26892
27272
|
}
|
|
26893
|
-
const stamp =
|
|
27273
|
+
const stamp = signature2.digest("hex");
|
|
26894
27274
|
const key2 = `${project.projectFile}:${targetId}:${phaseId}:${settings("CONFIGURATION")}`;
|
|
26895
27275
|
if (preparedSourcePhases.get(key2) === stamp && allOutputs.every((file) => import_node_fs53.default.existsSync(file))) {
|
|
26896
27276
|
preparedXcodePhase(
|
|
@@ -26921,7 +27301,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
26921
27301
|
str(phase.shellPath) ?? "/bin/sh",
|
|
26922
27302
|
str(phase.shellScript) ?? ""
|
|
26923
27303
|
);
|
|
26924
|
-
(0,
|
|
27304
|
+
(0, import_node_child_process30.execFileSync)(shell, args, {
|
|
26925
27305
|
cwd: project.projectDir,
|
|
26926
27306
|
env,
|
|
26927
27307
|
stdio: ["ignore", "pipe", "pipe"],
|
|
@@ -27029,7 +27409,7 @@ ${output2}`
|
|
|
27029
27409
|
const families = settings("TARGETED_DEVICE_FAMILY").split(",").map((value) => value.trim());
|
|
27030
27410
|
if (families.includes("1")) args.push("--target-device", "iphone");
|
|
27031
27411
|
if (families.includes("2")) args.push("--target-device", "ipad");
|
|
27032
|
-
(0,
|
|
27412
|
+
(0, import_node_child_process30.execFileSync)("xcrun", args, {
|
|
27033
27413
|
cwd: project.projectDir,
|
|
27034
27414
|
stdio: ["ignore", "pipe", "pipe"],
|
|
27035
27415
|
timeout: runScriptTimeoutMs
|
|
@@ -27074,7 +27454,7 @@ ${output2}`
|
|
|
27074
27454
|
args.push("-swiftVersion", settings("SWIFT_VERSION") || "5.0");
|
|
27075
27455
|
if (settings("DEFINES_MODULE") === "YES")
|
|
27076
27456
|
args.push("-moduleName", settings("PRODUCT_MODULE_NAME"));
|
|
27077
|
-
(0,
|
|
27457
|
+
(0, import_node_child_process30.execFileSync)("xcrun", args, {
|
|
27078
27458
|
cwd: project.projectDir,
|
|
27079
27459
|
stdio: ["ignore", "pipe", "pipe"],
|
|
27080
27460
|
timeout: runScriptTimeoutMs
|
|
@@ -27646,7 +28026,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
27646
28026
|
languageMode: swiftVersion >= 6 ? 6 : 5,
|
|
27647
28027
|
mainActorIsolation: settings2("SWIFT_DEFAULT_ACTOR_ISOLATION") === "MainActor",
|
|
27648
28028
|
defines: compilationConditions(settings2),
|
|
27649
|
-
iosDeploymentTarget: settings2("IPHONEOS_DEPLOYMENT_TARGET") ||
|
|
28029
|
+
iosDeploymentTarget: settings2("IPHONEOS_DEPLOYMENT_TARGET") || XCODE_DEFAULT_IOS_DEPLOYMENT_TARGET,
|
|
27650
28030
|
assetSettings: {
|
|
27651
28031
|
IPHONEOS_DEPLOYMENT_TARGET: XCODE_DEFAULT_IOS_DEPLOYMENT_TARGET,
|
|
27652
28032
|
...Object.fromEntries(
|
|
@@ -27913,11 +28293,12 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
27913
28293
|
info[key2.slice("INFOPLIST_KEY_".length)] = value === "YES" ? true : value === "NO" ? false : value;
|
|
27914
28294
|
}
|
|
27915
28295
|
if (settings("GENERATE_INFOPLIST_FILE") === "YES") {
|
|
27916
|
-
const
|
|
28296
|
+
const generated = {
|
|
28297
|
+
CFBundleDevelopmentRegion: "DEVELOPMENT_LANGUAGE",
|
|
27917
28298
|
CFBundleShortVersionString: "MARKETING_VERSION",
|
|
27918
28299
|
CFBundleVersion: "CURRENT_PROJECT_VERSION"
|
|
27919
28300
|
};
|
|
27920
|
-
for (const [key2, setting] of Object.entries(
|
|
28301
|
+
for (const [key2, setting] of Object.entries(generated)) {
|
|
27921
28302
|
const value = settings(setting);
|
|
27922
28303
|
if (info[key2] === void 0 && value) info[key2] = value;
|
|
27923
28304
|
}
|
|
@@ -28276,12 +28657,12 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
28276
28657
|
cocoapods
|
|
28277
28658
|
};
|
|
28278
28659
|
}
|
|
28279
|
-
var
|
|
28660
|
+
var import_node_child_process30, import_node_crypto23, import_node_fs53, import_node_path51, import_plist2, XCODE_DEFAULT_IOS_DEPLOYMENT_TARGET, runScriptTimeoutMs, CXX_STANDARD_ALIASES, PRE_CXX20_STANDARDS, APPLICATION, RESOURCE_BUNDLE, PRODUCT_MACH_O_TYPES, FRAMEWORK_PRODUCTS, HEADER_FILE, MODULE_PRODUCTS, CONDITIONS, isDirectory, loaded, preparedSourcePhases, isPodsProject, targetRefs, workspaceResolvedFile, SwiftPackageResolutionRequired;
|
|
28280
28661
|
var init_xcode_project = __esm({
|
|
28281
28662
|
"src/xcode-project.ts"() {
|
|
28282
28663
|
"use strict";
|
|
28283
28664
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
28284
|
-
|
|
28665
|
+
import_node_child_process30 = require("node:child_process");
|
|
28285
28666
|
import_node_crypto23 = require("node:crypto");
|
|
28286
28667
|
import_node_fs53 = __toESM(require("node:fs"), 1);
|
|
28287
28668
|
import_node_path51 = __toESM(require("node:path"), 1);
|
|
@@ -28428,7 +28809,7 @@ var init_swift_standin_digest = __esm({
|
|
|
28428
28809
|
STANDIN_DIGEST_ENTRYPOINTS = ["swift-standins.ts", "swift-objc-compile.ts"];
|
|
28429
28810
|
SPECIFIER = /from\s*['"]([^'"]+)['"]|import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
|
|
28430
28811
|
standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS);
|
|
28431
|
-
STANDIN_SOURCE_DIGEST = true ? "
|
|
28812
|
+
STANDIN_SOURCE_DIGEST = true ? "7ad2d908aa8d716181e88c4bc1a8e1fb721aa69e8090d0d7ad5851f9b8de0944" : standinSourceDigest();
|
|
28432
28813
|
}
|
|
28433
28814
|
});
|
|
28434
28815
|
|
|
@@ -28755,7 +29136,7 @@ function nativeStaticLibraryEntry(recipe2, compiler, sdk, distribution) {
|
|
|
28755
29136
|
sdk: sdk.wasmSdkId,
|
|
28756
29137
|
sdkChecksum: sdk.wasmSdkChecksum,
|
|
28757
29138
|
distribution,
|
|
28758
|
-
target: "
|
|
29139
|
+
target: "wasm64-wasip1",
|
|
28759
29140
|
features: "exception_handling"
|
|
28760
29141
|
};
|
|
28761
29142
|
return { name: recipe2.name, inputs, key: nativeEntryKey(inputs) };
|
|
@@ -28793,7 +29174,7 @@ function combineNativeStaticLibraries(files2, moduleRoot) {
|
|
|
28793
29174
|
import_node_fs66.default.mkdirSync(directory2, { recursive: true });
|
|
28794
29175
|
const temporary = import_node_path64.default.join(directory2, `combined-${(0, import_node_crypto32.randomUUID)()}.a`);
|
|
28795
29176
|
try {
|
|
28796
|
-
(0,
|
|
29177
|
+
(0, import_node_child_process34.execFileSync)(import_node_path64.default.join(toolchain.toolchainBin, "llvm-ar"), [
|
|
28797
29178
|
"qcsDL",
|
|
28798
29179
|
temporary,
|
|
28799
29180
|
...files2
|
|
@@ -28804,12 +29185,12 @@ function combineNativeStaticLibraries(files2, moduleRoot) {
|
|
|
28804
29185
|
}
|
|
28805
29186
|
return archive;
|
|
28806
29187
|
}
|
|
28807
|
-
var
|
|
29188
|
+
var import_node_child_process34, import_node_crypto32, import_node_fs66, import_node_path64, NATIVE_STATIC_LIBRARY_RECIPES;
|
|
28808
29189
|
var init_native_static_libraries = __esm({
|
|
28809
29190
|
"src/native-static-libraries.ts"() {
|
|
28810
29191
|
"use strict";
|
|
28811
29192
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
28812
|
-
|
|
29193
|
+
import_node_child_process34 = require("node:child_process");
|
|
28813
29194
|
import_node_crypto32 = require("node:crypto");
|
|
28814
29195
|
import_node_fs66 = __toESM(require("node:fs"), 1);
|
|
28815
29196
|
import_node_path64 = __toESM(require("node:path"), 1);
|
|
@@ -28824,7 +29205,7 @@ var init_native_static_libraries = __esm({
|
|
|
28824
29205
|
name: "libsodium",
|
|
28825
29206
|
nativeSha256: "4e5112bdb787a4305ddb8e464a129d4f002c2f0be5a62eb541b5122b769fc17a",
|
|
28826
29207
|
upstream: "ebb65ef6ca439333c2bb41a0c1990587288da07f6c7fd07cb3a18cc18d30ce19",
|
|
28827
|
-
recipe: "
|
|
29208
|
+
recipe: "0e5d450f381952394e6c2c4ec1126536150b18fd24576fc5303f0cb9e9bfc6bc",
|
|
28828
29209
|
archive: "libsodium.a"
|
|
28829
29210
|
},
|
|
28830
29211
|
{
|
|
@@ -28832,7 +29213,7 @@ var init_native_static_libraries = __esm({
|
|
|
28832
29213
|
nativeSha256: "474dff8315a8e4d3a6fdd9f89c7264c79c5f84a5b9acbfdfb9fb0ee68d8c801e",
|
|
28833
29214
|
upstream: "520ba083085a14efcb77d701b35544f81d7b1acf",
|
|
28834
29215
|
// updated with the native producer sources and port patches.
|
|
28835
|
-
recipe: "
|
|
29216
|
+
recipe: "06b6385b341b2eaf49c754ffb285ed18b6988a207a20ce89d3a9fa7782f1c7a6",
|
|
28836
29217
|
archive: "libmoonshine_core.a"
|
|
28837
29218
|
},
|
|
28838
29219
|
{
|
|
@@ -28840,14 +29221,14 @@ var init_native_static_libraries = __esm({
|
|
|
28840
29221
|
nativeSha256: "b91cd08892ebe0cdd39e1336594bb66cd79fc639a894303805792047d24f468b",
|
|
28841
29222
|
upstream: "ed59cc48e37ac33ac15b252fc5ad7af4b9ecd51d",
|
|
28842
29223
|
// updated with the native producer script and port patches.
|
|
28843
|
-
recipe: "
|
|
29224
|
+
recipe: "cea231f8139cf2b44a3f2b309ce8a99b9ee3e3ff52b5120780bc5969a22f8059",
|
|
28844
29225
|
archive: "libessentia.a"
|
|
28845
29226
|
},
|
|
28846
29227
|
{
|
|
28847
29228
|
name: "anydoc_mobile",
|
|
28848
29229
|
nativeSha256: "03b721dd9e98ec2767f7952aa65cde57d0c33d7ec80c9aaf7ab5ba77e055a25c",
|
|
28849
29230
|
upstream: "e41ad6375fd80b64c4183d1a3f901d1f640a7953",
|
|
28850
|
-
recipe: "
|
|
29231
|
+
recipe: "9e451f5c558362620be86f7c6c4d52a0d7ed7194ccc9ea5a9d29dfd410f95057",
|
|
28851
29232
|
archive: "libanydoc_mobile.a"
|
|
28852
29233
|
},
|
|
28853
29234
|
{
|
|
@@ -28855,14 +29236,14 @@ var init_native_static_libraries = __esm({
|
|
|
28855
29236
|
nativeSha256: "8c41abcd8dd4e562e65cf5b88467a3493089c359d0863360dc65a5b88149e837",
|
|
28856
29237
|
upstream: "a4296fa21cd40a56543602511bcf417014f4fee7cf5e1eaab58e0ac9610e3f63",
|
|
28857
29238
|
// the unchanged source build, pinned Rust release and committed Cargo.lock.
|
|
28858
|
-
recipe: "
|
|
29239
|
+
recipe: "3923ea147f25e83a2688150afe1d26b6134e12833693b3fc1aca63033fcd1750",
|
|
28859
29240
|
archive: "libratex_ffi.a"
|
|
28860
29241
|
},
|
|
28861
29242
|
{
|
|
28862
29243
|
name: "ratex_ffi_0_1_14",
|
|
28863
29244
|
nativeSha256: "bdd2bf679fcc981d98d36733b3bd083225a7397bb82bbd462c89088c6e0580a8",
|
|
28864
29245
|
upstream: "2da907eb5dfcb464c7eef3b4c657fbdee144e3c6633e81efb1e56dcf1c76e01b",
|
|
28865
|
-
recipe: "
|
|
29246
|
+
recipe: "2a9ca604065f0e6908100835789eeecb1d5d7d750d3ec0ca288a01795642fa6f",
|
|
28866
29247
|
archive: "libratex_ffi.a"
|
|
28867
29248
|
},
|
|
28868
29249
|
// react-native-skia 2.14.0 (apple-ios 154.0.0), then 3.8.0 (157): installed apps pin either.
|
|
@@ -28870,112 +29251,112 @@ var init_native_static_libraries = __esm({
|
|
|
28870
29251
|
name: "skia",
|
|
28871
29252
|
nativeSha256: "5312f2b194b1f6b6721388028bf919e56400278245b039f47136aa98f0582333",
|
|
28872
29253
|
upstream: "9f9e6beb751091ef69163d2b4fdcd1e711b594ac",
|
|
28873
|
-
recipe: "
|
|
29254
|
+
recipe: "91591e98be98542547d3ea972803b7929675c3569d98c7a3d92d266896f84545",
|
|
28874
29255
|
archive: "libskia.a"
|
|
28875
29256
|
},
|
|
28876
29257
|
{
|
|
28877
29258
|
name: "skia_svg",
|
|
28878
29259
|
nativeSha256: "77adc498cff85db7850fb713c306681c6337f9b4ec42991b3764c8f3eff9d8d0",
|
|
28879
29260
|
upstream: "9f9e6beb751091ef69163d2b4fdcd1e711b594ac",
|
|
28880
|
-
recipe: "
|
|
29261
|
+
recipe: "91591e98be98542547d3ea972803b7929675c3569d98c7a3d92d266896f84545",
|
|
28881
29262
|
archive: "libsvg.a"
|
|
28882
29263
|
},
|
|
28883
29264
|
{
|
|
28884
29265
|
name: "skia_skshaper",
|
|
28885
29266
|
nativeSha256: "830bcf260bd24fd79ee5d323e26ec667638795e3a0e555f1093371b8342c345c",
|
|
28886
29267
|
upstream: "9f9e6beb751091ef69163d2b4fdcd1e711b594ac",
|
|
28887
|
-
recipe: "
|
|
29268
|
+
recipe: "91591e98be98542547d3ea972803b7929675c3569d98c7a3d92d266896f84545",
|
|
28888
29269
|
archive: "libskshaper.a"
|
|
28889
29270
|
},
|
|
28890
29271
|
{
|
|
28891
29272
|
name: "skia_skparagraph",
|
|
28892
29273
|
nativeSha256: "26afd4e5b11d46b0820a2cd7fd9918eb5a041946e1a1c0d4b91a5d54877e9dda",
|
|
28893
29274
|
upstream: "9f9e6beb751091ef69163d2b4fdcd1e711b594ac",
|
|
28894
|
-
recipe: "
|
|
29275
|
+
recipe: "91591e98be98542547d3ea972803b7929675c3569d98c7a3d92d266896f84545",
|
|
28895
29276
|
archive: "libskparagraph.a"
|
|
28896
29277
|
},
|
|
28897
29278
|
{
|
|
28898
29279
|
name: "skia_skunicode_core",
|
|
28899
29280
|
nativeSha256: "629f58c4e81157d42e353b2b255bebb2fd94d1f31d8f8157e982fa4367710526",
|
|
28900
29281
|
upstream: "9f9e6beb751091ef69163d2b4fdcd1e711b594ac",
|
|
28901
|
-
recipe: "
|
|
29282
|
+
recipe: "91591e98be98542547d3ea972803b7929675c3569d98c7a3d92d266896f84545",
|
|
28902
29283
|
archive: "libskunicode_core.a"
|
|
28903
29284
|
},
|
|
28904
29285
|
{
|
|
28905
29286
|
name: "skia_skunicode_libgrapheme",
|
|
28906
29287
|
nativeSha256: "047bd82306ba688453a3ff9dc02e203cdf16f2084551cca54f5d2b099baf1895",
|
|
28907
29288
|
upstream: "9f9e6beb751091ef69163d2b4fdcd1e711b594ac",
|
|
28908
|
-
recipe: "
|
|
29289
|
+
recipe: "91591e98be98542547d3ea972803b7929675c3569d98c7a3d92d266896f84545",
|
|
28909
29290
|
archive: "libskunicode_libgrapheme.a"
|
|
28910
29291
|
},
|
|
28911
29292
|
{
|
|
28912
29293
|
name: "skia_skottie",
|
|
28913
29294
|
nativeSha256: "75c0dfd82a256e761cddc45475b8109ed8c9a442767cf3a8bf8720eef0dd4af7",
|
|
28914
29295
|
upstream: "9f9e6beb751091ef69163d2b4fdcd1e711b594ac",
|
|
28915
|
-
recipe: "
|
|
29296
|
+
recipe: "91591e98be98542547d3ea972803b7929675c3569d98c7a3d92d266896f84545",
|
|
28916
29297
|
archive: "libskottie.a"
|
|
28917
29298
|
},
|
|
28918
29299
|
{
|
|
28919
29300
|
name: "skia_sksg",
|
|
28920
29301
|
nativeSha256: "df9652a46505d3c5c74d55b52295ef39218d2b5856e074117461fa2348312c8d",
|
|
28921
29302
|
upstream: "9f9e6beb751091ef69163d2b4fdcd1e711b594ac",
|
|
28922
|
-
recipe: "
|
|
29303
|
+
recipe: "91591e98be98542547d3ea972803b7929675c3569d98c7a3d92d266896f84545",
|
|
28923
29304
|
archive: "libsksg.a"
|
|
28924
29305
|
},
|
|
28925
29306
|
{
|
|
28926
29307
|
name: "skia",
|
|
28927
29308
|
nativeSha256: "c9b007c4da16f66d84b2f108af719b424ef91ee0759e58df0b76930bc6f82e31",
|
|
28928
29309
|
upstream: "b94213a11b3a2edadfae89f0c57a7f4ab72772c9",
|
|
28929
|
-
recipe: "
|
|
29310
|
+
recipe: "91591e98be98542547d3ea972803b7929675c3569d98c7a3d92d266896f84545",
|
|
28930
29311
|
archive: "libskia.a"
|
|
28931
29312
|
},
|
|
28932
29313
|
{
|
|
28933
29314
|
name: "skia_svg",
|
|
28934
29315
|
nativeSha256: "159705737769610b60216b114a28ba833840aa1df7833424df99edec4405b86f",
|
|
28935
29316
|
upstream: "b94213a11b3a2edadfae89f0c57a7f4ab72772c9",
|
|
28936
|
-
recipe: "
|
|
29317
|
+
recipe: "91591e98be98542547d3ea972803b7929675c3569d98c7a3d92d266896f84545",
|
|
28937
29318
|
archive: "libsvg.a"
|
|
28938
29319
|
},
|
|
28939
29320
|
{
|
|
28940
29321
|
name: "skia_skshaper",
|
|
28941
29322
|
nativeSha256: "934f3dbf3f38bca87b463b664a17c1588840f86ec89cf6961fb2a89b6336b35b",
|
|
28942
29323
|
upstream: "b94213a11b3a2edadfae89f0c57a7f4ab72772c9",
|
|
28943
|
-
recipe: "
|
|
29324
|
+
recipe: "91591e98be98542547d3ea972803b7929675c3569d98c7a3d92d266896f84545",
|
|
28944
29325
|
archive: "libskshaper.a"
|
|
28945
29326
|
},
|
|
28946
29327
|
{
|
|
28947
29328
|
name: "skia_skparagraph",
|
|
28948
29329
|
nativeSha256: "29a48349fc9b75c252b22fc6ca5ade90636900f82beec58780f03fd66ab345b3",
|
|
28949
29330
|
upstream: "b94213a11b3a2edadfae89f0c57a7f4ab72772c9",
|
|
28950
|
-
recipe: "
|
|
29331
|
+
recipe: "91591e98be98542547d3ea972803b7929675c3569d98c7a3d92d266896f84545",
|
|
28951
29332
|
archive: "libskparagraph.a"
|
|
28952
29333
|
},
|
|
28953
29334
|
{
|
|
28954
29335
|
name: "skia_skunicode_core",
|
|
28955
29336
|
nativeSha256: "096e5139c4de528dbba5a9605895f4c725853e48225503bdfa9c1d70241e5f58",
|
|
28956
29337
|
upstream: "b94213a11b3a2edadfae89f0c57a7f4ab72772c9",
|
|
28957
|
-
recipe: "
|
|
29338
|
+
recipe: "91591e98be98542547d3ea972803b7929675c3569d98c7a3d92d266896f84545",
|
|
28958
29339
|
archive: "libskunicode_core.a"
|
|
28959
29340
|
},
|
|
28960
29341
|
{
|
|
28961
29342
|
name: "skia_skunicode_libgrapheme",
|
|
28962
29343
|
nativeSha256: "d1ec3c2d5ad6889eb4fbf4a6bab74f39946739501d40de903f7d8cb2181ac37d",
|
|
28963
29344
|
upstream: "b94213a11b3a2edadfae89f0c57a7f4ab72772c9",
|
|
28964
|
-
recipe: "
|
|
29345
|
+
recipe: "91591e98be98542547d3ea972803b7929675c3569d98c7a3d92d266896f84545",
|
|
28965
29346
|
archive: "libskunicode_libgrapheme.a"
|
|
28966
29347
|
},
|
|
28967
29348
|
{
|
|
28968
29349
|
name: "skia_skottie",
|
|
28969
29350
|
nativeSha256: "52ea2e046f45f51df6027d783e923864e8c4ef94a1fe4fc5971e436574d8ae57",
|
|
28970
29351
|
upstream: "b94213a11b3a2edadfae89f0c57a7f4ab72772c9",
|
|
28971
|
-
recipe: "
|
|
29352
|
+
recipe: "91591e98be98542547d3ea972803b7929675c3569d98c7a3d92d266896f84545",
|
|
28972
29353
|
archive: "libskottie.a"
|
|
28973
29354
|
},
|
|
28974
29355
|
{
|
|
28975
29356
|
name: "skia_sksg",
|
|
28976
29357
|
nativeSha256: "541a74d8f83dc411efe8eeac377486a5054fab4c7710afe406a20a27efe8f627",
|
|
28977
29358
|
upstream: "b94213a11b3a2edadfae89f0c57a7f4ab72772c9",
|
|
28978
|
-
recipe: "
|
|
29359
|
+
recipe: "91591e98be98542547d3ea972803b7929675c3569d98c7a3d92d266896f84545",
|
|
28979
29360
|
archive: "libsksg.a"
|
|
28980
29361
|
},
|
|
28981
29362
|
{
|
|
@@ -29466,7 +29847,7 @@ function resolveSwiftPackages(options) {
|
|
|
29466
29847
|
const gap = options.binaryGaps?.get(name3);
|
|
29467
29848
|
const unlowerable = unlowerableSources(files2, target, portableAssembly);
|
|
29468
29849
|
const placeholder = placeholderPackage(pkg);
|
|
29469
|
-
const ownReason = target.type === "binary" ? `${name3} ${BINARY}${gap ? `; ${gap}` : ""}` : placeholder && gap ? `${name3} stands in as a placeholder (${placeholder}), and ${gap}` : target.type !== "regular" && target.type !== "system" ? `${name3} is a ${target.type} target` : unlowerable.length > 0 ? `${name3} has native sources with no
|
|
29850
|
+
const ownReason = target.type === "binary" ? `${name3} ${BINARY}${gap ? `; ${gap}` : ""}` : placeholder && gap ? `${name3} stands in as a placeholder (${placeholder}), and ${gap}` : target.type !== "regular" && target.type !== "system" ? `${name3} is a ${target.type} target` : unlowerable.length > 0 ? `${name3} has native sources with no wasm lowering: ${unlowerable.map((file) => import_node_path66.default.relative(pkg.manifest.dir, file)).join(", ")}${gap ? `; ${gap}` : ""}` : null;
|
|
29470
29851
|
const reasons = target.dependencies.map((dependency) => {
|
|
29471
29852
|
if (dependency.kind === "target") return resolveTarget(pkg, dependency.name);
|
|
29472
29853
|
const nested = resolveDependencyProduct(pkg, dependency);
|
|
@@ -29841,17 +30222,17 @@ function resolveSwiftPackages(options) {
|
|
|
29841
30222
|
result.nativeProducts.push({ name: name3, packageDir: manifest.dir, source });
|
|
29842
30223
|
return result;
|
|
29843
30224
|
}
|
|
29844
|
-
var
|
|
30225
|
+
var import_node_child_process35, import_node_crypto34, import_node_fs68, import_node_path66, import_promises7, import_node_util13, swiftBinaryOnDisk, SWIFT_PLACEHOLDER_PACKAGES, placeholderPackage, UNSUPPORTED_NATIVE, BINARY, blockers, verified, execFileAsync2, checkoutKey;
|
|
29845
30226
|
var init_swift_packages = __esm({
|
|
29846
30227
|
"src/swift-packages.ts"() {
|
|
29847
30228
|
"use strict";
|
|
29848
30229
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
29849
|
-
|
|
30230
|
+
import_node_child_process35 = require("node:child_process");
|
|
29850
30231
|
import_node_crypto34 = require("node:crypto");
|
|
29851
30232
|
import_node_fs68 = __toESM(require("node:fs"), 1);
|
|
29852
30233
|
import_node_path66 = __toESM(require("node:path"), 1);
|
|
29853
30234
|
import_promises7 = require("node:timers/promises");
|
|
29854
|
-
|
|
30235
|
+
import_node_util13 = require("node:util");
|
|
29855
30236
|
init_home_paths();
|
|
29856
30237
|
init_native_git();
|
|
29857
30238
|
init_numbered_lock();
|
|
@@ -29867,7 +30248,7 @@ var init_swift_packages = __esm({
|
|
|
29867
30248
|
BINARY = "is a binary framework";
|
|
29868
30249
|
blockers = (reasons) => [...new Set(reasons.flat())];
|
|
29869
30250
|
verified = /* @__PURE__ */ new Set();
|
|
29870
|
-
execFileAsync2 = (0,
|
|
30251
|
+
execFileAsync2 = (0, import_node_util13.promisify)(import_node_child_process35.execFile);
|
|
29871
30252
|
checkoutKey = (dir, pin2) => `${dir}\0${pin2.revision}`;
|
|
29872
30253
|
}
|
|
29873
30254
|
});
|
|
@@ -29878,11 +30259,12 @@ function nativeSliceEntry(recipe2, release, sdk) {
|
|
|
29878
30259
|
library: recipe2.name,
|
|
29879
30260
|
upstream: recipe2.upstream,
|
|
29880
30261
|
recipe: recipe2.source,
|
|
30262
|
+
port: recipe2.port,
|
|
29881
30263
|
zig: recipe2.zig,
|
|
29882
30264
|
compiler: release,
|
|
29883
30265
|
sdk: sdk.wasmSdkId,
|
|
29884
30266
|
sdkChecksum: sdk.wasmSdkChecksum,
|
|
29885
|
-
target: "
|
|
30267
|
+
target: "wasm64-wasip1",
|
|
29886
30268
|
features: "generic+exception_handling"
|
|
29887
30269
|
};
|
|
29888
30270
|
return { name: recipe2.name, inputs, key: nativeEntryKey(inputs) };
|
|
@@ -29898,11 +30280,11 @@ var init_native_slices = __esm({
|
|
|
29898
30280
|
name: "GhosttyKit",
|
|
29899
30281
|
upstream: "cf8edc23f3a6a87a96e41a90013e89e987d34980",
|
|
29900
30282
|
source: "da78a502b56fd20f349bf029df8e76ed7c458007",
|
|
30283
|
+
port: "f4f9162f713b9ab15e0e44499e6878608e48b23e75d7833012aecf0a61ac83ba",
|
|
29901
30284
|
repository: "https://github.com/natew/ghostty.git",
|
|
29902
30285
|
zig: "0.16.0",
|
|
29903
30286
|
pinFile: "VERSION",
|
|
29904
30287
|
archive: "libghostty.a",
|
|
29905
|
-
buildScript: "./wasi/build.sh",
|
|
29906
30288
|
output: "zig-out/lib/ghostty-internal.a"
|
|
29907
30289
|
}
|
|
29908
30290
|
};
|
|
@@ -29921,7 +30303,7 @@ function nativeSwiftSliceEntry(distribution, generator) {
|
|
|
29921
30303
|
sdk: distribution.wasmSdkId,
|
|
29922
30304
|
sdkChecksum: distribution.wasmSdkChecksum,
|
|
29923
30305
|
distribution: distribution.id,
|
|
29924
|
-
target: "
|
|
30306
|
+
target: "wasm64-wasip1"
|
|
29925
30307
|
};
|
|
29926
30308
|
return { name: SENTRY_SWIFT_SLICE.name, inputs, key: nativeEntryKey(inputs) };
|
|
29927
30309
|
}
|
|
@@ -29937,7 +30319,7 @@ function privateSentrySlice(entry, moduleRoot) {
|
|
|
29937
30319
|
const staging = import_node_fs69.default.mkdtempSync(import_node_path67.default.join(import_node_fs69.default.realpathSync(import_node_os15.default.tmpdir()), "sentry-slice-"));
|
|
29938
30320
|
try {
|
|
29939
30321
|
process.stderr.write("peach: building the Sentry slice for a private distribution\u2026\n");
|
|
29940
|
-
(0,
|
|
30322
|
+
(0, import_node_child_process36.execFileSync)("bun", [script, "--output", staging, "--module-root", moduleRoot], {
|
|
29941
30323
|
stdio: ["ignore", 2, 2]
|
|
29942
30324
|
});
|
|
29943
30325
|
return installNativeEntry(
|
|
@@ -30008,12 +30390,12 @@ function nativeSwiftSlice(standin, moduleRoot, generator, configured, artifact)
|
|
|
30008
30390
|
}
|
|
30009
30391
|
};
|
|
30010
30392
|
}
|
|
30011
|
-
var
|
|
30393
|
+
var import_node_child_process36, import_node_crypto35, import_node_fs69, import_node_os15, import_node_path67, SENTRY_SWIFT_SLICE;
|
|
30012
30394
|
var init_native_swift_slices = __esm({
|
|
30013
30395
|
"src/native-swift-slices.ts"() {
|
|
30014
30396
|
"use strict";
|
|
30015
30397
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
30016
|
-
|
|
30398
|
+
import_node_child_process36 = require("node:child_process");
|
|
30017
30399
|
import_node_crypto35 = require("node:crypto");
|
|
30018
30400
|
import_node_fs69 = __toESM(require("node:fs"), 1);
|
|
30019
30401
|
import_node_os15 = __toESM(require("node:os"), 1);
|
|
@@ -30029,7 +30411,7 @@ var init_native_swift_slices = __esm({
|
|
|
30029
30411
|
checksum: "17b5cdca223d333f21609c59b97afe26b964eddba3b89186033386d7ba22024d",
|
|
30030
30412
|
nativeSha256: "c0935ec6243f706cafa25666fe53267ae166e43d49771240d88ae9f5b0886671",
|
|
30031
30413
|
url: "https://github.com/getsentry/sentry-cocoa/releases/download/9.8.0/Sentry.xcframework.zip",
|
|
30032
|
-
recipe: "
|
|
30414
|
+
recipe: "498cf5669d04ec9dad226f4da3d929b58c842cf410de51601a4bb874969b9652"
|
|
30033
30415
|
};
|
|
30034
30416
|
}
|
|
30035
30417
|
});
|
|
@@ -30299,7 +30681,7 @@ async function emitCxxStandin(input) {
|
|
|
30299
30681
|
);
|
|
30300
30682
|
const flags = [
|
|
30301
30683
|
"-target",
|
|
30302
|
-
"
|
|
30684
|
+
"wasm64-unknown-wasip1",
|
|
30303
30685
|
"--sysroot",
|
|
30304
30686
|
input.sysroot,
|
|
30305
30687
|
...WASI_EMULATION_FLAGS,
|
|
@@ -30307,7 +30689,7 @@ async function emitCxxStandin(input) {
|
|
|
30307
30689
|
"-I",
|
|
30308
30690
|
input.headers
|
|
30309
30691
|
];
|
|
30310
|
-
const includes = (0,
|
|
30692
|
+
const includes = (0, import_node_child_process37.spawnSync)(input.clang, [...flags, "-M", "-MT", "peach", probe], {
|
|
30311
30693
|
encoding: "utf8",
|
|
30312
30694
|
env: swiftEnvironment(),
|
|
30313
30695
|
maxBuffer: 16 * 1024 * 1024
|
|
@@ -30327,7 +30709,7 @@ async function emitCxxStandin(input) {
|
|
|
30327
30709
|
const output2 = import_node_fs72.default.openSync(ast, "w");
|
|
30328
30710
|
let parsed;
|
|
30329
30711
|
try {
|
|
30330
|
-
parsed = (0,
|
|
30712
|
+
parsed = (0, import_node_child_process37.spawnSync)(
|
|
30331
30713
|
input.clang,
|
|
30332
30714
|
[...flags, "-fsyntax-only", "-Xclang", "-ast-dump=json", probe],
|
|
30333
30715
|
{ stdio: ["ignore", output2, "pipe"], encoding: "utf8", env: swiftEnvironment() }
|
|
@@ -30385,7 +30767,7 @@ async function emitCxxStandin(input) {
|
|
|
30385
30767
|
sourceFile,
|
|
30386
30768
|
[...prelude, ...live.map((item) => item.text)].join("\n") + "\n"
|
|
30387
30769
|
);
|
|
30388
|
-
const checked = (0,
|
|
30770
|
+
const checked = (0, import_node_child_process37.spawnSync)(
|
|
30389
30771
|
input.clang,
|
|
30390
30772
|
[
|
|
30391
30773
|
...flags,
|
|
@@ -30419,12 +30801,12 @@ async function emitCxxStandin(input) {
|
|
|
30419
30801
|
excluded
|
|
30420
30802
|
};
|
|
30421
30803
|
}
|
|
30422
|
-
var
|
|
30804
|
+
var import_node_child_process37, import_node_fs72, import_node_path69, QUALIFIERS, UNNAMEABLE;
|
|
30423
30805
|
var init_swift_cxx_standin = __esm({
|
|
30424
30806
|
"src/swift-cxx-standin.ts"() {
|
|
30425
30807
|
"use strict";
|
|
30426
30808
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
30427
|
-
|
|
30809
|
+
import_node_child_process37 = require("node:child_process");
|
|
30428
30810
|
import_node_fs72 = __toESM(require("node:fs"), 1);
|
|
30429
30811
|
import_node_path69 = __toESM(require("node:path"), 1);
|
|
30430
30812
|
init_swift_cxx_declarations();
|
|
@@ -30677,7 +31059,7 @@ var init_swift_standin_builtin_behavior = __esm({
|
|
|
30677
31059
|
|
|
30678
31060
|
// src/swift-standins.ts
|
|
30679
31061
|
function exec(file, args, cwd) {
|
|
30680
|
-
return (0,
|
|
31062
|
+
return (0, import_node_child_process38.execFileSync)(file, args, {
|
|
30681
31063
|
cwd,
|
|
30682
31064
|
encoding: "utf8",
|
|
30683
31065
|
env: swiftEnvironment(),
|
|
@@ -31361,7 +31743,7 @@ function placeholderStandin(surface, binary2, toolchain, work, behavior, sibling
|
|
|
31361
31743
|
const out = import_node_path70.default.join(work, "graphs");
|
|
31362
31744
|
import_node_fs73.default.mkdirSync(import_node_path70.default.join(work, "interface"), { recursive: true });
|
|
31363
31745
|
import_node_fs73.default.mkdirSync(out, { recursive: true });
|
|
31364
|
-
const extracted = (0,
|
|
31746
|
+
const extracted = (0, import_node_child_process38.spawnSync)(
|
|
31365
31747
|
import_node_path70.default.join(toolchain.toolchainBin, "swiftc"),
|
|
31366
31748
|
[
|
|
31367
31749
|
"-emit-module",
|
|
@@ -31762,7 +32144,7 @@ function graphStandin(module2, graphs, values, wasm, binary2, toolchain, work, r
|
|
|
31762
32144
|
);
|
|
31763
32145
|
}
|
|
31764
32146
|
import_node_fs73.default.writeFileSync(file, source + trailer);
|
|
31765
|
-
const check2 = (0,
|
|
32147
|
+
const check2 = (0, import_node_child_process38.spawnSync)(
|
|
31766
32148
|
import_node_path70.default.join(toolchain.toolchainBin, "swiftc"),
|
|
31767
32149
|
// emitting the module runs the diagnostics a typecheck skips, such as
|
|
31768
32150
|
// literal overflow, which the app's build of the stand-in reaches
|
|
@@ -32039,13 +32421,13 @@ ${roots.map((file) => ` header "${file}"
|
|
|
32039
32421
|
group.forEach((declaration, index) => {
|
|
32040
32422
|
if (seen.has(declaration.name)) return;
|
|
32041
32423
|
seen.add(declaration.name);
|
|
32042
|
-
const
|
|
32424
|
+
const signature2 = withVoidPrototype(
|
|
32043
32425
|
declarators[index].trim(),
|
|
32044
32426
|
declaration.name,
|
|
32045
32427
|
declaration.parameterless
|
|
32046
32428
|
);
|
|
32047
32429
|
definitions.push(
|
|
32048
|
-
`${
|
|
32430
|
+
`${signature2} {
|
|
32049
32431
|
peach_standin_trap("${declaration.name}");
|
|
32050
32432
|
}
|
|
32051
32433
|
`
|
|
@@ -32123,7 +32505,7 @@ async function cxxStandin(surface, binary2, toolchain, work) {
|
|
|
32123
32505
|
roots.map((root) => `#include ${JSON.stringify(root)}
|
|
32124
32506
|
`).join("")
|
|
32125
32507
|
);
|
|
32126
|
-
const language = (0,
|
|
32508
|
+
const language = (0, import_node_child_process38.spawnSync)(
|
|
32127
32509
|
import_node_path70.default.join(toolchain.toolchainBin, "clang"),
|
|
32128
32510
|
[
|
|
32129
32511
|
"-target",
|
|
@@ -32213,7 +32595,7 @@ function crateFor(root, name3) {
|
|
|
32213
32595
|
};
|
|
32214
32596
|
return walk3(root, 4);
|
|
32215
32597
|
}
|
|
32216
|
-
function
|
|
32598
|
+
function crateWorkspace(manifest) {
|
|
32217
32599
|
let workspace = import_node_path70.default.dirname(manifest);
|
|
32218
32600
|
while (!import_node_fs73.default.existsSync(import_node_path70.default.join(workspace, "Cargo.lock"))) {
|
|
32219
32601
|
const parent = import_node_path70.default.dirname(workspace);
|
|
@@ -32221,8 +32603,13 @@ function crateSourceRoots(manifest) {
|
|
|
32221
32603
|
throw new Error(`${manifest} has no Cargo.lock; the build runs --locked`);
|
|
32222
32604
|
workspace = parent;
|
|
32223
32605
|
}
|
|
32224
|
-
|
|
32225
|
-
|
|
32606
|
+
return workspace;
|
|
32607
|
+
}
|
|
32608
|
+
function crateSourceRoots(manifest, searchRoot) {
|
|
32609
|
+
const workspace = crateWorkspace(manifest);
|
|
32610
|
+
const root = import_node_path70.default.resolve(searchRoot);
|
|
32611
|
+
const roots = import_node_path70.default.relative(root, workspace).startsWith("..") ? [root, workspace] : [root];
|
|
32612
|
+
const inside = (dir) => roots.some((root2) => !import_node_path70.default.relative(root2, dir).startsWith(".."));
|
|
32226
32613
|
const manifests = (dir) => import_node_fs73.default.readdirSync(dir, { withFileTypes: true }).flatMap(
|
|
32227
32614
|
(entry) => entry.isDirectory() && !UNSEARCHED.has(entry.name) ? manifests(import_node_path70.default.join(dir, entry.name)) : entry.name === "Cargo.toml" ? [import_node_path70.default.join(dir, entry.name)] : []
|
|
32228
32615
|
);
|
|
@@ -32236,7 +32623,7 @@ function crateSourceRoots(manifest) {
|
|
|
32236
32623
|
}
|
|
32237
32624
|
return roots;
|
|
32238
32625
|
}
|
|
32239
|
-
function crateSourceDigest(manifest) {
|
|
32626
|
+
function crateSourceDigest(manifest, searchRoot) {
|
|
32240
32627
|
const hash = (0, import_node_crypto36.createHash)("sha256");
|
|
32241
32628
|
const walk3 = (dir, root) => {
|
|
32242
32629
|
for (const entry of import_node_fs73.default.readdirSync(dir, { withFileTypes: true }).sort((left, right) => left.name < right.name ? -1 : 1)) {
|
|
@@ -32250,20 +32637,21 @@ function crateSourceDigest(manifest) {
|
|
|
32250
32637
|
}
|
|
32251
32638
|
}
|
|
32252
32639
|
};
|
|
32253
|
-
for (const root of crateSourceRoots(manifest)) {
|
|
32640
|
+
for (const root of crateSourceRoots(manifest, searchRoot)) {
|
|
32254
32641
|
hash.update(`root\0`);
|
|
32255
32642
|
walk3(root, root);
|
|
32256
32643
|
}
|
|
32257
32644
|
return hash.digest("hex");
|
|
32258
32645
|
}
|
|
32259
|
-
function rustCrateEntry(manifest, library) {
|
|
32646
|
+
function rustCrateEntry(manifest, library, moduleRoot, searchRoot) {
|
|
32260
32647
|
const inputs = {
|
|
32261
32648
|
crate: library,
|
|
32262
|
-
source: crateSourceDigest(manifest),
|
|
32649
|
+
source: crateSourceDigest(manifest, searchRoot),
|
|
32263
32650
|
target: RUST_TARGET,
|
|
32264
|
-
build: "release locked",
|
|
32265
|
-
|
|
32266
|
-
|
|
32651
|
+
build: "release locked panic=abort",
|
|
32652
|
+
compiler: swiftModuleToolchain(moduleRoot).release,
|
|
32653
|
+
sdk: swiftModuleSdk(moduleRoot).wasmSdkChecksum,
|
|
32654
|
+
rust: RUST_TOOLCHAIN
|
|
32267
32655
|
};
|
|
32268
32656
|
return { name: library, inputs, key: nativeEntryKey(inputs) };
|
|
32269
32657
|
}
|
|
@@ -32302,82 +32690,91 @@ function standinLibrary(binary2, searchRoot, toolchain) {
|
|
|
32302
32690
|
}
|
|
32303
32691
|
const manifest = crateFor(searchRoot, import_node_path70.default.basename(library, ".a").replace(/^lib/, ""));
|
|
32304
32692
|
if (!manifest) return null;
|
|
32305
|
-
|
|
32693
|
+
if (!toolchain) throw new Error("Rust native libraries need the Swift SDK");
|
|
32694
|
+
const entry = rustCrateEntry(manifest, library, toolchain.moduleRoot, searchRoot);
|
|
32306
32695
|
const prebuilt = fetchNativeEntry("rust", entry.name, entry.key);
|
|
32307
32696
|
if (prebuilt) return import_node_path70.default.join(prebuilt, library);
|
|
32308
|
-
return buildRustCrate(manifest, library, searchRoot);
|
|
32697
|
+
return buildRustCrate(manifest, library, searchRoot, toolchain.moduleRoot, entry);
|
|
32309
32698
|
}
|
|
32310
|
-
function buildRustCrate(manifest, library, searchRoot) {
|
|
32311
|
-
const
|
|
32312
|
-
const
|
|
32313
|
-
|
|
32314
|
-
|
|
32315
|
-
|
|
32316
|
-
|
|
32317
|
-
|
|
32318
|
-
|
|
32319
|
-
|
|
32320
|
-
|
|
32321
|
-
|
|
32322
|
-
|
|
32323
|
-
"
|
|
32324
|
-
|
|
32325
|
-
|
|
32326
|
-
|
|
32327
|
-
|
|
32328
|
-
|
|
32329
|
-
|
|
32699
|
+
function buildRustCrate(manifest, library, searchRoot, moduleRoot, entry = rustCrateEntry(manifest, library, moduleRoot, searchRoot)) {
|
|
32700
|
+
const compiler = swiftModuleToolchain(moduleRoot);
|
|
32701
|
+
const sdk = swiftModuleSdk(moduleRoot);
|
|
32702
|
+
const sdkRoot = import_node_path70.default.dirname(swiftSdkPaths(moduleRoot, compiler.toolchainBin).sysroot);
|
|
32703
|
+
const runner = import_node_path70.default.join(sdkRoot, "rust/scripts/build-rust-wasm64.mjs");
|
|
32704
|
+
const work = import_node_path70.default.join(cacheDir4, "rust", entry.key);
|
|
32705
|
+
const release = tryAcquireNumberedLock(work + ".lock", manifest);
|
|
32706
|
+
if (!release) throw new Error("Rust native build already running: " + manifest);
|
|
32707
|
+
try {
|
|
32708
|
+
const roots = crateSourceRoots(manifest, searchRoot);
|
|
32709
|
+
let common = roots[0];
|
|
32710
|
+
while (roots.some((root) => {
|
|
32711
|
+
const relative3 = import_node_path70.default.relative(common, root);
|
|
32712
|
+
return relative3 === ".." || relative3.startsWith(".." + import_node_path70.default.sep);
|
|
32713
|
+
}))
|
|
32714
|
+
common = import_node_path70.default.dirname(common);
|
|
32715
|
+
const source = import_node_path70.default.join(work, "source");
|
|
32716
|
+
import_node_fs73.default.rmSync(source, { recursive: true, force: true });
|
|
32717
|
+
for (const root of roots)
|
|
32718
|
+
import_node_fs73.default.cpSync(root, import_node_path70.default.join(source, import_node_path70.default.relative(common, root)), {
|
|
32719
|
+
recursive: true,
|
|
32720
|
+
filter: (file) => !UNSEARCHED.has(import_node_path70.default.basename(file))
|
|
32721
|
+
});
|
|
32722
|
+
const privateManifest = import_node_path70.default.join(source, import_node_path70.default.relative(common, manifest));
|
|
32723
|
+
const lock = import_node_path70.default.join(
|
|
32724
|
+
source,
|
|
32725
|
+
import_node_path70.default.relative(common, crateWorkspace(manifest)),
|
|
32726
|
+
"Cargo.lock"
|
|
32330
32727
|
);
|
|
32331
|
-
|
|
32332
|
-
|
|
32333
|
-
|
|
32334
|
-
|
|
32335
|
-
|
|
32336
|
-
|
|
32337
|
-
|
|
32338
|
-
|
|
32339
|
-
|
|
32340
|
-
|
|
32341
|
-
|
|
32342
|
-
|
|
32343
|
-
|
|
32344
|
-
|
|
32345
|
-
|
|
32346
|
-
|
|
32347
|
-
|
|
32348
|
-
|
|
32349
|
-
|
|
32350
|
-
|
|
32351
|
-
|
|
32352
|
-
|
|
32353
|
-
|
|
32354
|
-
|
|
32355
|
-
|
|
32356
|
-
|
|
32357
|
-
|
|
32358
|
-
|
|
32359
|
-
`${crate} is a rust crate and cargo is not installed; install rust (https://rustup.rs), then run again`
|
|
32728
|
+
const result = (0, import_node_child_process38.spawnSync)(
|
|
32729
|
+
process.execPath,
|
|
32730
|
+
[
|
|
32731
|
+
runner,
|
|
32732
|
+
"--bin",
|
|
32733
|
+
compiler.toolchainBin,
|
|
32734
|
+
"--sdk",
|
|
32735
|
+
sdkRoot,
|
|
32736
|
+
"--sdk-checksum",
|
|
32737
|
+
sdk.wasmSdkChecksum,
|
|
32738
|
+
"--work",
|
|
32739
|
+
import_node_path70.default.join(work, "toolchain"),
|
|
32740
|
+
"--manifest",
|
|
32741
|
+
privateManifest,
|
|
32742
|
+
"--lock",
|
|
32743
|
+
lock,
|
|
32744
|
+
"--panic",
|
|
32745
|
+
"abort",
|
|
32746
|
+
"--cargo-arg=--locked",
|
|
32747
|
+
"--cargo-arg=--jobs",
|
|
32748
|
+
"--cargo-arg=" + (process.env.TM_EXEC_CPU_CORES ?? "1")
|
|
32749
|
+
],
|
|
32750
|
+
{
|
|
32751
|
+
encoding: "utf8",
|
|
32752
|
+
env: { ...swiftEnvironment(), [PEACH_FORKED_SCRIPT_ENV]: "1" },
|
|
32753
|
+
maxBuffer: 256 * 1024 * 1024,
|
|
32754
|
+
stdio: ["ignore", "pipe", "pipe"]
|
|
32755
|
+
}
|
|
32360
32756
|
);
|
|
32361
|
-
|
|
32362
|
-
if (
|
|
32757
|
+
if (result.error) throw result.error;
|
|
32758
|
+
if (result.status !== 0)
|
|
32363
32759
|
throw new Error(
|
|
32364
|
-
|
|
32760
|
+
`Rust wasm64 could not build ${import_node_path70.default.relative(searchRoot, manifest)}: ${failure(result)}`
|
|
32365
32761
|
);
|
|
32762
|
+
for (const line of result.stdout.split("\n")) {
|
|
32763
|
+
if (!line.startsWith("{")) continue;
|
|
32764
|
+
const message = JSON.parse(line);
|
|
32765
|
+
if (!message || typeof message !== "object" || !("filenames" in message) || !Array.isArray(message.filenames))
|
|
32766
|
+
continue;
|
|
32767
|
+
const archive = message.filenames.find(
|
|
32768
|
+
(file) => typeof file === "string" && import_node_path70.default.basename(file) === library
|
|
32769
|
+
);
|
|
32770
|
+
if (archive) return archive;
|
|
32771
|
+
}
|
|
32366
32772
|
throw new Error(
|
|
32367
|
-
`cargo
|
|
32773
|
+
`cargo built ${manifest} for ${RUST_TARGET} but reported no ${library}`
|
|
32368
32774
|
);
|
|
32775
|
+
} finally {
|
|
32776
|
+
release();
|
|
32369
32777
|
}
|
|
32370
|
-
for (const line of result.stdout.split("\n")) {
|
|
32371
|
-
if (!line.startsWith("{")) continue;
|
|
32372
|
-
const message = JSON.parse(line);
|
|
32373
|
-
if (!message || typeof message !== "object" || !("filenames" in message) || !Array.isArray(message.filenames))
|
|
32374
|
-
continue;
|
|
32375
|
-
const archive = message.filenames.find(
|
|
32376
|
-
(file) => typeof file === "string" && import_node_path70.default.basename(file) === library
|
|
32377
|
-
);
|
|
32378
|
-
if (archive) return archive;
|
|
32379
|
-
}
|
|
32380
|
-
throw new Error(`cargo built ${crate} for ${RUST_TARGET} but reported no ${library}`);
|
|
32381
32778
|
}
|
|
32382
32779
|
async function sourceStandins(binaries, toolchain, provided, behavior) {
|
|
32383
32780
|
const repo = import_node_path70.default.resolve(toolchain.moduleRoot, "../..");
|
|
@@ -32471,7 +32868,7 @@ async function sourceStandins(binaries, toolchain, provided, behavior) {
|
|
|
32471
32868
|
})
|
|
32472
32869
|
);
|
|
32473
32870
|
const build = await new Promise((resolve3) => {
|
|
32474
|
-
const child = (0,
|
|
32871
|
+
const child = (0, import_node_child_process38.spawn)(
|
|
32475
32872
|
"bun",
|
|
32476
32873
|
[
|
|
32477
32874
|
import_node_path70.default.join(repo, "scripts/build/swift-standins-submit.ts"),
|
|
@@ -33001,24 +33398,27 @@ async function buildStandins(binaries, toolchain, provided, behavior) {
|
|
|
33001
33398
|
import_node_fs73.default.rmSync(modules, { recursive: true, force: true });
|
|
33002
33399
|
}
|
|
33003
33400
|
}
|
|
33004
|
-
var
|
|
33401
|
+
var import_node_child_process38, import_node_crypto36, import_node_fs73, import_node_path70, TRIPLE, cacheDir4, key, digests, isBinaryLibraryFile, REACH_STAGED_FRAMEWORKS, OBJC_IMPORT, files, OBJC, OBJC_ATTRIBUTE, TYPE_DECLARATION, OPTIONAL_REQUIREMENT, WASM_EH_FLAGS, OBJC_UNREPRESENTABLE, INERT_VALUE, identChar, RUST_TARGET, UNSEARCHED, RUST_TOOLCHAIN, built;
|
|
33005
33402
|
var init_swift_standins = __esm({
|
|
33006
33403
|
"src/swift-standins.ts"() {
|
|
33007
33404
|
"use strict";
|
|
33008
33405
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
33009
|
-
|
|
33406
|
+
import_node_child_process38 = require("node:child_process");
|
|
33010
33407
|
import_node_crypto36 = require("node:crypto");
|
|
33011
33408
|
import_node_fs73 = __toESM(require("node:fs"), 1);
|
|
33012
33409
|
import_node_path70 = __toESM(require("node:path"), 1);
|
|
33410
|
+
init_forked_script_contract();
|
|
33013
33411
|
init_home_paths();
|
|
33014
33412
|
init_is_record();
|
|
33015
33413
|
init_native_prebuilt();
|
|
33016
33414
|
init_native_slices();
|
|
33017
33415
|
init_native_static_libraries();
|
|
33018
33416
|
init_native_swift_slices();
|
|
33417
|
+
init_numbered_lock();
|
|
33019
33418
|
init_output_lock_stdio();
|
|
33020
33419
|
init_swift_compile();
|
|
33021
33420
|
init_swift_cxx_standin();
|
|
33421
|
+
init_swift_distribution();
|
|
33022
33422
|
init_swift_objc_standin();
|
|
33023
33423
|
init_swift_package();
|
|
33024
33424
|
init_swift_packages();
|
|
@@ -33028,7 +33428,7 @@ var init_swift_standins = __esm({
|
|
|
33028
33428
|
init_swift_standin_emit();
|
|
33029
33429
|
init_swift_toolchain();
|
|
33030
33430
|
init_swift_xcframework();
|
|
33031
|
-
TRIPLE = "
|
|
33431
|
+
TRIPLE = "wasm64-unknown-wasip1";
|
|
33032
33432
|
cacheDir4 = import_node_path70.default.join(cacheDir(), "swift-standins");
|
|
33033
33433
|
key = (...parts) => (0, import_node_crypto36.createHash)("sha256").update(parts.join("\0")).digest("hex").slice(0, 32);
|
|
33034
33434
|
digests = /* @__PURE__ */ new Map();
|
|
@@ -33044,7 +33444,7 @@ var init_swift_standins = __esm({
|
|
|
33044
33444
|
OBJC_UNREPRESENTABLE = "cannot be marked '@objc' because its type cannot be represented in Objective-C";
|
|
33045
33445
|
INERT_VALUE = /missing argument|cannot be constructed|has no member 'init'|no exact matches in call to initializer|cannot convert return expression|does not conform to '|extra argument|takes no arguments|could not be inferred|cannot infer/;
|
|
33046
33446
|
identChar = (char) => char !== void 0 && /[\w$]/.test(char);
|
|
33047
|
-
RUST_TARGET = "
|
|
33447
|
+
RUST_TARGET = "wasm64-wasip1";
|
|
33048
33448
|
UNSEARCHED = /* @__PURE__ */ new Set([
|
|
33049
33449
|
"node_modules",
|
|
33050
33450
|
"Pods",
|
|
@@ -33248,7 +33648,7 @@ function* xcodeObjCInputSteps(app, binaries, moduleRoot, products, sourceRoot =
|
|
|
33248
33648
|
resolved,
|
|
33249
33649
|
Infinity
|
|
33250
33650
|
);
|
|
33251
|
-
const backport =
|
|
33651
|
+
const backport = DOUBLE_CONVERSION_WASM64_BACKPORT;
|
|
33252
33652
|
if (import_node_path71.default.basename(file) !== "utils.h" || (0, import_node_crypto37.createHash)("sha256").update(bytes).digest("hex") !== backport.originalSha256) {
|
|
33253
33653
|
sources.set(file, bytes);
|
|
33254
33654
|
return;
|
|
@@ -33418,7 +33818,7 @@ function* xcodeObjCInputSteps(app, binaries, moduleRoot, products, sourceRoot =
|
|
|
33418
33818
|
)
|
|
33419
33819
|
].map((file) => ({ file }));
|
|
33420
33820
|
const includes = [...binaryHeaders, ...target.objc.headerSearchPaths];
|
|
33421
|
-
const
|
|
33821
|
+
const quoted2 = [...target.objc.userHeaderSearchPaths];
|
|
33422
33822
|
const frameworks = [...frameworkSearchPaths];
|
|
33423
33823
|
const flags = [
|
|
33424
33824
|
...target.objc.flags,
|
|
@@ -33442,7 +33842,7 @@ function* xcodeObjCInputSteps(app, binaries, moduleRoot, products, sourceRoot =
|
|
|
33442
33842
|
if (flag.startsWith("-F") || flags[index - 1] === "-F" || flags[index - 1] === "-iframework")
|
|
33443
33843
|
frameworks.push(absolute);
|
|
33444
33844
|
else if (flag.startsWith("-iquote") || flags[index - 1] === "-iquote")
|
|
33445
|
-
|
|
33845
|
+
quoted2.push(absolute);
|
|
33446
33846
|
else includes.push(absolute);
|
|
33447
33847
|
}
|
|
33448
33848
|
if (["-include", "-imacros"].includes(flags[index - 1] ?? ""))
|
|
@@ -33477,7 +33877,7 @@ function* xcodeObjCInputSteps(app, binaries, moduleRoot, products, sourceRoot =
|
|
|
33477
33877
|
for (let index = 0; index < queue.length; index++) {
|
|
33478
33878
|
if (++workCount % 64 === 0) yield;
|
|
33479
33879
|
const { file } = queue[index];
|
|
33480
|
-
const foundIn = queue[index].origin ?? [...
|
|
33880
|
+
const foundIn = queue[index].origin ?? [...quoted2, ...includes].find(
|
|
33481
33881
|
(directory2) => relativeInside(directory2, file) !== null
|
|
33482
33882
|
);
|
|
33483
33883
|
const visit3 = `${file}\0${foundIn ?? ""}`;
|
|
@@ -33520,7 +33920,7 @@ function* xcodeObjCInputSteps(app, binaries, moduleRoot, products, sourceRoot =
|
|
|
33520
33920
|
scannedReferences.set(file, references);
|
|
33521
33921
|
}
|
|
33522
33922
|
for (const prefix of computedIncludes.get(file) ?? []) {
|
|
33523
|
-
const directory2 = [import_node_path71.default.dirname(file), ...
|
|
33923
|
+
const directory2 = [import_node_path71.default.dirname(file), ...quoted2, ...includes].filter((search) => !isSdkInclude(search)).map((search) => import_node_path71.default.join(search, prefix)).find(isDirectory2);
|
|
33524
33924
|
if (!directory2 || computedDirectories.has(directory2)) continue;
|
|
33525
33925
|
computedDirectories.add(directory2);
|
|
33526
33926
|
yield* addHeaders(directory2);
|
|
@@ -33530,6 +33930,8 @@ function* xcodeObjCInputSteps(app, binaries, moduleRoot, products, sourceRoot =
|
|
|
33530
33930
|
}
|
|
33531
33931
|
for (const reference of references) {
|
|
33532
33932
|
if (++workCount % 64 === 0) yield;
|
|
33933
|
+
if (import_node_path71.default.isAbsolute(reference.name) && /\.sdk\/(?:System|Developer)\/Library\/Frameworks\//.test(reference.name))
|
|
33934
|
+
continue;
|
|
33533
33935
|
if (reference.quoted && !reference.next) {
|
|
33534
33936
|
const local = availableHeader(import_node_path71.default.resolve(import_node_path71.default.dirname(file), reference.name));
|
|
33535
33937
|
if (local !== null) {
|
|
@@ -33555,7 +33957,7 @@ function* xcodeObjCInputSteps(app, binaries, moduleRoot, products, sourceRoot =
|
|
|
33555
33957
|
if (mapped && import_node_path71.default.isAbsolute(mapped))
|
|
33556
33958
|
yield { path: mapped, directory: mapDirectory };
|
|
33557
33959
|
if (reference.quoted)
|
|
33558
|
-
for (const directory2 of
|
|
33960
|
+
for (const directory2 of quoted2)
|
|
33559
33961
|
yield { path: import_node_path71.default.join(directory2, reference.name), directory: directory2 };
|
|
33560
33962
|
for (const directory2 of includes)
|
|
33561
33963
|
if (!isSdkInclude(directory2))
|
|
@@ -33726,7 +34128,7 @@ function prepareXcodeSwiftProducts(app, binaries, moduleRoot) {
|
|
|
33726
34128
|
provided: [...providers.keys()]
|
|
33727
34129
|
};
|
|
33728
34130
|
try {
|
|
33729
|
-
const lock = (0,
|
|
34131
|
+
const lock = (0, import_node_child_process39.spawnSync)(
|
|
33730
34132
|
"perl",
|
|
33731
34133
|
["-e", 'open(my $f, ">&=", 3) or die $!; flock($f, 2) or die $!'],
|
|
33732
34134
|
{ stdio: ["ignore", "pipe", "pipe", descriptor], encoding: "utf8" }
|
|
@@ -33859,7 +34261,7 @@ function prepareXcodeSwiftProducts(app, binaries, moduleRoot) {
|
|
|
33859
34261
|
const args = [
|
|
33860
34262
|
...provider ? ["-merge-modules", "-emit-module"] : ["-emit-object", "-whole-module-optimization", "-parse-as-library"],
|
|
33861
34263
|
"-target",
|
|
33862
|
-
"
|
|
34264
|
+
"wasm64-unknown-wasip1",
|
|
33863
34265
|
"-sdk",
|
|
33864
34266
|
sdk.sysroot,
|
|
33865
34267
|
"-resource-dir",
|
|
@@ -33897,7 +34299,7 @@ function prepareXcodeSwiftProducts(app, binaries, moduleRoot) {
|
|
|
33897
34299
|
import_node_path71.default.join(work, `${target.moduleName}.o`)
|
|
33898
34300
|
]
|
|
33899
34301
|
];
|
|
33900
|
-
const result = (0,
|
|
34302
|
+
const result = (0, import_node_child_process39.spawnSync)(frontend, args, {
|
|
33901
34303
|
cwd: work,
|
|
33902
34304
|
encoding: "utf8",
|
|
33903
34305
|
env: swiftEnvironment(),
|
|
@@ -34017,7 +34419,7 @@ async function prepareXcodeObjCImplementations(app, binaries, moduleRoot) {
|
|
|
34017
34419
|
const work = import_node_path71.default.join(parent, key2);
|
|
34018
34420
|
const descriptor = import_node_fs74.default.openSync(`${work}.lock`, "a");
|
|
34019
34421
|
try {
|
|
34020
|
-
const locked = (0,
|
|
34422
|
+
const locked = (0, import_node_child_process39.spawnSync)(
|
|
34021
34423
|
"perl",
|
|
34022
34424
|
["-e", 'open(my $f, ">&=", 3) or die $!; flock($f, 2) or die $!'],
|
|
34023
34425
|
{ stdio: ["ignore", "pipe", "pipe", descriptor], encoding: "utf8" }
|
|
@@ -34227,7 +34629,7 @@ async function prepareXcodeObjCImplementations(app, binaries, moduleRoot) {
|
|
|
34227
34629
|
});
|
|
34228
34630
|
const modules = flags.includes("-fmodules") && (!cxx || flags.lastIndexOf("-fno-cxx-modules") <= flags.lastIndexOf("-fcxx-modules"));
|
|
34229
34631
|
const args = [
|
|
34230
|
-
"--target=
|
|
34632
|
+
"--target=wasm64-unknown-wasip1",
|
|
34231
34633
|
`--sysroot=${sdk.sysroot}`,
|
|
34232
34634
|
"-fwasm-exceptions",
|
|
34233
34635
|
"-fexceptions",
|
|
@@ -34265,7 +34667,7 @@ async function prepareXcodeObjCImplementations(app, binaries, moduleRoot) {
|
|
|
34265
34667
|
...dependencies ? ["-MD", "-MF", dependencies, "-H"] : []
|
|
34266
34668
|
];
|
|
34267
34669
|
const result = await new Promise((resolve3) => {
|
|
34268
|
-
const child = (0,
|
|
34670
|
+
const child = (0, import_node_child_process39.spawn)(
|
|
34269
34671
|
import_node_path71.default.join(toolchain.toolchainBin, cxx ? "clang++" : "clang"),
|
|
34270
34672
|
args,
|
|
34271
34673
|
{
|
|
@@ -34346,12 +34748,12 @@ ${reported.trimEnd() || `Clang exited with status ${result.status}`}`;
|
|
|
34346
34748
|
import_node_fs74.default.closeSync(descriptor);
|
|
34347
34749
|
}
|
|
34348
34750
|
}
|
|
34349
|
-
var
|
|
34751
|
+
var import_node_child_process39, import_node_crypto37, import_node_fs74, import_node_path71, SwiftObjCCompilationError, isDirectory2, isSdkInclude, FRAMEWORK_IMPORT, OWN_IMPORT;
|
|
34350
34752
|
var init_swift_objc_compile = __esm({
|
|
34351
34753
|
"src/swift-objc-compile.ts"() {
|
|
34352
34754
|
"use strict";
|
|
34353
34755
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
34354
|
-
|
|
34756
|
+
import_node_child_process39 = require("node:child_process");
|
|
34355
34757
|
import_node_crypto37 = require("node:crypto");
|
|
34356
34758
|
import_node_fs74 = __toESM(require("node:fs"), 1);
|
|
34357
34759
|
import_node_path71 = __toESM(require("node:path"), 1);
|
|
@@ -34685,12 +35087,12 @@ function enumerateBundleSymbols(paths, readText, bundleForFile) {
|
|
|
34685
35087
|
const box = pathBounds(d);
|
|
34686
35088
|
const translateX = 12 - (box.minX + box.maxX) * em / 2;
|
|
34687
35089
|
const translateY = 12 - (box.minY + box.maxY) * em / 2;
|
|
34688
|
-
const
|
|
35090
|
+
const wide2 = (box.maxX - box.minX) * em;
|
|
34689
35091
|
const tall = (box.maxY - box.minY) * em;
|
|
34690
35092
|
const vector = {
|
|
34691
35093
|
viewBox: "0 0 24 24",
|
|
34692
35094
|
advance,
|
|
34693
|
-
box: [12 -
|
|
35095
|
+
box: [12 - wide2 / 2, 12 - tall / 2, wide2, tall],
|
|
34694
35096
|
...customLayout ? { customLayout } : {},
|
|
34695
35097
|
layers: d.map((path74) => ({
|
|
34696
35098
|
d: (0, import_svgpath.default)(path74).abs().scale(em).translate(translateX, translateY).round(3).toString()
|
|
@@ -35955,9 +36357,9 @@ ${represented.module ? "\n" : `@objc(${represented.name})
|
|
|
35955
36357
|
"extension " + represented.name + " {",
|
|
35956
36358
|
""
|
|
35957
36359
|
];
|
|
35958
|
-
const add = (selector,
|
|
36360
|
+
const add = (selector, signature2) => lines.push(
|
|
35959
36361
|
` @objc(${selector})`,
|
|
35960
|
-
` @NSManaged nonisolated public func ${
|
|
36362
|
+
` @NSManaged nonisolated public func ${signature2}`,
|
|
35961
36363
|
""
|
|
35962
36364
|
);
|
|
35963
36365
|
if (ordered) {
|
|
@@ -36227,7 +36629,7 @@ async function xcodeCxxReachable(app, binaries, moduleRoot, clang) {
|
|
|
36227
36629
|
failed = captured.failed;
|
|
36228
36630
|
reached = captured.reached;
|
|
36229
36631
|
} else {
|
|
36230
|
-
const result2 = (0,
|
|
36632
|
+
const result2 = (0, import_node_child_process40.spawnSync)(clang, [...cleaned, "-M", "-MT", "peach", "-H"], {
|
|
36231
36633
|
cwd: work,
|
|
36232
36634
|
encoding: "utf8",
|
|
36233
36635
|
env: swiftEnvironment(),
|
|
@@ -36350,12 +36752,12 @@ async function xcodeCxxReachable(app, binaries, moduleRoot, clang) {
|
|
|
36350
36752
|
);
|
|
36351
36753
|
return result;
|
|
36352
36754
|
}
|
|
36353
|
-
var
|
|
36755
|
+
var import_node_child_process40, import_node_crypto38, import_node_fs77, import_node_path74, cachedInputs;
|
|
36354
36756
|
var init_swift_cxx_reachable = __esm({
|
|
36355
36757
|
"src/swift-cxx-reachable.ts"() {
|
|
36356
36758
|
"use strict";
|
|
36357
36759
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
36358
|
-
|
|
36760
|
+
import_node_child_process40 = require("node:child_process");
|
|
36359
36761
|
import_node_crypto38 = require("node:crypto");
|
|
36360
36762
|
import_node_fs77 = __toESM(require("node:fs"), 1);
|
|
36361
36763
|
import_node_path74 = __toESM(require("node:path"), 1);
|
|
@@ -36455,7 +36857,7 @@ function rasterBinary(swift = RASTER_SWIFT, name3 = "swift-pdf-raster") {
|
|
|
36455
36857
|
);
|
|
36456
36858
|
import_node_fs79.default.writeFileSync(source, swift);
|
|
36457
36859
|
try {
|
|
36458
|
-
(0,
|
|
36860
|
+
(0, import_node_child_process41.execFileSync)("xcrun", ["swiftc", "-o", binary2, source], { stdio: "pipe" });
|
|
36459
36861
|
} finally {
|
|
36460
36862
|
import_node_fs79.default.rmSync(import_node_path76.default.dirname(source), { recursive: true, force: true });
|
|
36461
36863
|
}
|
|
@@ -36480,10 +36882,10 @@ function rasterizePdfFile(diskPath, pdfSha256) {
|
|
|
36480
36882
|
);
|
|
36481
36883
|
try {
|
|
36482
36884
|
if (process.platform === "darwin") {
|
|
36483
|
-
(0,
|
|
36885
|
+
(0, import_node_child_process41.execFileSync)(rasterBinary(), [diskPath, "3", out], { stdio: "pipe" });
|
|
36484
36886
|
} else {
|
|
36485
36887
|
const { executable, prefixArgs } = rnxSelfInvocation();
|
|
36486
|
-
(0,
|
|
36888
|
+
(0, import_node_child_process41.execFileSync)(
|
|
36487
36889
|
executable,
|
|
36488
36890
|
[
|
|
36489
36891
|
...prefixArgs,
|
|
@@ -36522,7 +36924,7 @@ function rasterizeSvgFile(diskPath, svgSha256) {
|
|
|
36522
36924
|
"out.png"
|
|
36523
36925
|
);
|
|
36524
36926
|
try {
|
|
36525
|
-
(0,
|
|
36927
|
+
(0, import_node_child_process41.execFileSync)(binary2, [diskPath, "3", out], { stdio: "pipe" });
|
|
36526
36928
|
const bytes = import_node_fs79.default.readFileSync(out);
|
|
36527
36929
|
import_node_fs79.default.mkdirSync(cacheDir(), { recursive: true });
|
|
36528
36930
|
import_node_fs79.default.copyFileSync(out, cached2);
|
|
@@ -36535,12 +36937,12 @@ function rasterizeSvgFile(diskPath, svgSha256) {
|
|
|
36535
36937
|
import_node_fs79.default.rmSync(import_node_path76.default.dirname(out), { recursive: true, force: true });
|
|
36536
36938
|
}
|
|
36537
36939
|
}
|
|
36538
|
-
var
|
|
36940
|
+
var import_node_child_process41, import_node_crypto39, import_node_fs79, import_node_os16, import_node_path76, RASTER_SWIFT, RASTER_SVG_SWIFT;
|
|
36539
36941
|
var init_swift_pdf_raster = __esm({
|
|
36540
36942
|
"src/swift-pdf-raster.ts"() {
|
|
36541
36943
|
"use strict";
|
|
36542
36944
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
36543
|
-
|
|
36945
|
+
import_node_child_process41 = require("node:child_process");
|
|
36544
36946
|
import_node_crypto39 = require("node:crypto");
|
|
36545
36947
|
import_node_fs79 = __toESM(require("node:fs"), 1);
|
|
36546
36948
|
import_node_os16 = __toESM(require("node:os"), 1);
|
|
@@ -36760,7 +37162,7 @@ async function wasmPortableAssembly(binaries, toolchainBin, moduleRoot) {
|
|
|
36760
37162
|
const known = emptyWasmAssembly.get(key2);
|
|
36761
37163
|
if (known) return known;
|
|
36762
37164
|
const result = new Promise(
|
|
36763
|
-
(resolve3) => (0,
|
|
37165
|
+
(resolve3) => (0, import_node_child_process42.execFile)(
|
|
36764
37166
|
clang,
|
|
36765
37167
|
[
|
|
36766
37168
|
"-target",
|
|
@@ -37205,12 +37607,17 @@ async function buildXcodeLayout(root) {
|
|
|
37205
37607
|
(feature) => feature.configuration === null || feature.configuration === packageConfiguration
|
|
37206
37608
|
).map((feature) => feature.name),
|
|
37207
37609
|
// the flat build gives every module one package; swiftpm names each
|
|
37208
|
-
// module for its own package, which `@retroactive` and `package` read
|
|
37209
|
-
|
|
37210
|
-
|
|
37610
|
+
// module for its own package, which `@retroactive` and `package` read.
|
|
37611
|
+
// xcode and swiftpm build a debug package testable, so sources may
|
|
37612
|
+
// `@testable import` it
|
|
37613
|
+
swiftFlags: [
|
|
37614
|
+
"-package-name",
|
|
37615
|
+
swiftPackageIdentity(target.packageDir),
|
|
37616
|
+
...packageConfiguration === "debug" ? ["-enable-testing"] : [],
|
|
37617
|
+
...target.packageSwiftFlags.filter(
|
|
37211
37618
|
(setting) => setting.configuration === null || setting.configuration === packageConfiguration
|
|
37212
37619
|
).flatMap((setting) => setting.flags)
|
|
37213
|
-
|
|
37620
|
+
],
|
|
37214
37621
|
linkedLibraries: target.packageLibraries.filter(
|
|
37215
37622
|
(library) => library.configuration === null || library.configuration === packageConfiguration
|
|
37216
37623
|
).map((library) => library.name),
|
|
@@ -37565,7 +37972,7 @@ function xcodeManifest(layout2) {
|
|
|
37565
37972
|
return [
|
|
37566
37973
|
"// swift-tools-version: 6.2",
|
|
37567
37974
|
"import PackageDescription",
|
|
37568
|
-
`let package = Package(name: "app",
|
|
37975
|
+
`let package = Package(name: "app", platforms: [.iOS(${JSON.stringify(layout2.app.iosDeploymentTarget)})], dependencies: [${[...nativePaths].map(([name3, directory2]) => `.package(name: ${JSON.stringify(name3)}, path: ${JSON.stringify(directory2)})`).join(", ")}], targets: [`,
|
|
37569
37976
|
` .executableTarget(name: "${layout2.app.moduleName}", dependencies: [${[...appProducts, ...layout2.targets.map((target) => JSON.stringify(target.name)), ...sdkProducts].join(", ")}], path: "${XCODE_APP_DIR}", ${appSettings}),`,
|
|
37570
37977
|
...layout2.targets.map(
|
|
37571
37978
|
(target) => target.systemLibrary ? ` .systemLibrary(name: "${target.name}", path: "${target.path}"),` : ` .target(name: "${target.name}", ${target.dependencies === void 0 ? "" : `dependencies: [${dependencies(target)}], `}path: "${target.path}", ${target.exclude.length > 0 ? `exclude: ${JSON.stringify(target.exclude)}, ` : ""}${target.sources === void 0 ? "" : `sources: ${JSON.stringify(target.sources)}, `}${target.resources ? "resources: [], " : ""}${target.publicHeadersPath === void 0 ? "" : `publicHeadersPath: ${JSON.stringify(target.publicHeadersPath)}, `}${clangSettings(target)}${swiftManifestSettings(target)}${libraries(target)}),`
|
|
@@ -38015,7 +38422,7 @@ function buildSwiftBundleFiles(packagePath, hosted, inputs, resourceBundles) {
|
|
|
38015
38422
|
};
|
|
38016
38423
|
try {
|
|
38017
38424
|
const [shell, ...args] = phase.command;
|
|
38018
|
-
(0,
|
|
38425
|
+
(0, import_node_child_process42.execFileSync)(shell, args, {
|
|
38019
38426
|
cwd: phase.directory,
|
|
38020
38427
|
env,
|
|
38021
38428
|
stdio: ["ignore", "pipe", "pipe"],
|
|
@@ -38601,16 +39008,16 @@ async function compileRemote(packagePath, snapshot, hosted, ownerSignal) {
|
|
|
38601
39008
|
if (Number(response.headers.get("content-length")) > maxArtifactBytes || !response.body) {
|
|
38602
39009
|
throw new Error("swift compile: artifact exceeds 64 MiB or has no body");
|
|
38603
39010
|
}
|
|
38604
|
-
const
|
|
39011
|
+
const reader2 = response.body.getReader();
|
|
38605
39012
|
const chunks = [];
|
|
38606
39013
|
let total = 0;
|
|
38607
39014
|
for (; ; ) {
|
|
38608
39015
|
signal.throwIfAborted();
|
|
38609
|
-
const next = await
|
|
39016
|
+
const next = await reader2.read();
|
|
38610
39017
|
if (next.done) break;
|
|
38611
39018
|
total += next.value.byteLength;
|
|
38612
39019
|
if (total > maxArtifactBytes) {
|
|
38613
|
-
await
|
|
39020
|
+
await reader2.cancel();
|
|
38614
39021
|
throw new Error("swift compile: artifact exceeds 64 MiB");
|
|
38615
39022
|
}
|
|
38616
39023
|
chunks.push(next.value);
|
|
@@ -38695,13 +39102,13 @@ function scopedArtifact(project, entry, moduleRoot, signal) {
|
|
|
38695
39102
|
project.building = { stamp, promise: fresh, signal };
|
|
38696
39103
|
return fresh;
|
|
38697
39104
|
}
|
|
38698
|
-
var import_node_async_hooks,
|
|
39105
|
+
var import_node_async_hooks, import_node_child_process42, import_node_crypto40, import_node_fs80, import_node_os17, import_node_path77, RESOURCE_PATH, ICU_PATH, SKIP_ROOT_DIRS, NATIVE_DESCRIPTOR, NATIVE_GLUE, SwiftMissingModulesError, sharedProjects, projectScope, projects, sharedSourceEntries, sourceEntries, sharedXcodeProjects, xcodeProjects, preparedScriptInputs, emptyWasmAssembly, XCODE_APP_DIR, XCODE_FRAMEWORKS_DIR, XCODE_PACKAGES_DIR, layoutScope, HOSTED_LIMITS, LOCAL_LIMITS, inputLimits, RESOURCE_CONTENT_TYPES, API_GAP_PATTERNS, IOS_SDK_FRAMEWORKS;
|
|
38699
39106
|
var init_swift_host = __esm({
|
|
38700
39107
|
"src/swift-host.ts"() {
|
|
38701
39108
|
"use strict";
|
|
38702
39109
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
38703
39110
|
import_node_async_hooks = require("node:async_hooks");
|
|
38704
|
-
|
|
39111
|
+
import_node_child_process42 = require("node:child_process");
|
|
38705
39112
|
import_node_crypto40 = require("node:crypto");
|
|
38706
39113
|
import_node_fs80 = __toESM(require("node:fs"), 1);
|
|
38707
39114
|
import_node_os17 = __toESM(require("node:os"), 1);
|
|
@@ -40587,21 +40994,21 @@ async function runInstalledTurboCodegen(appRoot, outDir, signal) {
|
|
|
40587
40994
|
files: hashTree(generatedRoot)
|
|
40588
40995
|
};
|
|
40589
40996
|
}
|
|
40590
|
-
var
|
|
40997
|
+
var import_node_child_process43, import_node_crypto41, import_node_fs82, import_node_module7, import_node_path79, import_node_util14, run6, RENDERER_PODS, RENDERER_PODS_VERSIONED, COMPILED_SOURCE, LEGACY_BRIDGE_DEV_SUPPORT, LEGACY_BRIDGE_PODS, LEGACY_BRIDGE_PODS_VERSIONED;
|
|
40591
40998
|
var init_turbo_codegen_intake = __esm({
|
|
40592
40999
|
"src/turbo-codegen-intake.ts"() {
|
|
40593
41000
|
"use strict";
|
|
40594
41001
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
40595
|
-
|
|
41002
|
+
import_node_child_process43 = require("node:child_process");
|
|
40596
41003
|
import_node_crypto41 = require("node:crypto");
|
|
40597
41004
|
import_node_fs82 = __toESM(require("node:fs"), 1);
|
|
40598
41005
|
import_node_module7 = require("node:module");
|
|
40599
41006
|
import_node_path79 = __toESM(require("node:path"), 1);
|
|
40600
|
-
|
|
41007
|
+
import_node_util14 = require("node:util");
|
|
40601
41008
|
init_is_record();
|
|
40602
41009
|
init_nitro_source();
|
|
40603
41010
|
init_podspec_sources();
|
|
40604
|
-
run6 = (0,
|
|
41011
|
+
run6 = (0, import_node_util14.promisify)(import_node_child_process43.execFile);
|
|
40605
41012
|
RENDERER_PODS = /* @__PURE__ */ new Set([
|
|
40606
41013
|
"React-Fabric",
|
|
40607
41014
|
"React-FabricComponents",
|
|
@@ -41424,8 +41831,8 @@ async function collectTurboSources(options) {
|
|
|
41424
41831
|
};
|
|
41425
41832
|
const podHeaders = /* @__PURE__ */ new Map();
|
|
41426
41833
|
const podFileLists = /* @__PURE__ */ new Map();
|
|
41427
|
-
const resolve3 = (from, include,
|
|
41428
|
-
if (
|
|
41834
|
+
const resolve3 = (from, include, quoted2) => {
|
|
41835
|
+
if (quoted2) {
|
|
41429
41836
|
const relative3 = import_node_path80.default.posix.normalize(
|
|
41430
41837
|
import_node_path80.default.posix.join(import_node_path80.default.posix.dirname(from.relative), include)
|
|
41431
41838
|
);
|
|
@@ -41492,7 +41899,7 @@ async function collectTurboSources(options) {
|
|
|
41492
41899
|
);
|
|
41493
41900
|
return;
|
|
41494
41901
|
}
|
|
41495
|
-
if (
|
|
41902
|
+
if (quoted2 && from.root) {
|
|
41496
41903
|
let files2 = podFileLists.get(from.root);
|
|
41497
41904
|
if (!files2) {
|
|
41498
41905
|
files2 = /* @__PURE__ */ new Set();
|
|
@@ -41518,7 +41925,7 @@ async function collectTurboSources(options) {
|
|
|
41518
41925
|
if ([...installedCodegenNames].some(
|
|
41519
41926
|
(spec) => name3.startsWith(`${spec}/`) || name3 === `${spec}JSI.h`
|
|
41520
41927
|
)) {
|
|
41521
|
-
pendingCodegen.push({ from, include, quoted });
|
|
41928
|
+
pendingCodegen.push({ from, include, quoted: quoted2 });
|
|
41522
41929
|
return;
|
|
41523
41930
|
}
|
|
41524
41931
|
}
|
|
@@ -41544,11 +41951,11 @@ async function collectTurboSources(options) {
|
|
|
41544
41951
|
return;
|
|
41545
41952
|
}
|
|
41546
41953
|
const nativeReactMaps = pod?.reactHeaderMaps ?? [];
|
|
41547
|
-
const mappedReact = (
|
|
41954
|
+
const mappedReact = (quoted2 ? [
|
|
41548
41955
|
...nativeReactMaps.filter(({ flag }) => flag === "-iquote"),
|
|
41549
41956
|
...nativeReactMaps.filter(({ flag }) => flag === "-I")
|
|
41550
41957
|
] : nativeReactMaps.filter(({ flag }) => flag === "-I")).map(({ headers }) => headers.get(include)).find((file) => file !== void 0);
|
|
41551
|
-
const react = mappedReact ?? (
|
|
41958
|
+
const react = mappedReact ?? (quoted2 && !include.includes("/") ? reactHeaders().get(`React/${include}`) ?? reactHeaders().get(`bare/${include}`) : reactHeaders().get(include));
|
|
41552
41959
|
if (react) {
|
|
41553
41960
|
alias(
|
|
41554
41961
|
`${core}/include/${include}`,
|
|
@@ -41556,7 +41963,7 @@ async function collectTurboSources(options) {
|
|
|
41556
41963
|
);
|
|
41557
41964
|
return;
|
|
41558
41965
|
}
|
|
41559
|
-
for (const map2 of
|
|
41966
|
+
for (const map2 of quoted2 ? [
|
|
41560
41967
|
...pod?.dependencyHeaderMaps.filter(({ flag }) => flag === "-iquote") ?? [],
|
|
41561
41968
|
...pod?.dependencyHeaderMaps.filter(({ flag }) => flag === "-I") ?? []
|
|
41562
41969
|
] : pod?.dependencyHeaderMaps.filter(({ flag }) => flag === "-I") ?? []) {
|
|
@@ -42330,7 +42737,7 @@ ${declared.map((symbol2) => `extern "C" void ${symbol2}();
|
|
|
42330
42737
|
}
|
|
42331
42738
|
if (pendingCodegen.length) {
|
|
42332
42739
|
codegen ??= (await runInstalledTurboCodegen(options.appRoot, options.codegenDir)).generatedRoot;
|
|
42333
|
-
for (const { from, include, quoted } of pendingCodegen) resolve3(from, include,
|
|
42740
|
+
for (const { from, include, quoted: quoted2 } of pendingCodegen) resolve3(from, include, quoted2);
|
|
42334
42741
|
for (let next = pending.shift(); next; next = pending.shift())
|
|
42335
42742
|
scanText(next, result.files[next.key]);
|
|
42336
42743
|
}
|
|
@@ -42799,16 +43206,16 @@ ${moduleProviders ? " [found addObjectsFromArray:RCTModuleProviders.moduleProvi
|
|
|
42799
43206
|
}
|
|
42800
43207
|
`;
|
|
42801
43208
|
}
|
|
42802
|
-
var
|
|
43209
|
+
var import_node_child_process44, import_node_crypto42, import_node_fs83, import_node_path80, import_node_util15, execFileAsync3, TURBO_CORE_TARGET, TURBO_FMT_TARGET, TURBO_ENTRY_HEADER, TURBO_CORE_PUBLIC_HEADERS, REGISTRATION, CODEGEN_OBJC, UNIT, HEADER3, OBJC2, OBJC_TURBO, OBJC_BRIDGE, OBJC_REGISTERED, REACT_NATIVE_UNITS, REACT_NATIVE_INCLUDE_ROOTS, REACT_NATIVE_OBJC_UNITS, REACT_NATIVE_OBJC_VERSIONED_UNITS, REACT_NATIVE_HEADER_DIRS, REACT_NATIVE_BARE_HEADER_DIRS, sha2563, versionParts, iosOf, JS_CALL_INVOKER;
|
|
42803
43210
|
var init_turbo_source = __esm({
|
|
42804
43211
|
"src/turbo-source.ts"() {
|
|
42805
43212
|
"use strict";
|
|
42806
43213
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
42807
|
-
|
|
43214
|
+
import_node_child_process44 = require("node:child_process");
|
|
42808
43215
|
import_node_crypto42 = require("node:crypto");
|
|
42809
43216
|
import_node_fs83 = __toESM(require("node:fs"), 1);
|
|
42810
43217
|
import_node_path80 = __toESM(require("node:path"), 1);
|
|
42811
|
-
|
|
43218
|
+
import_node_util15 = require("node:util");
|
|
42812
43219
|
init_home_paths();
|
|
42813
43220
|
init_installed_native_libraries();
|
|
42814
43221
|
init_answeredNativePackages();
|
|
@@ -42821,7 +43228,7 @@ var init_turbo_source = __esm({
|
|
|
42821
43228
|
init_swift_submit();
|
|
42822
43229
|
init_turbo_codegen_intake();
|
|
42823
43230
|
init_xcode_project();
|
|
42824
|
-
execFileAsync3 = (0,
|
|
43231
|
+
execFileAsync3 = (0, import_node_util15.promisify)(import_node_child_process44.execFile);
|
|
42825
43232
|
TURBO_CORE_TARGET = "TurboCore";
|
|
42826
43233
|
TURBO_FMT_TARGET = "TurboFmt";
|
|
42827
43234
|
TURBO_ENTRY_HEADER = "PeachTurboEntry.hpp";
|
|
@@ -43171,7 +43578,7 @@ async function buildReactNativeCore(project, reactNativeRoot, mode, moduleRoot)
|
|
|
43171
43578
|
buildRoot,
|
|
43172
43579
|
intermediates: true
|
|
43173
43580
|
});
|
|
43174
|
-
const products = import_node_path82.default.join(buildRoot, ".build
|
|
43581
|
+
const products = import_node_path82.default.join(buildRoot, ".build", WASM_TRIPLE, "release");
|
|
43175
43582
|
const emitted = swiftManifestTargets(
|
|
43176
43583
|
import_node_fs84.default.readFileSync(import_node_path82.default.join(buildRoot, "Package.swift"), "utf8")
|
|
43177
43584
|
);
|
|
@@ -43189,7 +43596,7 @@ async function buildReactNativeCore(project, reactNativeRoot, mode, moduleRoot)
|
|
|
43189
43596
|
import_node_fs84.default.mkdirSync(members2, { recursive: true });
|
|
43190
43597
|
const stripped2 = objects.map((file, index) => {
|
|
43191
43598
|
const output2 = import_node_path82.default.join(members2, `${index}-${import_node_path82.default.basename(file)}`);
|
|
43192
|
-
(0,
|
|
43599
|
+
(0, import_node_child_process45.execFileSync)(import_node_path82.default.join(module2.toolchainBin, "llvm-objcopy"), [
|
|
43193
43600
|
"--strip-debug",
|
|
43194
43601
|
file,
|
|
43195
43602
|
output2
|
|
@@ -43198,7 +43605,7 @@ async function buildReactNativeCore(project, reactNativeRoot, mode, moduleRoot)
|
|
|
43198
43605
|
});
|
|
43199
43606
|
const archive = import_node_path82.default.join(work, `lib${target.name}.a`);
|
|
43200
43607
|
import_node_fs84.default.rmSync(archive, { force: true });
|
|
43201
|
-
(0,
|
|
43608
|
+
(0, import_node_child_process45.execFileSync)(import_node_path82.default.join(module2.toolchainBin, "llvm-ar"), [
|
|
43202
43609
|
"rcsD",
|
|
43203
43610
|
archive,
|
|
43204
43611
|
...stripped2
|
|
@@ -43251,12 +43658,12 @@ async function buildReactNativeCore(project, reactNativeRoot, mode, moduleRoot)
|
|
|
43251
43658
|
return directory2;
|
|
43252
43659
|
});
|
|
43253
43660
|
}
|
|
43254
|
-
var
|
|
43661
|
+
var import_node_child_process45, import_node_fs84, import_node_path82;
|
|
43255
43662
|
var init_react_native_core_build = __esm({
|
|
43256
43663
|
"src/react-native-core-build.ts"() {
|
|
43257
43664
|
"use strict";
|
|
43258
43665
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
43259
|
-
|
|
43666
|
+
import_node_child_process45 = require("node:child_process");
|
|
43260
43667
|
import_node_fs84 = __toESM(require("node:fs"), 1);
|
|
43261
43668
|
import_node_path82 = __toESM(require("node:path"), 1);
|
|
43262
43669
|
init_home_paths();
|
|
@@ -43365,14 +43772,14 @@ async function prebuiltReactNativeCore(project, reactNativeRoot, moduleRoot, mod
|
|
|
43365
43772
|
const descriptor = JSON.parse(
|
|
43366
43773
|
import_node_fs85.default.readFileSync(import_node_path83.default.join(dir, "descriptor.json"), "utf8")
|
|
43367
43774
|
);
|
|
43368
|
-
if (!(0,
|
|
43775
|
+
if (!(0, import_node_util16.isDeepStrictEqual)(
|
|
43369
43776
|
descriptor,
|
|
43370
43777
|
describeNativeEntry("react-native", entry.name, entry.inputs, [file])
|
|
43371
43778
|
))
|
|
43372
43779
|
throw new Error(`React Native core ${entry.key} does not match its descriptor`);
|
|
43373
43780
|
return readReactNativeCore(JSON.parse(import_node_fs85.default.readFileSync(file, "utf8")));
|
|
43374
43781
|
}
|
|
43375
|
-
var import_node_crypto43, import_node_fs85, import_node_module8, import_node_path83,
|
|
43782
|
+
var import_node_crypto43, import_node_fs85, import_node_module8, import_node_path83, import_node_util16, recipe, strings4, building;
|
|
43376
43783
|
var init_react_native_core = __esm({
|
|
43377
43784
|
"src/react-native-core.ts"() {
|
|
43378
43785
|
"use strict";
|
|
@@ -43381,7 +43788,7 @@ var init_react_native_core = __esm({
|
|
|
43381
43788
|
import_node_fs85 = __toESM(require("node:fs"), 1);
|
|
43382
43789
|
import_node_module8 = require("node:module");
|
|
43383
43790
|
import_node_path83 = __toESM(require("node:path"), 1);
|
|
43384
|
-
|
|
43791
|
+
import_node_util16 = require("node:util");
|
|
43385
43792
|
init_home_paths();
|
|
43386
43793
|
init_is_record();
|
|
43387
43794
|
init_native_prebuilt();
|
|
@@ -43391,7 +43798,7 @@ var init_react_native_core = __esm({
|
|
|
43391
43798
|
init_swift_distribution();
|
|
43392
43799
|
init_swift_package();
|
|
43393
43800
|
init_swiftContract();
|
|
43394
|
-
recipe = true ? "
|
|
43801
|
+
recipe = true ? "40319ffa0770ef7f50b8af9ee68004c6bbc55040f213eabcc9014005f24ef180" : reactNativeCoreDigest2(__sootsim_import_meta_dirname);
|
|
43395
43802
|
strings4 = (value) => isRecord(value) && Object.values(value).every((item) => typeof item === "string");
|
|
43396
43803
|
building = /* @__PURE__ */ new Map();
|
|
43397
43804
|
}
|
|
@@ -43408,14 +43815,14 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
|
43408
43815
|
// src/expo-swift-host.ts
|
|
43409
43816
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
43410
43817
|
var import_node_async_hooks2 = require("node:async_hooks");
|
|
43411
|
-
var
|
|
43818
|
+
var import_node_child_process46 = require("node:child_process");
|
|
43412
43819
|
var import_node_crypto44 = require("node:crypto");
|
|
43413
43820
|
var import_node_fs86 = __toESM(require("node:fs"), 1);
|
|
43414
43821
|
var import_node_module9 = require("node:module");
|
|
43415
43822
|
var import_node_os18 = __toESM(require("node:os"), 1);
|
|
43416
43823
|
var import_node_path84 = __toESM(require("node:path"), 1);
|
|
43417
43824
|
var import_node_url6 = require("node:url");
|
|
43418
|
-
var
|
|
43825
|
+
var import_node_util17 = require("node:util");
|
|
43419
43826
|
|
|
43420
43827
|
// ../peach-compat/src/stubs/native-seams/expo-eager-seam-contract.ts
|
|
43421
43828
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
@@ -47252,12 +47659,12 @@ function getCliVersion() {
|
|
|
47252
47659
|
|
|
47253
47660
|
// src/expo-native-workspace.ts
|
|
47254
47661
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
47255
|
-
var
|
|
47662
|
+
var import_node_child_process33 = require("node:child_process");
|
|
47256
47663
|
var import_node_crypto27 = require("node:crypto");
|
|
47257
47664
|
var import_node_fs59 = __toESM(require("node:fs"), 1);
|
|
47258
47665
|
var import_node_module4 = require("node:module");
|
|
47259
47666
|
var import_node_path57 = __toESM(require("node:path"), 1);
|
|
47260
|
-
var
|
|
47667
|
+
var import_node_util11 = require("node:util");
|
|
47261
47668
|
init_admitted_mac_build();
|
|
47262
47669
|
|
|
47263
47670
|
// src/expo-workspace-exclusion.ts
|
|
@@ -47460,7 +47867,7 @@ init_is_record();
|
|
|
47460
47867
|
|
|
47461
47868
|
// src/native-firebase-config.ts
|
|
47462
47869
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
47463
|
-
var
|
|
47870
|
+
var import_node_child_process31 = require("node:child_process");
|
|
47464
47871
|
var import_node_fs54 = __toESM(require("node:fs"), 1);
|
|
47465
47872
|
var import_node_os14 = __toESM(require("node:os"), 1);
|
|
47466
47873
|
var import_node_path52 = __toESM(require("node:path"), 1);
|
|
@@ -47522,7 +47929,7 @@ async function readExpoConfigAsync(projectRoot) {
|
|
|
47522
47929
|
const directory2 = resultDirectory();
|
|
47523
47930
|
const resultPath = import_node_path52.default.join(directory2, "config.json");
|
|
47524
47931
|
try {
|
|
47525
|
-
const child = (0,
|
|
47932
|
+
const child = (0, import_node_child_process31.spawn)("node", expoConfigArgs(projectRoot, resultPath), {
|
|
47526
47933
|
cwd: projectRoot,
|
|
47527
47934
|
stdio: ["ignore", "ignore", "pipe"],
|
|
47528
47935
|
timeout: EXPO_CONFIG_TIMEOUT_MS
|
|
@@ -47581,13 +47988,13 @@ function portableInterfaceHash(directory2) {
|
|
|
47581
47988
|
|
|
47582
47989
|
// src/prepared-native-inventory.ts
|
|
47583
47990
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
47584
|
-
var
|
|
47991
|
+
var import_node_child_process32 = require("node:child_process");
|
|
47585
47992
|
var import_node_crypto25 = require("node:crypto");
|
|
47586
47993
|
var import_node_fs56 = __toESM(require("node:fs"), 1);
|
|
47587
47994
|
var import_node_module3 = require("node:module");
|
|
47588
47995
|
var import_node_path54 = __toESM(require("node:path"), 1);
|
|
47589
47996
|
var import_promises5 = require("node:timers/promises");
|
|
47590
|
-
var
|
|
47997
|
+
var import_node_util10 = require("node:util");
|
|
47591
47998
|
init_expo_autolinking();
|
|
47592
47999
|
init_is_record();
|
|
47593
48000
|
init_nitro_source();
|
|
@@ -47600,7 +48007,7 @@ async function preparedNativeInventory(app, selected, signal) {
|
|
|
47600
48007
|
paths: [import_node_path54.default.dirname(require2.resolve("expo/package.json"))]
|
|
47601
48008
|
});
|
|
47602
48009
|
const cli = import_node_path54.default.join(import_node_path54.default.dirname(expo), "bin/expo-modules-autolinking.js");
|
|
47603
|
-
const searched = await (0,
|
|
48010
|
+
const searched = await (0, import_node_util10.promisify)(import_node_child_process32.execFile)(
|
|
47604
48011
|
"node",
|
|
47605
48012
|
[cli, "search", ...autolinkerAppleFlags(expo, app), "--json"],
|
|
47606
48013
|
{ cwd: app, signal, maxBuffer: 8 * 1024 * 1024 }
|
|
@@ -47940,7 +48347,7 @@ async function hashWorkspaceInputs(app, everyByte, signal, sourceOnly = false, p
|
|
|
47940
48347
|
const mac = process.platform === "darwin" ? {
|
|
47941
48348
|
podVersion: (() => {
|
|
47942
48349
|
try {
|
|
47943
|
-
return (0,
|
|
48350
|
+
return (0, import_node_child_process33.execFileSync)("pod", ["--version"], {
|
|
47944
48351
|
encoding: "utf8",
|
|
47945
48352
|
env: utf8Env
|
|
47946
48353
|
});
|
|
@@ -47951,7 +48358,7 @@ async function hashWorkspaceInputs(app, everyByte, signal, sourceOnly = false, p
|
|
|
47951
48358
|
}
|
|
47952
48359
|
})(),
|
|
47953
48360
|
// runner-toolchain-platform: darwin
|
|
47954
|
-
xcode: (0,
|
|
48361
|
+
xcode: (0, import_node_child_process33.execFileSync)("xcodebuild", ["-version"], {
|
|
47955
48362
|
encoding: "utf8",
|
|
47956
48363
|
env: utf8Env
|
|
47957
48364
|
})
|
|
@@ -47961,7 +48368,7 @@ async function hashWorkspaceInputs(app, everyByte, signal, sourceOnly = false, p
|
|
|
47961
48368
|
preparation: 7,
|
|
47962
48369
|
appRelative,
|
|
47963
48370
|
...mac,
|
|
47964
|
-
node: (0,
|
|
48371
|
+
node: (0, import_node_child_process33.execFileSync)(
|
|
47965
48372
|
pinnedNode ? "mise" : "node",
|
|
47966
48373
|
pinnedNode ? ["exec", pinnedNode, "--", "node", "--version"] : ["--version"],
|
|
47967
48374
|
{ cwd: root, encoding: "utf8" }
|
|
@@ -48149,7 +48556,7 @@ async function copyInstalledWorkspace(root, destination, excluded) {
|
|
|
48149
48556
|
const clone = async () => {
|
|
48150
48557
|
const relative3 = entries.pop();
|
|
48151
48558
|
if (relative3 === void 0) return;
|
|
48152
|
-
await (0,
|
|
48559
|
+
await (0, import_node_util11.promisify)(import_node_child_process33.execFile)("cp", [
|
|
48153
48560
|
// -c clones on a Mac, as gnu cp already does where the filesystem can
|
|
48154
48561
|
...process.platform === "darwin" ? ["-c"] : [],
|
|
48155
48562
|
"-R",
|
|
@@ -48162,7 +48569,7 @@ async function copyInstalledWorkspace(root, destination, excluded) {
|
|
|
48162
48569
|
await Promise.all(Array.from({ length: 8 }, clone));
|
|
48163
48570
|
}
|
|
48164
48571
|
function trackedSourceEntries(root, work) {
|
|
48165
|
-
const listed = (0,
|
|
48572
|
+
const listed = (0, import_node_child_process33.spawnSync)("git", ["ls-files", "--stage", "-z"], {
|
|
48166
48573
|
cwd: root,
|
|
48167
48574
|
env: { ...process.env, ...isolatedGitEnv },
|
|
48168
48575
|
maxBuffer: 256 * 1024 * 1024
|
|
@@ -48176,8 +48583,8 @@ function trackedSourceEntries(root, work) {
|
|
|
48176
48583
|
function initializeWorkspaceGit(root, work) {
|
|
48177
48584
|
requireNativeGit();
|
|
48178
48585
|
const env = { ...process.env, ...isolatedGitEnv };
|
|
48179
|
-
(0,
|
|
48180
|
-
(0,
|
|
48586
|
+
(0, import_node_child_process33.execFileSync)("git", ["init", "--quiet"], { cwd: work, env });
|
|
48587
|
+
(0, import_node_child_process33.execFileSync)(
|
|
48181
48588
|
"git",
|
|
48182
48589
|
[
|
|
48183
48590
|
"-c",
|
|
@@ -48197,7 +48604,7 @@ function initializeWorkspaceGit(root, work) {
|
|
|
48197
48604
|
);
|
|
48198
48605
|
const tracked = trackedSourceEntries(root, work);
|
|
48199
48606
|
if (tracked.length > 0)
|
|
48200
|
-
(0,
|
|
48607
|
+
(0, import_node_child_process33.execFileSync)("git", ["update-index", "-z", "--index-info"], {
|
|
48201
48608
|
cwd: work,
|
|
48202
48609
|
env,
|
|
48203
48610
|
input: tracked.join("\0")
|
|
@@ -48253,7 +48660,7 @@ async function prepareWorkspace(app, stage, key2, podsEnvironment) {
|
|
|
48253
48660
|
}
|
|
48254
48661
|
const trustedConfigs = /* @__PURE__ */ new Set();
|
|
48255
48662
|
for (const cwd of [root, app]) {
|
|
48256
|
-
const result2 = (0,
|
|
48663
|
+
const result2 = (0, import_node_child_process33.spawnSync)("mise", ["config", "ls", "--json"], {
|
|
48257
48664
|
cwd,
|
|
48258
48665
|
encoding: "utf8"
|
|
48259
48666
|
});
|
|
@@ -48296,7 +48703,7 @@ async function prepareWorkspace(app, stage, key2, podsEnvironment) {
|
|
|
48296
48703
|
const command = [...prefix, ...args];
|
|
48297
48704
|
await run8(command[0], command.slice(1), cwd, env);
|
|
48298
48705
|
};
|
|
48299
|
-
const installedBun = manager.startsWith("bun@") ? (0,
|
|
48706
|
+
const installedBun = manager.startsWith("bun@") ? (0, import_node_child_process33.spawnSync)(bunExecutable, ["--version"], { encoding: "utf8" }) : null;
|
|
48300
48707
|
if (manager.startsWith("bun@") && (installedBun?.status !== 0 || installedBun.stdout.trim() !== manager.slice(4)))
|
|
48301
48708
|
await execute(
|
|
48302
48709
|
[
|
|
@@ -48415,7 +48822,7 @@ function stageCachedQuickCryptoOpenSsl(app) {
|
|
|
48415
48822
|
return;
|
|
48416
48823
|
import_node_fs59.default.rmSync(opensslDir, { recursive: true, force: true });
|
|
48417
48824
|
import_node_fs59.default.mkdirSync(opensslDir, { recursive: true });
|
|
48418
|
-
(0,
|
|
48825
|
+
(0, import_node_child_process33.execFileSync)("unzip", ["-q", "-o", archive, "-d", opensslDir]);
|
|
48419
48826
|
}
|
|
48420
48827
|
async function runAdmitted(lease, command, args, cwd, extraEnv) {
|
|
48421
48828
|
const admitted = teamMachineInstalled();
|
|
@@ -48884,7 +49291,7 @@ var import_node_crypto31 = require("node:crypto");
|
|
|
48884
49291
|
var import_node_fs64 = __toESM(require("node:fs"), 1);
|
|
48885
49292
|
var import_node_module5 = require("node:module");
|
|
48886
49293
|
var import_node_path62 = __toESM(require("node:path"), 1);
|
|
48887
|
-
var
|
|
49294
|
+
var import_node_util12 = require("node:util");
|
|
48888
49295
|
var import_plist5 = __toESM(require("plist"), 1);
|
|
48889
49296
|
init_answeredNativePackages();
|
|
48890
49297
|
|
|
@@ -48965,7 +49372,7 @@ init_swift_native_pin();
|
|
|
48965
49372
|
init_xcode_project();
|
|
48966
49373
|
var EXPO_NATIVE_ENTRY_NAME = "ios";
|
|
48967
49374
|
function expoNativeCompilerDigestValue() {
|
|
48968
|
-
return true ? "
|
|
49375
|
+
return true ? "5c577dbcb88d6c91ec20e51d76fe0d737f81c200e21973536cf1f8e51d076cbc" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
|
|
48969
49376
|
}
|
|
48970
49377
|
var IDENTITY_SOURCE_SKIPS = 1 | 4 | 8 | 16 | 32 | 64 | 128 | 4096;
|
|
48971
49378
|
function readSources(value) {
|
|
@@ -49110,7 +49517,7 @@ async function lookup(appRoot) {
|
|
|
49110
49517
|
const entry = await pending;
|
|
49111
49518
|
if (!entry) return null;
|
|
49112
49519
|
const digests2 = await expoNativePackageDigests(app.packages);
|
|
49113
|
-
return (0,
|
|
49520
|
+
return (0, import_node_util12.isDeepStrictEqual)(digests2, entry.packages) ? entry : null;
|
|
49114
49521
|
}
|
|
49115
49522
|
function prebuiltExpoNative(appRoot, iosTarget) {
|
|
49116
49523
|
if (iosTarget !== void 0) return Promise.resolve(null);
|
|
@@ -49259,9 +49666,9 @@ function macroArguments(source, open) {
|
|
|
49259
49666
|
}
|
|
49260
49667
|
return null;
|
|
49261
49668
|
}
|
|
49262
|
-
function definitionSelector(
|
|
49669
|
+
function definitionSelector(signature2) {
|
|
49263
49670
|
let selector = "";
|
|
49264
|
-
let rest =
|
|
49671
|
+
let rest = signature2.trim();
|
|
49265
49672
|
for (; ; ) {
|
|
49266
49673
|
const part = /^([A-Za-z_]\w*)?\s*(:)?\s*/.exec(rest);
|
|
49267
49674
|
if (!part || !part[1] && !part[2]) break;
|
|
@@ -49784,7 +50191,7 @@ init_swift_standins();
|
|
|
49784
50191
|
init_swift_submit();
|
|
49785
50192
|
init_swift_toolchain();
|
|
49786
50193
|
init_turbo_source();
|
|
49787
|
-
var run7 = (0,
|
|
50194
|
+
var run7 = (0, import_node_util17.promisify)(import_node_child_process46.execFile);
|
|
49788
50195
|
var scriptEnv = { ...process.env, [PEACH_FORKED_SCRIPT_ENV]: "1" };
|
|
49789
50196
|
var EXPO_SWIFT_ENTRY = "Sources/PeachExpoApp/PeachExpoEntry.swift";
|
|
49790
50197
|
var WITNESS_BATCH = 200;
|