peachsim 0.1.2209 → 0.1.2210
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/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 +271 -51
- 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 +270 -50
- 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 +271 -51
- package/dist-lib/host/fetch-proxy-handler.cjs +16 -3
- 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 +16 -3
- 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 +16 -3
- package/dist-lib/native-app-identity-project.cjs +15 -2
- package/dist-lib/native-app-identity-project.mjs +15 -2
- 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 +24 -24
- package/dist-lib/public-origins-lib.json +63 -53
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/reap-browser.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +271 -51
- package/dist-lib/swift-compile.cjs +58 -12
- package/dist-lib/swift-compile.mjs +57 -12
- 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 +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +253 -46
- package/dist-lib/vite.cjs +16 -3
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/package.json +1 -1
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CoreAnimation.h +2 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes +21 -0
- package/sdk/ios/usr/lib/swift/Combine.swiftmodule/arm64-apple-ios-simulator.swiftinterface +18 -0
- package/sdk/ios/usr/lib/swift/Foundation.swiftmodule/arm64-apple-ios-simulator.swiftinterface +1 -0
- package/sdk/ios/usr/lib/swift/SwiftUI.swiftmodule/arm64-apple-ios-simulator.swiftinterface +19 -0
- package/sdk/ios/usr/lib/swift/SwiftUICore.swiftmodule/arm64-apple-ios-simulator.swiftinterface +4 -0
- package/sdk/ios/usr/lib/swift/UIKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +4 -0
- package/sdk/ios/wasm/include/pthread.h +1 -0
- package/sdk/ios/wasm/include/signal.h +2 -2
- package/sdk/native-hashes.json +3 -3
- package/src/native-static-libraries.ts +7 -0
- package/src/swift-compile.ts +48 -10
- package/src/swift-host.ts +22 -3
- package/src/swift-objc-compile.ts +1 -1
- package/src/swift-objc-import.ts +32 -2
- package/src/swift-objc-standin.ts +1 -1
- package/src/swift-packages.ts +53 -28
- package/src/swift-pdf-raster.ts +60 -4
- package/src/swift-shipped-archives.json +44 -0
- package/src/swift-shipped-binaries.ts +12 -0
- package/src/swift-standin-emit.ts +9 -3
- package/src/swift-standins.ts +75 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2210 | (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;
|
|
@@ -9732,7 +9732,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
9732
9732
|
const coder = members2.some((member) => leaf(member) === "init(coder:)");
|
|
9733
9733
|
if (designated2 && !coder && externalRoot(id) !== "NSObject" && externalRoot(id) !== null)
|
|
9734
9734
|
emit(
|
|
9735
|
-
`${inner}public required init?(coder: NSCoder) { ${options.inert ? "return nil" : trap(`${path74}.init(coder:)`)} }`
|
|
9735
|
+
`${inner}public required init${options.coderNonfailable?.has(path74) ? "" : "?"}(coder: NSCoder) { ${options.inert && !options.coderNonfailable?.has(path74) ? "return nil" : trap(`${path74}.init(coder:)`)} }`
|
|
9736
9736
|
);
|
|
9737
9737
|
if (designated2 && !members2.some((member) => leaf(member) === "init()") && [...superChain(id)].some(
|
|
9738
9738
|
(at) => options.requiredInits?.has(`${pathOf(byId.get(at))}.init()`)
|
|
@@ -9913,15 +9913,18 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
9913
9913
|
const { 2: rest } = LEADING_ATTRS.exec(text(member));
|
|
9914
9914
|
const decl = rest.replace(/^(?:weak |unowned )/, "").replace(/^((?:static )?)let /, "$1var ");
|
|
9915
9915
|
const witness = `${owner2}.${leaf(member)}`;
|
|
9916
|
+
if (options.forcedOverride?.has(witness)) return;
|
|
9916
9917
|
const body = options.inert ? inertBody(member) : trap(witness);
|
|
9917
9918
|
if (member.kind.identifier === "swift.property" || member.kind.identifier === "swift.type.property") {
|
|
9918
9919
|
const parsed = splitAccessors(decl);
|
|
9919
9920
|
const setter = parsed.settable ? ` ${parsed.nonmutating ? "nonmutating " : ""}set { ${body} }` : "";
|
|
9920
|
-
|
|
9921
|
+
emitAt(
|
|
9922
|
+
witness,
|
|
9921
9923
|
`${indent2}${visibility} ${parsed.decl} { get${parsed.effects} { ${body} }${setter} }`
|
|
9922
9924
|
);
|
|
9923
9925
|
} else
|
|
9924
|
-
|
|
9926
|
+
emitAt(
|
|
9927
|
+
witness,
|
|
9925
9928
|
`${indent2}${member.kind.identifier === "swift.init" ? "public required " : visibility + " "}${stripDefaults(decl)} { ${body} }`
|
|
9926
9929
|
);
|
|
9927
9930
|
};
|
|
@@ -11483,7 +11486,7 @@ var init_swift_objc_standin = __esm({
|
|
|
11483
11486
|
};
|
|
11484
11487
|
NATIVE_GRAPH_ID = (0, import_node_crypto12.createHash)("sha256").update(JSON.stringify(NATIVE_GRAPH_INPUTS)).digest("hex");
|
|
11485
11488
|
ROUNDS = 12;
|
|
11486
|
-
headerFiles = (dir) => import_node_fs32.default.readdirSync(dir, { recursive: true, encoding: "utf8" }).filter((file) => file.endsWith(".h")).sort();
|
|
11489
|
+
headerFiles = (dir) => import_node_fs32.default.readdirSync(dir, { recursive: true, encoding: "utf8" }).filter((file) => file.endsWith(".h") || file.endsWith(".hh")).sort();
|
|
11487
11490
|
MISSING_IMPORT = "#import <PeachMissing/PeachMissing.h>\n";
|
|
11488
11491
|
FRAMEWORK_HEADER = /^System\/Library\/Frameworks\/([^/]+)\.framework\/Headers\/(.+)$/;
|
|
11489
11492
|
FRAMEWORK_MODULEMAP = /^System\/Library\/Frameworks\/([^/]+)\.framework\/Modules\/module\.modulemap$/;
|
|
@@ -18622,16 +18625,30 @@ function swiftClangImporterFlags(flags) {
|
|
|
18622
18625
|
(flag) => flag !== "-fobjc-arc" && flag !== "-fno-objc-arc" && !/^-std=(?:c(?!\+\+)|gnu(?!\+\+)|iso9899:)/.test(flag)
|
|
18623
18626
|
);
|
|
18624
18627
|
}
|
|
18625
|
-
function
|
|
18628
|
+
function swiftSubmoduleImports(sources) {
|
|
18629
|
+
const imports2 = /* @__PURE__ */ new Map();
|
|
18630
|
+
for (const source of sources)
|
|
18631
|
+
for (const [, module2, submodule] of source.matchAll(SWIFT_SUBMODULE_IMPORT)) {
|
|
18632
|
+
const names = imports2.get(module2) ?? /* @__PURE__ */ new Set();
|
|
18633
|
+
names.add(submodule);
|
|
18634
|
+
imports2.set(module2, names);
|
|
18635
|
+
}
|
|
18636
|
+
return imports2;
|
|
18637
|
+
}
|
|
18638
|
+
function swiftObjCModuleMap(module2, headers, submodules = /* @__PURE__ */ new Set()) {
|
|
18639
|
+
const header = (file) => `header ${JSON.stringify(file)}`;
|
|
18640
|
+
const stem = (file) => file.slice(file.lastIndexOf("/") + 1).replace(/\.[^.]*$/, "");
|
|
18626
18641
|
return [
|
|
18627
18642
|
`module ${module2} {`,
|
|
18628
|
-
...headers.map(
|
|
18643
|
+
...headers.map(
|
|
18644
|
+
(file) => submodules.has(stem(file)) ? ` module ${stem(file)} { ${header(file)} export * }` : ` ${header(file)}`
|
|
18645
|
+
),
|
|
18629
18646
|
" export *",
|
|
18630
18647
|
"}",
|
|
18631
18648
|
""
|
|
18632
18649
|
].join("\n");
|
|
18633
18650
|
}
|
|
18634
|
-
var SWIFT_OBJC_INTEROP_FLAGS;
|
|
18651
|
+
var SWIFT_OBJC_INTEROP_FLAGS, SWIFT_SUBMODULE_IMPORT;
|
|
18635
18652
|
var init_swift_objc_import = __esm({
|
|
18636
18653
|
"src/swift-objc-import.ts"() {
|
|
18637
18654
|
"use strict";
|
|
@@ -18646,6 +18663,7 @@ var init_swift_objc_import = __esm({
|
|
|
18646
18663
|
"-Xcc",
|
|
18647
18664
|
"-fblocks"
|
|
18648
18665
|
];
|
|
18666
|
+
SWIFT_SUBMODULE_IMPORT = /^[ \t]*(?:@\w+(?:\([^)]*\))?[ \t]+)*import[ \t]+([A-Za-z_]\w*)\.([A-Za-z_]\w*)[ \t]*(?:\/\/.*)?$/gm;
|
|
18649
18667
|
}
|
|
18650
18668
|
});
|
|
18651
18669
|
|
|
@@ -21000,6 +21018,12 @@ function stripCCode(source) {
|
|
|
21000
21018
|
}
|
|
21001
21019
|
return code;
|
|
21002
21020
|
}
|
|
21021
|
+
function swiftCTakesReturnAddress(source) {
|
|
21022
|
+
if (!source.includes("__builtin_return_address")) return false;
|
|
21023
|
+
return /\b__builtin_return_address\s*\(/.test(
|
|
21024
|
+
cActiveCode(stripCCode(source), wasmMacroEnvironment)
|
|
21025
|
+
);
|
|
21026
|
+
}
|
|
21003
21027
|
function swiftCMainEntry(file, source, env = emptyMacroEnvironment) {
|
|
21004
21028
|
if (!isSwiftNativeTranslationUnit(file)) return false;
|
|
21005
21029
|
const code = cActiveCode(stripCCode(source), env);
|
|
@@ -21274,6 +21298,11 @@ ${swiftProjectFilesProblems(input.projectFiles).join("\n")}`
|
|
|
21274
21298
|
clangImportedModules.add(name3);
|
|
21275
21299
|
}
|
|
21276
21300
|
}
|
|
21301
|
+
const submoduleImports = swiftSubmoduleImports(
|
|
21302
|
+
Object.entries(input.files).flatMap(
|
|
21303
|
+
([file, contents]) => file.endsWith(".swift") ? [contents] : []
|
|
21304
|
+
)
|
|
21305
|
+
);
|
|
21277
21306
|
const headerDirectory = import_node_path47.default.join(layout2.root, ".build", "peach-cxx-headers");
|
|
21278
21307
|
const flattenedHeaders = /* @__PURE__ */ new Set();
|
|
21279
21308
|
if ((0, import_node_fs50.existsSync)(headerDirectory)) {
|
|
@@ -21659,7 +21688,8 @@ ${swiftProjectFilesProblems(input.projectFiles).join("\n")}`
|
|
|
21659
21688
|
);
|
|
21660
21689
|
const moduleContents = originalModuleMap ? input.files[originalModuleMap[1]] : swiftpmModuleMap?.contents ?? packageModuleMap?.[1] ?? swiftObjCModuleMap(
|
|
21661
21690
|
swiftTargetModuleName(target.name),
|
|
21662
|
-
roots2.map((file) => import_node_path47.default.join(layout2.root, file))
|
|
21691
|
+
roots2.map((file) => import_node_path47.default.join(layout2.root, file)),
|
|
21692
|
+
submoduleImports.get(swiftTargetModuleName(target.name))
|
|
21663
21693
|
);
|
|
21664
21694
|
if (moduleContents === void 0)
|
|
21665
21695
|
throw new Error("missing original module map " + modulemap);
|
|
@@ -21984,10 +22014,14 @@ module ${moduleName}.Swift {
|
|
|
21984
22014
|
header ${JSON.stringify(import_node_path47.default.join(headerDirectory, name3 + "-Swift.h"))}
|
|
21985
22015
|
requires objc
|
|
21986
22016
|
}
|
|
21987
|
-
` : swiftObjCModuleMap(
|
|
21988
|
-
|
|
21989
|
-
|
|
21990
|
-
|
|
22017
|
+
` : swiftObjCModuleMap(
|
|
22018
|
+
moduleName,
|
|
22019
|
+
[
|
|
22020
|
+
...(input.nativeTargets?.find((target) => target.name === name3)?.publicHeaders ?? []).map((header) => import_node_path47.default.join(layout2.root, header)),
|
|
22021
|
+
import_node_path47.default.join(headerDirectory, name3 + "-Swift.h")
|
|
22022
|
+
],
|
|
22023
|
+
submoduleImports.get(moduleName)
|
|
22024
|
+
)
|
|
21991
22025
|
);
|
|
21992
22026
|
nativeHeaderFlags.push("-fmodule-map-file=" + modulemap);
|
|
21993
22027
|
}
|
|
@@ -22970,8 +23004,12 @@ async function buildFrameworkProducts(scratch2, args) {
|
|
|
22970
23004
|
const linked = frameworkLinkClosure(scratch2, linkedTargets.targets);
|
|
22971
23005
|
const objects = linked.objects;
|
|
22972
23006
|
if (linked.modules.has("UniformTypeIdentifiers")) {
|
|
22973
|
-
const
|
|
22974
|
-
|
|
23007
|
+
const constantsDir = import_node_path47.default.join(scratch2, "uniform-type-constants");
|
|
23008
|
+
const constantsStamp = import_node_path47.default.join(constantsDir, ".complete");
|
|
23009
|
+
const object6 = import_node_path47.default.join(constantsDir, "UniformTypeIdentifiers-NativeConstants.o");
|
|
23010
|
+
if (!(0, import_node_fs50.existsSync)(constantsStamp) || (0, import_node_fs50.readFileSync)(constantsStamp, "utf8") !== args.frameworkKey) {
|
|
23011
|
+
(0, import_node_fs50.rmSync)(constantsDir, { recursive: true, force: true });
|
|
23012
|
+
(0, import_node_fs50.mkdirSync)(constantsDir);
|
|
22975
23013
|
const sdkPaths2 = swiftSdkPaths(args.moduleRoot, args.toolchainBin);
|
|
22976
23014
|
compileUniformTypeConstants({
|
|
22977
23015
|
bin: args.toolchainBin,
|
|
@@ -22979,8 +23017,9 @@ async function buildFrameworkProducts(scratch2, args) {
|
|
|
22979
23017
|
darwin: sdkPaths2.darwin,
|
|
22980
23018
|
packageRoot: args.moduleRoot,
|
|
22981
23019
|
minimum: darwinRecordsMinimum(),
|
|
22982
|
-
out:
|
|
23020
|
+
out: constantsDir
|
|
22983
23021
|
});
|
|
23022
|
+
(0, import_node_fs50.writeFileSync)(constantsStamp, args.frameworkKey);
|
|
22984
23023
|
}
|
|
22985
23024
|
objects.push(object6);
|
|
22986
23025
|
linked.owners.set(object6, "UniformTypeIdentifiers");
|
|
@@ -23665,7 +23704,7 @@ function compileSwiftProjectOnce(input, options) {
|
|
|
23665
23704
|
options.signal
|
|
23666
23705
|
);
|
|
23667
23706
|
}
|
|
23668
|
-
var import_node_child_process27, 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, SPRITEKIT_PRODUCT, importsSpriteKit, FOUNDATION_IMPLICIT_MODULES, FOUNDATION_IMPLICIT_FLAGS, ONE_IMPLICIT_FLAGS, executableLinkFlags, darwinRecordsRegion, REACTOR_FLAG, MULTI_MANIFEST_VERSION, SWIFT_HEADER_PRODUCTS_TARGET, compilerSourceDigest, nativeCxxCompilerFlags, cFlagArray, cxxFlagArray, DIRECTIVE, OS_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, 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;
|
|
23707
|
+
var import_node_child_process27, 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, SPRITEKIT_PRODUCT, importsSpriteKit, FOUNDATION_IMPLICIT_MODULES, FOUNDATION_IMPLICIT_FLAGS, ONE_IMPLICIT_FLAGS, executableLinkFlags, darwinRecordsRegion, REACTOR_FLAG, MULTI_MANIFEST_VERSION, SWIFT_HEADER_PRODUCTS_TARGET, compilerSourceDigest, nativeCxxCompilerFlags, cFlagArray, cxxFlagArray, DIRECTIVE, OS_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;
|
|
23669
23708
|
var init_swift_compile = __esm({
|
|
23670
23709
|
"src/swift-compile.ts"() {
|
|
23671
23710
|
"use strict";
|
|
@@ -23878,7 +23917,7 @@ int EXUpdatesApplyBSDiffPatch(const char * _Nonnull oldFilePath,
|
|
|
23878
23917
|
REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
23879
23918
|
MULTI_MANIFEST_VERSION = 68;
|
|
23880
23919
|
SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
|
|
23881
|
-
compilerSourceDigest = true ? "
|
|
23920
|
+
compilerSourceDigest = true ? "4fa3e84f8c3b585bc8e864c92f0682e6f02757d455de1ce784f0d40ba9df875a" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
|
|
23882
23921
|
nativeCxxCompilerFlags = ["-fno-cxx-modules"];
|
|
23883
23922
|
cFlagArray = (flags) => JSON.stringify(withoutGlogModuleMap(flags));
|
|
23884
23923
|
cxxFlagArray = (flags) => JSON.stringify([...nativeCxxCompilerFlags, ...withoutGlogModuleMap(flags)]);
|
|
@@ -24403,6 +24442,14 @@ int EXUpdatesApplyBSDiffPatch(const char * _Nonnull oldFilePath,
|
|
|
24403
24442
|
predefines: /* @__PURE__ */ new Map(),
|
|
24404
24443
|
targetDefined: /* @__PURE__ */ new Set()
|
|
24405
24444
|
};
|
|
24445
|
+
wasmMacroEnvironment = {
|
|
24446
|
+
...emptyMacroEnvironment,
|
|
24447
|
+
defines: /* @__PURE__ */ new Map([
|
|
24448
|
+
["__wasm__", "1"],
|
|
24449
|
+
["__wasm32__", "1"],
|
|
24450
|
+
["__wasi__", "1"]
|
|
24451
|
+
])
|
|
24452
|
+
};
|
|
24406
24453
|
HIDDEN_UNITS = "PeachHiddenUnits";
|
|
24407
24454
|
LIBXML_REFERENCE = /(?:^|\n)[ \t]*#[ \t]*(?:include|import)[ \t]*["<][ \t]*libxml\/|@import[ \t]+libxml2[ \t]*;|(?:^|\n)[ \t]*import[ \t]+libxml2(?![\w.])/;
|
|
24408
24455
|
LIBXML_SOURCE = /\.(?:c|m|mm|cc|cpp|cxx|h|hh|hpp|hxx|swift)$/;
|
|
@@ -27987,7 +28034,7 @@ var init_swift_standin_digest = __esm({
|
|
|
27987
28034
|
STANDIN_DIGEST_ENTRYPOINTS = ["swift-standins.ts", "swift-objc-compile.ts"];
|
|
27988
28035
|
SPECIFIER = /from\s*['"]([^'"]+)['"]|import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
|
|
27989
28036
|
standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS);
|
|
27990
|
-
STANDIN_SOURCE_DIGEST = true ? "
|
|
28037
|
+
STANDIN_SOURCE_DIGEST = true ? "9adf53d6f1cfece1b7a3e23bad712630278818d71b5b718384cf640144349600" : standinSourceDigest();
|
|
27991
28038
|
}
|
|
27992
28039
|
});
|
|
27993
28040
|
|
|
@@ -28536,6 +28583,13 @@ var init_native_static_libraries = __esm({
|
|
|
28536
28583
|
upstream: "b94213a11b3a2edadfae89f0c57a7f4ab72772c9",
|
|
28537
28584
|
recipe: "a2642115a5eeb04559c9f1daaa4b4cbe4b1c211533b4cc80cb8339a4477af205",
|
|
28538
28585
|
archive: "libsksg.a"
|
|
28586
|
+
},
|
|
28587
|
+
{
|
|
28588
|
+
name: "webgpu_dawn",
|
|
28589
|
+
nativeSha256: "95078993275bccc969b1dfa1ad0934cbacc05ae59e8aa2a6cc46ce93e97d4f69",
|
|
28590
|
+
upstream: "3d786993a7ded64c4ebb4884b9b079db9ad0e580",
|
|
28591
|
+
recipe: "c55468cc976e837ad894133f2231beb7d1ed64633af7b457b8a2610d7df45994",
|
|
28592
|
+
archive: "libwebgpu_dawn.a"
|
|
28539
28593
|
}
|
|
28540
28594
|
];
|
|
28541
28595
|
}
|
|
@@ -28630,6 +28684,72 @@ var init_numbered_lock = __esm({
|
|
|
28630
28684
|
}
|
|
28631
28685
|
});
|
|
28632
28686
|
|
|
28687
|
+
// src/swift-shipped-archives.json
|
|
28688
|
+
var swift_shipped_archives_default;
|
|
28689
|
+
var init_swift_shipped_archives = __esm({
|
|
28690
|
+
"src/swift-shipped-archives.json"() {
|
|
28691
|
+
swift_shipped_archives_default = {
|
|
28692
|
+
AppCheckCore: "a18d4e5aff27ff4b9bce8d6e73e55ccf1d11515311e219aa4473319cdff3187b",
|
|
28693
|
+
AppLovinSDK: "c00f052c4b15766a6a2734e2b3685234e6bd28dbc47fbe7cbc3edbf56f701d5c",
|
|
28694
|
+
AppsFlyerLib: "13bae495e63e22579dd9525a1c9e88d8eedc78b4586979b7e2d492cfd3efbe1f",
|
|
28695
|
+
FBAEMKit: "ceaf685683c6a23ae4893150d0d770aeeaec34811ac8c146b3aa351beade5fa0",
|
|
28696
|
+
FBAudienceNetwork: "4d84bf1e404a83852a93af2ae73e22e45bb2b11e0a9a445c3b461173a5d6aec3",
|
|
28697
|
+
FBLPromises: "3544fb457e7f60c69740cdd26617a75bdd613943e948becca643022c7edd76c0",
|
|
28698
|
+
FBSDKCoreKit: "1577edd62ec0c172928befed3b309dc59ae8915d2aaad091460d9d1be5ddc13d",
|
|
28699
|
+
FBSDKCoreKit_Basics: "c780833f204f9ec6eab70a3758a45c5c78bfb6f4e590289ccf395497f204cac1",
|
|
28700
|
+
FirebaseAnalytics: "e3253a494375c5174d20cb81925e20afa1ff6b1419125cb608d39b092b53ff2a",
|
|
28701
|
+
FirebaseAppCheck: "af82d72727d55d14f65eee96845d4d9495e4e603b4673709d6f3448b9595cc63",
|
|
28702
|
+
FirebaseAppCheckInterop: "7ffd54e6fe187bf8cd714e3d863e0095f7cbbb0fb802adb87a40c552de7cffcc",
|
|
28703
|
+
FirebaseAuth: "fcde09db8d45ffba67802e81c17b8046db6b56568226ace3fca898983b08c968",
|
|
28704
|
+
FirebaseAuthInterop: "e8e6f4fb42b3fa76c2bade7a522ab0f224558d27d2321175c791d307541787a8",
|
|
28705
|
+
FirebaseCore: "30e3505c715e17682c1dc20bb26ba475e99e6981a9a0dba3cf9352eea632fc1d",
|
|
28706
|
+
FirebaseCoreExtension: "e37ce2abcd4c218ab5426da78cbe7ab41f79ee7eba1d02dd4b0cde952ed2c4a0",
|
|
28707
|
+
FirebaseCoreInternal: "72a15c0c63585faf93e9ffa91e8a8c1c50b24749405804ffae19a29ec05b07ab",
|
|
28708
|
+
FirebaseCrashlytics: "e03c71913efd97678b895abb1e968c83e58b3fbd7955a81ec6e6581b95db16e3",
|
|
28709
|
+
FirebaseFirestore: "f7a1bb7fc4a2fb09298b514114d6aaca9a4f00fd8868667524a05bc4563bf1fd",
|
|
28710
|
+
FirebaseFirestoreInternal: "d9595a1784beaf5cd4a8e0dda0f4364ddfa6b536ad60f82746d81d14dce037a3",
|
|
28711
|
+
FirebaseInstallations: "141e313325bab001f2dbb79dc8a433f884f4c4a12a5feb665e6958098d637f7b",
|
|
28712
|
+
FirebaseRemoteConfig: "e0ae6d626a423d535bc67216f9f0cd66f98f1c0fb4b5bf88074d4496733e2db1",
|
|
28713
|
+
FirebaseRemoteConfigInterop: "794f599eb4232058715b606fa671639c8cc5d821655a0f739651d17c5ef65c37",
|
|
28714
|
+
FirebaseSessions: "1781d72e47dac0fc7a532412641021730bd5b659135633cd9ef7b97ccd31b0ce",
|
|
28715
|
+
FirebaseSharedSwift: "8d63b09a517733ef3a58390bf1e8cf054f058bdd618bb4f19a1f4b5a0b4f09e5",
|
|
28716
|
+
FirebaseStorage: "636b33180dd5ad60b4878357691fe6472cf3bd57ec691e9d661c5444f523df66",
|
|
28717
|
+
GTMSessionFetcher: "f58dc2bd9db39defd73f0f67e7a11893a0c6e6f0ba45cd83cf420b2b3c15f1bd",
|
|
28718
|
+
GoogleAdsOnDeviceConversion: "31a5a1f5204f4844a480d3889b6ebe2e69473ef32b868935c51812c0483cb08b",
|
|
28719
|
+
GoogleAppMeasurement: "5741e6334392e0345f1b5896111ffef4d5a78859970f5e197fa0b7d881165305",
|
|
28720
|
+
GoogleAppMeasurementIdentitySupport: "b70cb033eeb002ed1c5a8140953ccb3be0221ca754c05fe450ed9c9c6547f274",
|
|
28721
|
+
GoogleDataTransport: "7d08050419e0906f13039cc4d2dd69be075234c0bf5bbb34df9dd4891e48831d",
|
|
28722
|
+
GoogleMobileAds: "f2c09c60ee331ce029f563304ad73a481d57ace0d4bc11ce33a2bf59497c59bf",
|
|
28723
|
+
GoogleUtilities: "37a9d3d3810dad763a8a79bd4c7cc4c37b386240725aca07f45dba1826676c8c",
|
|
28724
|
+
Intercom: "fc8251f24b305b91f83304d4dffaf1a90c424a7bc37be8b595dd1fc5cff566ea",
|
|
28725
|
+
Promises: "6d8f1a4b3d561d67adfc2026834779b05685d1cdacea6e83c70d0641c39f24de",
|
|
28726
|
+
RecaptchaInterop: "cf5cc62ebc237b34d5267c1190d18f33b424dbc7f81713f127108d0ad8a592cf",
|
|
28727
|
+
RiveRuntime: "72b6ff5c5a1d153c9cdbea9a917c09be557cfcb1fafa02853fa06b0268551710",
|
|
28728
|
+
absl: "fff0388cf074c69a2da4bc197a005da0b8e5c23ebdcfa383600c540a342f9df1",
|
|
28729
|
+
grpc: "918737c9f8f93e14127b3894e31c7a0522475f2247b74f87d8166dff3a6bafb0",
|
|
28730
|
+
grpcpp: "b83f85e0256cf06df00cf0ed728b5c0d68373ca401742877935771447450b90a",
|
|
28731
|
+
leveldb: "5521a6e6e4cd01b2e31b099d4341f1bccae7e8ba43de648b028928573daf8bb4",
|
|
28732
|
+
nanopb: "a7fafe2e4e16d99de4c58f72e22dcc53221885aa6d678d1270123e4b01badfa3",
|
|
28733
|
+
openssl_grpc: "b2aaede82457cdd15915762a4f57b38e28ba0f47b9b48556a7e0c46881973096"
|
|
28734
|
+
};
|
|
28735
|
+
}
|
|
28736
|
+
});
|
|
28737
|
+
|
|
28738
|
+
// src/swift-shipped-binaries.ts
|
|
28739
|
+
function shippedBinaryDiffers(target, checksum) {
|
|
28740
|
+
const shipped = SHIPPED_ARCHIVES.get(target);
|
|
28741
|
+
return shipped !== void 0 && checksum !== null && checksum !== shipped;
|
|
28742
|
+
}
|
|
28743
|
+
var SHIPPED_ARCHIVES;
|
|
28744
|
+
var init_swift_shipped_binaries = __esm({
|
|
28745
|
+
"src/swift-shipped-binaries.ts"() {
|
|
28746
|
+
"use strict";
|
|
28747
|
+
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
28748
|
+
init_swift_shipped_archives();
|
|
28749
|
+
SHIPPED_ARCHIVES = new Map(Object.entries(swift_shipped_archives_default));
|
|
28750
|
+
}
|
|
28751
|
+
});
|
|
28752
|
+
|
|
28633
28753
|
// src/swift-packages.ts
|
|
28634
28754
|
function remoteSwiftCheckouts(root) {
|
|
28635
28755
|
const prepared = preparedSwiftCheckouts(root);
|
|
@@ -28638,16 +28758,22 @@ function remoteSwiftCheckouts(root) {
|
|
|
28638
28758
|
import_node_fs68.default.mkdirSync(cacheDir(), { recursive: true });
|
|
28639
28759
|
return import_node_path66.default.join(import_node_fs68.default.realpathSync(cacheDir()), "swift-packages", key2, "checkouts");
|
|
28640
28760
|
}
|
|
28641
|
-
function
|
|
28761
|
+
function unlowerableSources(files2, target) {
|
|
28762
|
+
if (target.declaresWasiNativeSettings) return [];
|
|
28763
|
+
return [
|
|
28764
|
+
...files2.filter((file) => UNSUPPORTED_NATIVE.test(file)),
|
|
28765
|
+
...files2.filter(isSwiftNativeTranslationUnit).filter((file) => swiftCTakesReturnAddress(import_node_fs68.default.readFileSync(file, "utf8")))
|
|
28766
|
+
];
|
|
28767
|
+
}
|
|
28768
|
+
function unloweredSources(files2, target) {
|
|
28642
28769
|
if (target.type !== "regular") return null;
|
|
28643
|
-
if (target.declaresWasiNativeSettings) return null;
|
|
28644
|
-
const assembly = files2.filter((file) => UNSUPPORTED_NATIVE.test(file));
|
|
28645
|
-
if (assembly.length === 0) return null;
|
|
28646
28770
|
if (!files2.some(isSwiftNativeTranslationUnit)) return null;
|
|
28771
|
+
const unlowered = unlowerableSources(files2, target);
|
|
28772
|
+
if (unlowered.length === 0) return null;
|
|
28647
28773
|
const headers = import_node_path66.default.resolve(target.dir, target.publicHeadersPath);
|
|
28648
28774
|
if (!files2.some((file) => file.startsWith(`${headers}${import_node_path66.default.sep}`) && file.endsWith(".h")))
|
|
28649
28775
|
return null;
|
|
28650
|
-
return
|
|
28776
|
+
return unlowered;
|
|
28651
28777
|
}
|
|
28652
28778
|
function resolvedPins(data) {
|
|
28653
28779
|
if (!data || typeof data !== "object") return null;
|
|
@@ -28943,9 +29069,9 @@ function resolveSwiftPackages(options) {
|
|
|
28943
29069
|
if (target.type === "macro") return preservePackage(pkg, [name3], "host");
|
|
28944
29070
|
const files2 = target.type === "regular" || target.type === "system" ? swiftTargetFiles(pkg.manifest, target) : [];
|
|
28945
29071
|
const gap = options.binaryGaps?.get(name3);
|
|
28946
|
-
const
|
|
29072
|
+
const unlowerable = unlowerableSources(files2, target);
|
|
28947
29073
|
const placeholder = placeholderPackage(pkg);
|
|
28948
|
-
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` :
|
|
29074
|
+
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 wasm32 lowering: ${unlowerable.map((file) => import_node_path66.default.relative(pkg.manifest.dir, file)).join(", ")}${gap ? `; ${gap}` : ""}` : null;
|
|
28949
29075
|
const reasons = target.dependencies.map((dependency) => {
|
|
28950
29076
|
if (dependency.kind === "target") return resolveTarget(pkg, dependency.name);
|
|
28951
29077
|
const nested = resolveDependencyProduct(pkg, dependency);
|
|
@@ -29024,7 +29150,7 @@ function resolveSwiftPackages(options) {
|
|
|
29024
29150
|
(file) => file.endsWith(".swift") && import_node_fs68.default.readFileSync(file, "utf8").trim() === ""
|
|
29025
29151
|
))
|
|
29026
29152
|
return false;
|
|
29027
|
-
if (
|
|
29153
|
+
if (unloweredSources(files2, target)) return false;
|
|
29028
29154
|
claimed.add(key2);
|
|
29029
29155
|
providedTargets.delete(name3);
|
|
29030
29156
|
for (const dependency of target.dependencies) {
|
|
@@ -29038,6 +29164,13 @@ function resolveSwiftPackages(options) {
|
|
|
29038
29164
|
};
|
|
29039
29165
|
const claimProduct = (pkg, product) => {
|
|
29040
29166
|
const roots = pkg.manifest.products.get(product)?.targets ?? [];
|
|
29167
|
+
for (const root of roots) {
|
|
29168
|
+
const target = pkg.manifest.targets.get(root);
|
|
29169
|
+
if (target?.type === "binary" && !options.standinTargets?.has(root) && shippedBinaryDiffers(root, target.checksum)) {
|
|
29170
|
+
providedTargets.delete(root);
|
|
29171
|
+
providedProducts.delete(product);
|
|
29172
|
+
}
|
|
29173
|
+
}
|
|
29041
29174
|
if (roots.map((name3) => claimTarget(pkg, name3)).some(Boolean))
|
|
29042
29175
|
providedProducts.delete(product);
|
|
29043
29176
|
};
|
|
@@ -29065,7 +29198,7 @@ function resolveSwiftPackages(options) {
|
|
|
29065
29198
|
if (target.type === "executable") continue;
|
|
29066
29199
|
const files2 = target.type === "regular" || target.type === "system" ? swiftTargetFiles(pkg.manifest, target) : [];
|
|
29067
29200
|
const objc = target.type === "regular" && files2.some((file) => /\.(m|mm)$/.test(file));
|
|
29068
|
-
const
|
|
29201
|
+
const unlowered = unloweredSources(files2, target);
|
|
29069
29202
|
const gap = placeholderPackage(pkg);
|
|
29070
29203
|
const sources = files2.filter((file) => file.endsWith(".swift"));
|
|
29071
29204
|
const release = (setting) => setting.configuration !== "debug";
|
|
@@ -29092,7 +29225,7 @@ function resolveSwiftPackages(options) {
|
|
|
29092
29225
|
]
|
|
29093
29226
|
}
|
|
29094
29227
|
});
|
|
29095
|
-
else if (target.type === "binary" || objc ||
|
|
29228
|
+
else if (target.type === "binary" || objc || unlowered)
|
|
29096
29229
|
result.binaries.push({
|
|
29097
29230
|
target: name3,
|
|
29098
29231
|
source: pkg.source,
|
|
@@ -29106,8 +29239,8 @@ function resolveSwiftPackages(options) {
|
|
|
29106
29239
|
import_node_path66.default.join(target.dir, target.publicHeadersPath)
|
|
29107
29240
|
)
|
|
29108
29241
|
},
|
|
29109
|
-
...
|
|
29110
|
-
|
|
29242
|
+
...unlowered ? {
|
|
29243
|
+
unloweredSources: unlowered.map(
|
|
29111
29244
|
(file) => import_node_path66.default.relative(pkg.manifest.dir, file)
|
|
29112
29245
|
)
|
|
29113
29246
|
} : {}
|
|
@@ -29328,8 +29461,10 @@ var init_swift_packages = __esm({
|
|
|
29328
29461
|
init_native_git();
|
|
29329
29462
|
init_numbered_lock();
|
|
29330
29463
|
init_prepared_xcode_phases();
|
|
29464
|
+
init_swift_compile();
|
|
29331
29465
|
init_swift_package();
|
|
29332
29466
|
init_swift_package_manifest();
|
|
29467
|
+
init_swift_shipped_binaries();
|
|
29333
29468
|
swiftBinaryOnDisk = (binary2) => binary2.url !== null || import_node_fs68.default.existsSync(binary2.dir);
|
|
29334
29469
|
SWIFT_PLACEHOLDER_PACKAGES = /* @__PURE__ */ new Map();
|
|
29335
29470
|
placeholderPackage = (pkg) => SWIFT_PLACEHOLDER_PACKAGES.get(swiftPackageIdentity(pkg.manifest.dir));
|
|
@@ -30928,7 +31063,7 @@ function interfaceEnumValues(graphs, interfaceText) {
|
|
|
30928
31063
|
const declarations = [
|
|
30929
31064
|
...interfaceText.matchAll(
|
|
30930
31065
|
new RegExp(
|
|
30931
|
-
`^([ \\t]*)(?:@[\\w.]+(?:\\([^)]*\\))?\\s+)*(?:nonisolated\\s+)?(?:public|open)\\s+enum\\s+${name3}\\s*:\\s*(?:Swift\\.)?U?Int(?:8|16|32|64)
|
|
31066
|
+
`^([ \\t]*)(?:@[\\w.]+(?:\\([^)]*\\))?\\s+)*(?:nonisolated\\s+)?(?:public|open)\\s+enum\\s+${name3}\\s*:\\s*(?:Swift\\.)?(?:U?Int(?:8|16|32|64)?|IntegerLiteralType)\\b[^{]*\\{[ \\t]*$`,
|
|
30932
31067
|
"gm"
|
|
30933
31068
|
)
|
|
30934
31069
|
)
|
|
@@ -31027,9 +31162,26 @@ function mixedStandin(surface, binary2, toolchain, work, behavior, frameworkDirs
|
|
|
31027
31162
|
view.protocolProperties ?? /* @__PURE__ */ new Map(),
|
|
31028
31163
|
null,
|
|
31029
31164
|
view.inheritedConformances,
|
|
31030
|
-
interfaceProjections(view.graphs, interfaceText)
|
|
31165
|
+
interfaceProjections(view.graphs, interfaceText),
|
|
31166
|
+
[],
|
|
31167
|
+
externalConformances(surface.module, interfaceText)
|
|
31031
31168
|
);
|
|
31032
31169
|
}
|
|
31170
|
+
function externalConformances(module2, interfaceText) {
|
|
31171
|
+
const lines = /* @__PURE__ */ new Set();
|
|
31172
|
+
for (const match of interfaceText.matchAll(
|
|
31173
|
+
/^(?:@\w+\s+)*extension\s+([\w.]+)\s*:\s*([^{\n]+?)\s*\{/gm
|
|
31174
|
+
)) {
|
|
31175
|
+
const [, extended, conformances] = match;
|
|
31176
|
+
if (extended.startsWith(`${module2}.`) || /\bwhere\b/.test(conformances)) continue;
|
|
31177
|
+
const own = conformances.split(",").map((name3) => name3.trim()).filter((name3) => name3.startsWith(`${module2}.`));
|
|
31178
|
+
const type = extended.startsWith("Swift.") ? extended : extended.split(".").slice(1).join(".");
|
|
31179
|
+
if (own.length > 0 && type) lines.add(`extension ${type} : ${own.join(", ")} {}
|
|
31180
|
+
`);
|
|
31181
|
+
}
|
|
31182
|
+
return lines.size > 0 ? `
|
|
31183
|
+
${[...lines].join("")}` : "";
|
|
31184
|
+
}
|
|
31033
31185
|
function wasmFlags(toolchain, imports2) {
|
|
31034
31186
|
const { sysroot, darwin, resources, cFlags } = swiftSdkPaths(
|
|
31035
31187
|
toolchain.moduleRoot,
|
|
@@ -31122,7 +31274,7 @@ function objcStandin(surface, binary2, toolchain, work, behavior, frameworks, si
|
|
|
31122
31274
|
dependencyGraphs
|
|
31123
31275
|
);
|
|
31124
31276
|
}
|
|
31125
|
-
function graphStandin(module2, graphs, values, wasm, binary2, toolchain, work, requiredInits2, declared, imports2 = [], requireSwift = false, objcProperties = /* @__PURE__ */ new Map(), placeholder = null, inheritedConformances = /* @__PURE__ */ new Map(), projections = /* @__PURE__ */ new Map(), dependencyGraphs = []) {
|
|
31277
|
+
function graphStandin(module2, graphs, values, wasm, binary2, toolchain, work, requiredInits2, declared, imports2 = [], requireSwift = false, objcProperties = /* @__PURE__ */ new Map(), placeholder = null, inheritedConformances = /* @__PURE__ */ new Map(), projections = /* @__PURE__ */ new Map(), dependencyGraphs = [], trailer = "") {
|
|
31126
31278
|
const paths = new Set(
|
|
31127
31279
|
graphs.flatMap(
|
|
31128
31280
|
(graph) => graph.symbols.map((symbol2) => symbol2.pathComponents.join("."))
|
|
@@ -31163,6 +31315,8 @@ function graphStandin(module2, graphs, values, wasm, binary2, toolchain, work, r
|
|
|
31163
31315
|
const plain = /* @__PURE__ */ new Set();
|
|
31164
31316
|
const unobjc = /* @__PURE__ */ new Set();
|
|
31165
31317
|
const trapped = /* @__PURE__ */ new Set();
|
|
31318
|
+
const forced = /* @__PURE__ */ new Set();
|
|
31319
|
+
const nonfailable = /* @__PURE__ */ new Set();
|
|
31166
31320
|
const unconformed = /* @__PURE__ */ new Map();
|
|
31167
31321
|
const objcProtocols = new Set(
|
|
31168
31322
|
graphs.flatMap(
|
|
@@ -31172,7 +31326,7 @@ function graphStandin(module2, graphs, values, wasm, binary2, toolchain, work, r
|
|
|
31172
31326
|
)
|
|
31173
31327
|
);
|
|
31174
31328
|
const file = import_node_path70.default.join(work, `${module2}.swift`);
|
|
31175
|
-
const inert = binary2.placeholder !== void 0 || binary2.publicHeaders !== void 0 && binary2.
|
|
31329
|
+
const inert = binary2.placeholder !== void 0 || binary2.publicHeaders !== void 0 && binary2.unloweredSources === void 0;
|
|
31176
31330
|
for (; ; ) {
|
|
31177
31331
|
const { source, owners, skipped } = emitSwiftStandin(graphs, {
|
|
31178
31332
|
module: module2,
|
|
@@ -31185,6 +31339,8 @@ function graphStandin(module2, graphs, values, wasm, binary2, toolchain, work, r
|
|
|
31185
31339
|
unobjc,
|
|
31186
31340
|
unconformed,
|
|
31187
31341
|
trapped,
|
|
31342
|
+
forcedOverride: forced,
|
|
31343
|
+
coderNonfailable: nonfailable,
|
|
31188
31344
|
inert,
|
|
31189
31345
|
imports: [...placeholder?.peachImports ?? [], ...imports2],
|
|
31190
31346
|
family: [...imports2, ...placeholder?.peachImports ?? []],
|
|
@@ -31204,7 +31360,7 @@ function graphStandin(module2, graphs, values, wasm, binary2, toolchain, work, r
|
|
|
31204
31360
|
`Configured Swift behavior ${module2}.${entry.path} was not emitted: ${entry.reason}`
|
|
31205
31361
|
);
|
|
31206
31362
|
}
|
|
31207
|
-
import_node_fs73.default.writeFileSync(file, source);
|
|
31363
|
+
import_node_fs73.default.writeFileSync(file, source + trailer);
|
|
31208
31364
|
const check2 = (0, import_node_child_process37.spawnSync)(
|
|
31209
31365
|
import_node_path70.default.join(toolchain.toolchainBin, "swiftc"),
|
|
31210
31366
|
// emitting the module runs the diagnostics a typecheck skips, such as
|
|
@@ -31228,10 +31384,10 @@ function graphStandin(module2, graphs, values, wasm, binary2, toolchain, work, r
|
|
|
31228
31384
|
return {
|
|
31229
31385
|
module: module2,
|
|
31230
31386
|
target: binary2.target,
|
|
31231
|
-
files: { [`${module2}.swift`]: source },
|
|
31387
|
+
files: { [`${module2}.swift`]: source + trailer },
|
|
31232
31388
|
...imports2.length ? { dependencies: imports2 } : {}
|
|
31233
31389
|
};
|
|
31234
|
-
const before = omit.size + plain.size + unobjc.size + trapped.size + unconformed.size;
|
|
31390
|
+
const before = omit.size + plain.size + unobjc.size + trapped.size + unconformed.size + forced.size + nonfailable.size;
|
|
31235
31391
|
const elsewhere = [];
|
|
31236
31392
|
for (const match of check2.stderr.matchAll(/^(\S+?):(\d+):\d+: error: (.*)$/gm)) {
|
|
31237
31393
|
const owner = match[1] === file ? owners[Number(match[2]) - 1] : void 0;
|
|
@@ -31254,14 +31410,22 @@ function graphStandin(module2, graphs, values, wasm, binary2, toolchain, work, r
|
|
|
31254
31410
|
throw new Error(
|
|
31255
31411
|
`Configured Swift behavior ${module2}.${owner} does not typecheck: ${match[3]}`
|
|
31256
31412
|
);
|
|
31257
|
-
if (owner && /does not override any|overrides nothing/.test(
|
|
31413
|
+
if (owner && /does not override any|overrides nothing|does not override a designated initializer/.test(
|
|
31414
|
+
match[3]
|
|
31415
|
+
))
|
|
31258
31416
|
plain.add(owner);
|
|
31417
|
+
else if (owner && /failable initializer 'init\(coder:\)' cannot override a non-failable/.test(
|
|
31418
|
+
match[3]
|
|
31419
|
+
) && !nonfailable.has(owner))
|
|
31420
|
+
nonfailable.add(owner);
|
|
31421
|
+
else if (owner && /requires an 'override' keyword/.test(match[3]) && !forced.has(owner))
|
|
31422
|
+
forced.add(owner);
|
|
31259
31423
|
else if (owner && inert && INERT_VALUE.test(match[3]) && !trapped.has(owner))
|
|
31260
31424
|
trapped.add(owner);
|
|
31261
31425
|
else if (owner) omit.set(owner, `rejected by swiftc: ${match[3]}`);
|
|
31262
31426
|
else elsewhere.push(match[3]);
|
|
31263
31427
|
}
|
|
31264
|
-
if (omit.size + plain.size + unobjc.size + trapped.size + unconformed.size === before)
|
|
31428
|
+
if (omit.size + plain.size + unobjc.size + trapped.size + unconformed.size + forced.size + nonfailable.size === before)
|
|
31265
31429
|
throw new Error(
|
|
31266
31430
|
`its generated source does not typecheck: ${elsewhere.slice(0, 3).join("; ") || check2.stderr.trim().slice(0, 400)}`
|
|
31267
31431
|
);
|
|
@@ -32063,7 +32227,7 @@ function standinGenerationInputs(binaries, toolchain, configuredBehavior = {}, s
|
|
|
32063
32227
|
...(binary2.headerDependencies ?? []).map(
|
|
32064
32228
|
(dependency) => `${swiftTargetModuleName(dependency.module)}\0${treeDigest2(import_node_path70.default.join(binary2.dir, dependency.path))}`
|
|
32065
32229
|
),
|
|
32066
|
-
...binary2.
|
|
32230
|
+
...binary2.unloweredSources ?? []
|
|
32067
32231
|
].join("\0") : swiftBinaryFramework(binary2).digest
|
|
32068
32232
|
);
|
|
32069
32233
|
} catch {
|
|
@@ -32746,7 +32910,7 @@ function* xcodeObjCInputSteps(app, binaries, moduleRoot, products, sourceRoot =
|
|
|
32746
32910
|
const binaryHeaders = binarySearch.flatMap((search) => search.headers);
|
|
32747
32911
|
const configuration = app.configuration === "Debug" ? "debug" : "release";
|
|
32748
32912
|
for (const binary2 of binaries) {
|
|
32749
|
-
if (!binary2.reached || binary2.publicHeaders === void 0 || binary2.
|
|
32913
|
+
if (!binary2.reached || binary2.publicHeaders === void 0 || binary2.unloweredSources !== void 0)
|
|
32750
32914
|
continue;
|
|
32751
32915
|
const manifest = swiftPackageManifest(binary2.dir);
|
|
32752
32916
|
const target = manifest.targets.get(binary2.target);
|
|
@@ -36170,9 +36334,9 @@ var init_self_invocation = __esm({
|
|
|
36170
36334
|
});
|
|
36171
36335
|
|
|
36172
36336
|
// src/swift-pdf-raster.ts
|
|
36173
|
-
function rasterBinary() {
|
|
36174
|
-
const tag = (0, import_node_crypto39.createHash)("sha256").update(
|
|
36175
|
-
const binary2 = import_node_path76.default.join(cacheDir(),
|
|
36337
|
+
function rasterBinary(swift = RASTER_SWIFT, name3 = "swift-pdf-raster") {
|
|
36338
|
+
const tag = (0, import_node_crypto39.createHash)("sha256").update(swift).digest("hex").slice(0, 16);
|
|
36339
|
+
const binary2 = import_node_path76.default.join(cacheDir(), `${name3}-${tag}`);
|
|
36176
36340
|
try {
|
|
36177
36341
|
import_node_fs79.default.accessSync(binary2, import_node_fs79.default.constants.X_OK);
|
|
36178
36342
|
return binary2;
|
|
@@ -36184,7 +36348,7 @@ function rasterBinary() {
|
|
|
36184
36348
|
import_node_fs79.default.mkdtempSync(import_node_path76.default.join(import_node_os16.default.tmpdir(), "swift-pdf-raster-")),
|
|
36185
36349
|
"raster.swift"
|
|
36186
36350
|
);
|
|
36187
|
-
import_node_fs79.default.writeFileSync(source,
|
|
36351
|
+
import_node_fs79.default.writeFileSync(source, swift);
|
|
36188
36352
|
try {
|
|
36189
36353
|
(0, import_node_child_process40.execFileSync)("xcrun", ["swiftc", "-o", binary2, source], { stdio: "pipe" });
|
|
36190
36354
|
} finally {
|
|
@@ -36242,7 +36406,31 @@ function rasterizePdfFile(diskPath, pdfSha256) {
|
|
|
36242
36406
|
import_node_fs79.default.rmSync(import_node_path76.default.dirname(out), { recursive: true, force: true });
|
|
36243
36407
|
}
|
|
36244
36408
|
}
|
|
36245
|
-
|
|
36409
|
+
function rasterizeSvgFile(diskPath, svgSha256) {
|
|
36410
|
+
if (process.platform !== "darwin") return null;
|
|
36411
|
+
const binary2 = rasterBinary(RASTER_SVG_SWIFT, "swift-svg-raster");
|
|
36412
|
+
const tag = (0, import_node_crypto39.createHash)("sha256").update(RASTER_SVG_SWIFT).digest("hex").slice(0, 16);
|
|
36413
|
+
const cached2 = import_node_path76.default.join(cacheDir(), `swift-svg-png-${tag}-${svgSha256}.png`);
|
|
36414
|
+
if (import_node_fs79.default.existsSync(cached2)) return { bytes: import_node_fs79.default.readFileSync(cached2) };
|
|
36415
|
+
const out = import_node_path76.default.join(
|
|
36416
|
+
import_node_fs79.default.mkdtempSync(import_node_path76.default.join(import_node_os16.default.tmpdir(), "swift-svg-png-")),
|
|
36417
|
+
"out.png"
|
|
36418
|
+
);
|
|
36419
|
+
try {
|
|
36420
|
+
(0, import_node_child_process40.execFileSync)(binary2, [diskPath, "3", out], { stdio: "pipe" });
|
|
36421
|
+
const bytes = import_node_fs79.default.readFileSync(out);
|
|
36422
|
+
import_node_fs79.default.mkdirSync(cacheDir(), { recursive: true });
|
|
36423
|
+
import_node_fs79.default.copyFileSync(out, cached2);
|
|
36424
|
+
return { bytes: Buffer.from(bytes) };
|
|
36425
|
+
} catch (error) {
|
|
36426
|
+
throw new Error(
|
|
36427
|
+
`swift svg asset ${diskPath} did not rasterize: ${error instanceof Error ? error.message : String(error)}`
|
|
36428
|
+
);
|
|
36429
|
+
} finally {
|
|
36430
|
+
import_node_fs79.default.rmSync(import_node_path76.default.dirname(out), { recursive: true, force: true });
|
|
36431
|
+
}
|
|
36432
|
+
}
|
|
36433
|
+
var import_node_child_process40, import_node_crypto39, import_node_fs79, import_node_os16, import_node_path76, RASTER_SWIFT, RASTER_SVG_SWIFT;
|
|
36246
36434
|
var init_swift_pdf_raster = __esm({
|
|
36247
36435
|
"src/swift-pdf-raster.ts"() {
|
|
36248
36436
|
"use strict";
|
|
@@ -36278,6 +36466,25 @@ guard let image = ctx.makeImage() else { exit(5) }
|
|
|
36278
36466
|
guard let dest = CGImageDestinationCreateWithURL(output as CFURL, UTType.png.identifier as CFString, 1, nil) else { exit(6) }
|
|
36279
36467
|
CGImageDestinationAddImage(dest, image, nil)
|
|
36280
36468
|
guard CGImageDestinationFinalize(dest) else { exit(7) }
|
|
36469
|
+
`;
|
|
36470
|
+
RASTER_SVG_SWIFT = `import AppKit
|
|
36471
|
+
guard CommandLine.arguments.count == 4 else { exit(1) }
|
|
36472
|
+
let input = URL(fileURLWithPath: CommandLine.arguments[1])
|
|
36473
|
+
let scale = CGFloat(Double(CommandLine.arguments[2]) ?? 3.0)
|
|
36474
|
+
let output = URL(fileURLWithPath: CommandLine.arguments[3])
|
|
36475
|
+
guard let image = NSImage(contentsOf: input), image.size.width > 0, image.size.height > 0 else { exit(2) }
|
|
36476
|
+
let width = Int(ceil(image.size.width * scale))
|
|
36477
|
+
let height = Int(ceil(image.size.height * scale))
|
|
36478
|
+
if width > 12000 || height > 12000 { exit(3) }
|
|
36479
|
+
guard let rep = NSBitmapImageRep(bitmapDataPlanes: nil, pixelsWide: width, pixelsHigh: height, bitsPerSample: 8, samplesPerPixel: 4, hasAlpha: true, isPlanar: false, colorSpaceName: .deviceRGB, bytesPerRow: 0, bitsPerPixel: 0) else { exit(4) }
|
|
36480
|
+
guard let context = NSGraphicsContext(bitmapImageRep: rep) else { exit(5) }
|
|
36481
|
+
NSGraphicsContext.saveGraphicsState()
|
|
36482
|
+
NSGraphicsContext.current = context
|
|
36483
|
+
context.imageInterpolation = .high
|
|
36484
|
+
image.draw(in: NSRect(x: 0, y: 0, width: width, height: height), from: .zero, operation: .copy, fraction: 1)
|
|
36485
|
+
NSGraphicsContext.restoreGraphicsState()
|
|
36486
|
+
guard let data = rep.representation(using: .png, properties: [:]) else { exit(6) }
|
|
36487
|
+
do { try data.write(to: output) } catch { exit(7) }
|
|
36281
36488
|
`;
|
|
36282
36489
|
}
|
|
36283
36490
|
});
|
|
@@ -36475,7 +36682,7 @@ async function swiftPackages(entry, app) {
|
|
|
36475
36682
|
] : []
|
|
36476
36683
|
);
|
|
36477
36684
|
let reached = [...cached2.binaries.filter((binary2) => binary2.reached), ...vendored];
|
|
36478
|
-
const standinArtifact = (binary2) => binary2.publicHeaders === void 0 || binary2.
|
|
36685
|
+
const standinArtifact = (binary2) => binary2.publicHeaders === void 0 || binary2.unloweredSources !== void 0;
|
|
36479
36686
|
const artifacts = reached.filter(standinArtifact);
|
|
36480
36687
|
if (entry.moduleRoot && entry.provided && artifacts.length > 0) {
|
|
36481
36688
|
const resolved = swiftModuleToolchain(entry.moduleRoot);
|
|
@@ -36494,10 +36701,13 @@ async function swiftPackages(entry, app) {
|
|
|
36494
36701
|
const cxxArtifacts = reached.filter(standinArtifact);
|
|
36495
36702
|
const generation = standinGenerationInputs(cxxArtifacts, toolchain, entry.behavior);
|
|
36496
36703
|
if (cached2.standinKey !== generation) {
|
|
36704
|
+
const replaced = new Set(
|
|
36705
|
+
cxxArtifacts.filter((binary2) => shippedBinaryDiffers(binary2.target, binary2.checksum)).map((binary2) => binary2.target)
|
|
36706
|
+
);
|
|
36497
36707
|
const built2 = await swiftStandins(
|
|
36498
36708
|
cxxArtifacts,
|
|
36499
36709
|
toolchain,
|
|
36500
|
-
entry.provided,
|
|
36710
|
+
new Set([...entry.provided].filter((name3) => !replaced.has(name3))),
|
|
36501
36711
|
entry.behavior
|
|
36502
36712
|
);
|
|
36503
36713
|
cached2.packages = await resolveSwiftPackagesAsync({
|
|
@@ -36511,6 +36721,9 @@ async function swiftPackages(entry, app) {
|
|
|
36511
36721
|
...entry.provided,
|
|
36512
36722
|
...cxxArtifacts.map((binary2) => binary2.target).filter((target) => !built2.gaps.has(target))
|
|
36513
36723
|
]),
|
|
36724
|
+
standinTargets: new Set(
|
|
36725
|
+
[...replaced].filter((target) => !built2.gaps.has(target))
|
|
36726
|
+
),
|
|
36514
36727
|
binaryGaps: built2.gaps,
|
|
36515
36728
|
owners
|
|
36516
36729
|
});
|
|
@@ -37420,6 +37633,12 @@ function buildSwiftResourceTable(project, baseUrl, inputs) {
|
|
|
37420
37633
|
throw new Error("swift image pack exceeds the compile service caps");
|
|
37421
37634
|
}
|
|
37422
37635
|
bytes = readPackageFile2(project.packagePath, disk, limits.imageBytes);
|
|
37636
|
+
const svg = ext === ".svg" ? rasterizeSvgFile(disk, (0, import_node_crypto40.createHash)("sha256").update(bytes).digest("hex")) : null;
|
|
37637
|
+
if (svg) {
|
|
37638
|
+
bytes = svg.bytes;
|
|
37639
|
+
ext = ".png";
|
|
37640
|
+
uploadName = `${import_node_path77.default.posix.basename(file, import_node_path77.default.posix.extname(file))}.png`;
|
|
37641
|
+
}
|
|
37423
37642
|
}
|
|
37424
37643
|
if (imageBytes + bytes.length > limits.imageTotalBytes) {
|
|
37425
37644
|
throw new Error("swift image pack exceeds the compile service caps");
|
|
@@ -38311,6 +38530,7 @@ var init_swift_host = __esm({
|
|
|
38311
38530
|
init_swift_package_manifest();
|
|
38312
38531
|
init_swift_packages();
|
|
38313
38532
|
init_swift_pdf_raster();
|
|
38533
|
+
init_swift_shipped_binaries();
|
|
38314
38534
|
init_swift_source_file();
|
|
38315
38535
|
init_swift_standin_config();
|
|
38316
38536
|
init_swift_standins();
|
|
@@ -48548,7 +48768,7 @@ init_swift_native_pin();
|
|
|
48548
48768
|
init_xcode_project();
|
|
48549
48769
|
var EXPO_NATIVE_ENTRY_NAME = "ios";
|
|
48550
48770
|
function expoNativeCompilerDigestValue() {
|
|
48551
|
-
return true ? "
|
|
48771
|
+
return true ? "5922e9285a81f56dda7ebf9adbf34c7d630c8a729a2ce226405b975c38ab854b" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
|
|
48552
48772
|
}
|
|
48553
48773
|
var IDENTITY_SOURCE_SKIPS = 1 | 4 | 8 | 16 | 32 | 64 | 128 | 4096;
|
|
48554
48774
|
function readSources(value) {
|