peachsim 0.1.2208 → 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 +712 -66
- 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 +2 -2
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +700 -60
- 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 +712 -66
- package/dist-lib/host/fetch-proxy-handler.cjs +17 -4
- 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 +17 -4
- 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 +7 -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 +17 -4
- 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 +69 -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 +5679 -358
- package/dist-lib/swift-compile.cjs +154 -16
- package/dist-lib/swift-compile.mjs +153 -16
- 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 +600 -55
- package/dist-lib/vite.cjs +17 -4
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/engine/animated.d.ts +2 -1
- package/dist-types/packages/peach-engine/src/engine/animation-graph.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/liquid-glass.d.ts +6 -0
- package/dist-types/packages/peach-engine/src/engine/node.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/types.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/render-worker/canvaskit-webgpu.d.ts +8 -0
- package/dist-types/packages/peach-engine/src/render-worker/compositor-gpu.d.ts +3 -0
- package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +14 -0
- package/dist-types/packages/peach-engine/src/render-worker/compositor-runtime/render-tree.d.ts +18 -0
- package/kotlin/sdk.tar.gz +0 -0
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/NSCompoundPredicate.h +1 -1
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/NSExpression.h +1 -1
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/NSISO8601DateFormatter.h +1 -1
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/NSMeasurementFormatter.h +1 -1
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INObjectCollection.h +27 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INObjectSection.h +24 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/Intents.h +9 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Modules/module.modulemap +5 -0
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CoreAnimation.h +2 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIFeedbackGenerator.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIImpactFeedbackGenerator.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes +21 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UINibLoading.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UINotificationFeedbackGenerator.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UISelectionFeedbackGenerator.h +1 -1
- package/sdk/ios/usr/include/ObjectiveC.apinotes +7 -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/android-theme.ts +136 -2
- package/src/expo-swift-host.ts +90 -1
- package/src/generated/android-framework-text.json +4566 -0
- package/src/generated/android-framework-themes.json +11 -0
- package/src/kotlin-app.ts +24 -4
- package/src/kotlin-host.ts +9 -0
- package/src/native-static-libraries.ts +7 -0
- package/src/nitro-adapter.lock.json +246 -246
- package/src/nitro-superset.lock.json +4 -4
- package/src/swift-compile.ts +168 -12
- package/src/swift-distribution.lock.json +8 -8
- 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 +10 -3
- package/src/swift-packages.ts +53 -28
- package/src/swift-pdf-raster.ts +60 -4
- package/src/swift-shared-sdk.ts +2 -1
- package/src/swift-shipped-archives.json +44 -0
- package/src/swift-shipped-binaries.ts +12 -0
- package/src/swift-standin-builtin-behavior.ts +248 -0
- package/src/swift-standin-emit.ts +11 -3
- package/src/swift-standins.ts +92 -13
- package/src/turbo-runtime.lock.json +17 -17
package/dist-lib/vite-swift.cjs
CHANGED
|
@@ -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;
|
|
@@ -7148,7 +7148,7 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
7148
7148
|
const coder = members2.some((member) => leaf(member) === "init(coder:)");
|
|
7149
7149
|
if (designated2 && !coder && externalRoot(id) !== "NSObject" && externalRoot(id) !== null)
|
|
7150
7150
|
emit(
|
|
7151
|
-
`${inner}public required init?(coder: NSCoder) { ${options.inert ? "return nil" : trap(`${path51}.init(coder:)`)} }`
|
|
7151
|
+
`${inner}public required init${options.coderNonfailable?.has(path51) ? "" : "?"}(coder: NSCoder) { ${options.inert && !options.coderNonfailable?.has(path51) ? "return nil" : trap(`${path51}.init(coder:)`)} }`
|
|
7152
7152
|
);
|
|
7153
7153
|
if (designated2 && !members2.some((member) => leaf(member) === "init()") && [...superChain(id)].some(
|
|
7154
7154
|
(at) => options.requiredInits?.has(`${pathOf(byId.get(at))}.init()`)
|
|
@@ -7329,15 +7329,18 @@ function emitSwiftStandin(sourceGraphs, options) {
|
|
|
7329
7329
|
const { 2: rest } = LEADING_ATTRS.exec(text(member));
|
|
7330
7330
|
const decl = rest.replace(/^(?:weak |unowned )/, "").replace(/^((?:static )?)let /, "$1var ");
|
|
7331
7331
|
const witness = `${owner2}.${leaf(member)}`;
|
|
7332
|
+
if (options.forcedOverride?.has(witness)) return;
|
|
7332
7333
|
const body = options.inert ? inertBody(member) : trap(witness);
|
|
7333
7334
|
if (member.kind.identifier === "swift.property" || member.kind.identifier === "swift.type.property") {
|
|
7334
7335
|
const parsed = splitAccessors(decl);
|
|
7335
7336
|
const setter = parsed.settable ? ` ${parsed.nonmutating ? "nonmutating " : ""}set { ${body} }` : "";
|
|
7336
|
-
|
|
7337
|
+
emitAt(
|
|
7338
|
+
witness,
|
|
7337
7339
|
`${indent2}${visibility} ${parsed.decl} { get${parsed.effects} { ${body} }${setter} }`
|
|
7338
7340
|
);
|
|
7339
7341
|
} else
|
|
7340
|
-
|
|
7342
|
+
emitAt(
|
|
7343
|
+
witness,
|
|
7341
7344
|
`${indent2}${member.kind.identifier === "swift.init" ? "public required " : visibility + " "}${stripDefaults(decl)} { ${body} }`
|
|
7342
7345
|
);
|
|
7343
7346
|
};
|
|
@@ -7773,7 +7776,7 @@ function iosDeploymentMinimum(version2) {
|
|
|
7773
7776
|
if (!parts) return void 0;
|
|
7774
7777
|
return Number(parts[1]) * 1e4 + Number(parts[2] ?? 0) * 100 + Number(parts[3] ?? 0);
|
|
7775
7778
|
}
|
|
7776
|
-
var headerFiles = (dir) => import_node_fs7.default.readdirSync(dir, { recursive: true, encoding: "utf8" }).filter((file) => file.endsWith(".h")).sort();
|
|
7779
|
+
var headerFiles = (dir) => import_node_fs7.default.readdirSync(dir, { recursive: true, encoding: "utf8" }).filter((file) => file.endsWith(".h") || file.endsWith(".hh")).sort();
|
|
7777
7780
|
function moduleMapHeaders(modulemap, directoryHeaders = []) {
|
|
7778
7781
|
const tokens2 = moduleMapTokens(import_node_fs7.default.readFileSync(modulemap, "utf8"));
|
|
7779
7782
|
const open = [];
|
|
@@ -7925,9 +7928,14 @@ function objcView(surface, toolchainBin, stdlib, cacheDir5, work, original, vend
|
|
|
7925
7928
|
recursive: true
|
|
7926
7929
|
});
|
|
7927
7930
|
const modulemap = import_node_fs7.default.readFileSync(surface.modulemap, "utf8");
|
|
7931
|
+
const forwardEnum = [...originals.values()].some(
|
|
7932
|
+
(text5) => /typedef\s+NS_(?:CLOSED_)?(?:ENUM|OPTIONS)\s*\(\s*\w+\s*,\s*\w+\s*\)\s*;/.test(
|
|
7933
|
+
text5
|
|
7934
|
+
)
|
|
7935
|
+
);
|
|
7928
7936
|
import_node_fs7.default.writeFileSync(
|
|
7929
7937
|
import_node_path7.default.join(frameworks, `${surface.module}.framework`, "Modules", "module.modulemap"),
|
|
7930
|
-
surface.interface ? modulemap.replace(
|
|
7938
|
+
surface.interface && !forwardEnum ? modulemap.replace(
|
|
7931
7939
|
new RegExp(`\\n\\s*module\\s+${surface.module}\\.Swift\\s*\\{[^}]*\\}`),
|
|
7932
7940
|
""
|
|
7933
7941
|
) : modulemap
|
|
@@ -9024,7 +9032,7 @@ function swiftSharedSdkViewOptions(moduleRoot, distribution, toolchainBin, sdk)
|
|
|
9024
9032
|
const overlay = import_node_path8.default.join(swiftSharedSdkRoot(moduleRoot, distribution), "wasm/include");
|
|
9025
9033
|
const overlayFiles = (0, import_node_fs8.readdirSync)(overlay, { recursive: true, withFileTypes: true }).filter((entry) => entry.isFile()).map((entry) => import_node_path8.default.join(entry.parentPath, entry.name)).sort();
|
|
9026
9034
|
const key2 = JSON.stringify([
|
|
9027
|
-
"
|
|
9035
|
+
"v23",
|
|
9028
9036
|
toolchainBin,
|
|
9029
9037
|
sdk,
|
|
9030
9038
|
frameworks,
|
|
@@ -9081,6 +9089,7 @@ function swiftSharedSdkViewOptions(moduleRoot, distribution, toolchainBin, sdk)
|
|
|
9081
9089
|
...[
|
|
9082
9090
|
"MacTypes.h",
|
|
9083
9091
|
"objc/NSObject.h",
|
|
9092
|
+
"ObjectiveC.apinotes",
|
|
9084
9093
|
"net/if.h",
|
|
9085
9094
|
"notify.h",
|
|
9086
9095
|
"notify.modulemap",
|
|
@@ -16043,10 +16052,25 @@ function swiftClangImporterFlags(flags) {
|
|
|
16043
16052
|
(flag) => flag !== "-fobjc-arc" && flag !== "-fno-objc-arc" && !/^-std=(?:c(?!\+\+)|gnu(?!\+\+)|iso9899:)/.test(flag)
|
|
16044
16053
|
);
|
|
16045
16054
|
}
|
|
16046
|
-
|
|
16055
|
+
var SWIFT_SUBMODULE_IMPORT = /^[ \t]*(?:@\w+(?:\([^)]*\))?[ \t]+)*import[ \t]+([A-Za-z_]\w*)\.([A-Za-z_]\w*)[ \t]*(?:\/\/.*)?$/gm;
|
|
16056
|
+
function swiftSubmoduleImports(sources) {
|
|
16057
|
+
const imports2 = /* @__PURE__ */ new Map();
|
|
16058
|
+
for (const source of sources)
|
|
16059
|
+
for (const [, module2, submodule] of source.matchAll(SWIFT_SUBMODULE_IMPORT)) {
|
|
16060
|
+
const names = imports2.get(module2) ?? /* @__PURE__ */ new Set();
|
|
16061
|
+
names.add(submodule);
|
|
16062
|
+
imports2.set(module2, names);
|
|
16063
|
+
}
|
|
16064
|
+
return imports2;
|
|
16065
|
+
}
|
|
16066
|
+
function swiftObjCModuleMap(module2, headers, submodules = /* @__PURE__ */ new Set()) {
|
|
16067
|
+
const header = (file) => `header ${JSON.stringify(file)}`;
|
|
16068
|
+
const stem = (file) => file.slice(file.lastIndexOf("/") + 1).replace(/\.[^.]*$/, "");
|
|
16047
16069
|
return [
|
|
16048
16070
|
`module ${module2} {`,
|
|
16049
|
-
...headers.map(
|
|
16071
|
+
...headers.map(
|
|
16072
|
+
(file) => submodules.has(stem(file)) ? ` module ${stem(file)} { ${header(file)} export * }` : ` ${header(file)}`
|
|
16073
|
+
),
|
|
16050
16074
|
" export *",
|
|
16051
16075
|
"}",
|
|
16052
16076
|
""
|
|
@@ -17250,6 +17274,88 @@ function swiftSystemLibraryExclusions(files2, targets, distributionModules) {
|
|
|
17250
17274
|
)
|
|
17251
17275
|
);
|
|
17252
17276
|
}
|
|
17277
|
+
var DISTRIBUTION_CLANG_MODULES = [
|
|
17278
|
+
{
|
|
17279
|
+
name: "EXStructuredHeaders",
|
|
17280
|
+
header: "EXStructuredHeaders/EXStructuredHeadersParser.h",
|
|
17281
|
+
source: `// Copyright \xA9 2021 650 Industries. All rights reserved.
|
|
17282
|
+
|
|
17283
|
+
#import <Foundation/Foundation.h>
|
|
17284
|
+
|
|
17285
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
17286
|
+
|
|
17287
|
+
typedef NS_ENUM(NSInteger, EXStructuredHeadersParserFieldType) {
|
|
17288
|
+
EXStructuredHeadersParserFieldTypeDictionary,
|
|
17289
|
+
EXStructuredHeadersParserFieldTypeList,
|
|
17290
|
+
EXStructuredHeadersParserFieldTypeItem
|
|
17291
|
+
};
|
|
17292
|
+
|
|
17293
|
+
@interface EXStructuredHeadersParser : NSObject
|
|
17294
|
+
|
|
17295
|
+
- (instancetype)initWithRawInput:(NSString *)raw
|
|
17296
|
+
fieldType:(EXStructuredHeadersParserFieldType)fieldType;
|
|
17297
|
+
|
|
17298
|
+
- (instancetype)initWithRawInput:(NSString *)raw
|
|
17299
|
+
fieldType:(EXStructuredHeadersParserFieldType)fieldType
|
|
17300
|
+
ignoringParameters:(BOOL)shouldIgnoreParameters;
|
|
17301
|
+
|
|
17302
|
+
- (nullable id)parseStructuredFieldsWithError:(NSError ** _Nullable)error;
|
|
17303
|
+
|
|
17304
|
+
@end
|
|
17305
|
+
|
|
17306
|
+
NS_ASSUME_NONNULL_END
|
|
17307
|
+
`
|
|
17308
|
+
},
|
|
17309
|
+
{
|
|
17310
|
+
name: "EXUpdatesBSPatch",
|
|
17311
|
+
header: "EXUpdatesBSPatch.h",
|
|
17312
|
+
source: `// Copyright 2015-present 650 Industries. All rights reserved.
|
|
17313
|
+
|
|
17314
|
+
#pragma once
|
|
17315
|
+
|
|
17316
|
+
#import <Foundation/Foundation.h>
|
|
17317
|
+
|
|
17318
|
+
int EXUpdatesApplyBSDiffPatch(const char * _Nonnull oldFilePath,
|
|
17319
|
+
const char * _Nonnull newFilePath,
|
|
17320
|
+
const char * _Nonnull patchFilePath);
|
|
17321
|
+
`
|
|
17322
|
+
}
|
|
17323
|
+
];
|
|
17324
|
+
function distributionClangModulePresent(modules, name3) {
|
|
17325
|
+
return (0, import_node_fs27.existsSync)(import_node_path27.default.join(modules, `${name3}.swiftmodule`)) || (0, import_node_fs27.existsSync)(import_node_path27.default.join(modules, name3, "module.modulemap"));
|
|
17326
|
+
}
|
|
17327
|
+
function distributionClangModuleMap(root, modules) {
|
|
17328
|
+
const missing = DISTRIBUTION_CLANG_MODULES.filter(
|
|
17329
|
+
(mod) => !distributionClangModulePresent(modules, mod.name)
|
|
17330
|
+
);
|
|
17331
|
+
if (missing.length === 0) return null;
|
|
17332
|
+
const key2 = (0, import_node_crypto13.createHash)("sha256").update(modules).update(missing.map((mod) => `${mod.name}\0${mod.source}`).join("\0")).digest("hex").slice(0, 16);
|
|
17333
|
+
const directory = import_node_path27.default.join(root, `.peach-clang-modules-${key2}`);
|
|
17334
|
+
const mapPath = import_node_path27.default.join(directory, "module.modulemap");
|
|
17335
|
+
if (!(0, import_node_fs27.existsSync)(mapPath)) {
|
|
17336
|
+
(0, import_node_fs27.mkdirSync)(directory, { recursive: true });
|
|
17337
|
+
const parts = [];
|
|
17338
|
+
for (const mod of missing) {
|
|
17339
|
+
const destination = import_node_path27.default.join(directory, mod.header);
|
|
17340
|
+
(0, import_node_fs27.mkdirSync)(import_node_path27.default.dirname(destination), { recursive: true });
|
|
17341
|
+
(0, import_node_fs27.writeFileSync)(destination, mod.source);
|
|
17342
|
+
parts.push(
|
|
17343
|
+
`module ${mod.name} {
|
|
17344
|
+
requires objc
|
|
17345
|
+
header "${mod.header}"
|
|
17346
|
+
export *
|
|
17347
|
+
}
|
|
17348
|
+
`
|
|
17349
|
+
);
|
|
17350
|
+
}
|
|
17351
|
+
(0, import_node_fs27.writeFileSync)(mapPath, parts.join("\n"));
|
|
17352
|
+
}
|
|
17353
|
+
return mapPath;
|
|
17354
|
+
}
|
|
17355
|
+
function distributionClangModuleOptions(root, modules) {
|
|
17356
|
+
const map = distributionClangModuleMap(root, modules);
|
|
17357
|
+
return map === null ? [] : ["-Xcc", `-fmodule-map-file=${map}`];
|
|
17358
|
+
}
|
|
17253
17359
|
function providedModulesPath(root, modules, excluded) {
|
|
17254
17360
|
if (!excluded || excluded.size === 0) return modules;
|
|
17255
17361
|
const entries = (0, import_node_fs27.readdirSync)(modules).filter((entry) => !excluded.has(entry.replace(/\..*$/, ""))).sort();
|
|
@@ -17343,7 +17449,7 @@ var darwinRecordsRegion = (quoted) => quoted.length ? ["-Wl,--start-lib", ...quo
|
|
|
17343
17449
|
var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
17344
17450
|
var MULTI_MANIFEST_VERSION = 68;
|
|
17345
17451
|
var SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
|
|
17346
|
-
var compilerSourceDigest = true ? "
|
|
17452
|
+
var compilerSourceDigest = true ? "4fa3e84f8c3b585bc8e864c92f0682e6f02757d455de1ce784f0d40ba9df875a" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
|
|
17347
17453
|
function swiftArtifactHash(input, release, moduleRoot) {
|
|
17348
17454
|
const hash = (0, import_node_crypto13.createHash)("sha256");
|
|
17349
17455
|
hash.update(`swift-compile
|
|
@@ -17617,7 +17723,7 @@ function emitSwiftPackageManifest(args) {
|
|
|
17617
17723
|
import_node_path27.default.join(moduleRoot, "modules"),
|
|
17618
17724
|
args.moduleExcludes
|
|
17619
17725
|
)
|
|
17620
|
-
)}` : prebuilt ? `, "-Isystem", ${JSON.stringify(providedModulesPath(args.root, prebuilt.modules, args.moduleExcludes))}${prebuilt.moduleMaps.map((map) => `, "-Xcc", ${JSON.stringify(`-fmodule-map-file=${map}`)}`).join("")}` : "");
|
|
17726
|
+
)}${distributionClangModuleOptions(args.root, import_node_path27.default.join(moduleRoot, "modules")).map((flag) => `, ${JSON.stringify(flag)}`).join("")}` : prebuilt ? `, "-Isystem", ${JSON.stringify(providedModulesPath(args.root, prebuilt.modules, args.moduleExcludes))}${prebuilt.moduleMaps.map((map) => `, "-Xcc", ${JSON.stringify(`-fmodule-map-file=${map}`)}`).join("")}` : "");
|
|
17621
17727
|
const nativeFlags = [
|
|
17622
17728
|
...args.nativeFlags?.get(target.name) ?? [],
|
|
17623
17729
|
...args.nativeHeaderFlags ?? []
|
|
@@ -17824,7 +17930,9 @@ function syncSwiftTree(base, files2) {
|
|
|
17824
17930
|
const walk3 = (dir) => {
|
|
17825
17931
|
for (const entry of (0, import_node_fs27.readdirSync)(dir, { withFileTypes: true })) {
|
|
17826
17932
|
const full = import_node_path27.default.join(dir, entry.name);
|
|
17827
|
-
if (dir === base && (entry.name === ".build" || entry.name.startsWith(".peach-modules-") ||
|
|
17933
|
+
if (dir === base && (entry.name === ".build" || entry.name.startsWith(".peach-modules-") || // distribution clang maps are written beside the project and named
|
|
17934
|
+
// from the compiler flags, so a sync must not remove them.
|
|
17935
|
+
entry.name.startsWith(".peach-clang-modules-") || entry.name === SWIFT_LINK_STAMP))
|
|
17828
17936
|
continue;
|
|
17829
17937
|
if (entry.isDirectory()) walk3(full);
|
|
17830
17938
|
else if (!files2.has(full)) (0, import_node_fs27.rmSync)(full, { force: true });
|
|
@@ -18930,6 +19038,20 @@ function stripCCode(source) {
|
|
|
18930
19038
|
}
|
|
18931
19039
|
return code;
|
|
18932
19040
|
}
|
|
19041
|
+
var wasmMacroEnvironment = {
|
|
19042
|
+
...emptyMacroEnvironment,
|
|
19043
|
+
defines: /* @__PURE__ */ new Map([
|
|
19044
|
+
["__wasm__", "1"],
|
|
19045
|
+
["__wasm32__", "1"],
|
|
19046
|
+
["__wasi__", "1"]
|
|
19047
|
+
])
|
|
19048
|
+
};
|
|
19049
|
+
function swiftCTakesReturnAddress(source) {
|
|
19050
|
+
if (!source.includes("__builtin_return_address")) return false;
|
|
19051
|
+
return /\b__builtin_return_address\s*\(/.test(
|
|
19052
|
+
cActiveCode(stripCCode(source), wasmMacroEnvironment)
|
|
19053
|
+
);
|
|
19054
|
+
}
|
|
18933
19055
|
function swiftCDefinedNames(sources) {
|
|
18934
19056
|
const names = /* @__PURE__ */ new Set();
|
|
18935
19057
|
for (const source of sources)
|
|
@@ -19227,6 +19349,11 @@ ${swiftProjectFilesProblems(input.projectFiles).join("\n")}`
|
|
|
19227
19349
|
clangImportedModules.add(name3);
|
|
19228
19350
|
}
|
|
19229
19351
|
}
|
|
19352
|
+
const submoduleImports = swiftSubmoduleImports(
|
|
19353
|
+
Object.entries(input.files).flatMap(
|
|
19354
|
+
([file, contents]) => file.endsWith(".swift") ? [contents] : []
|
|
19355
|
+
)
|
|
19356
|
+
);
|
|
19230
19357
|
const headerDirectory = import_node_path27.default.join(layout2.root, ".build", "peach-cxx-headers");
|
|
19231
19358
|
const flattenedHeaders = /* @__PURE__ */ new Set();
|
|
19232
19359
|
if ((0, import_node_fs27.existsSync)(headerDirectory)) {
|
|
@@ -19612,7 +19739,8 @@ ${swiftProjectFilesProblems(input.projectFiles).join("\n")}`
|
|
|
19612
19739
|
);
|
|
19613
19740
|
const moduleContents = originalModuleMap ? input.files[originalModuleMap[1]] : swiftpmModuleMap?.contents ?? packageModuleMap?.[1] ?? swiftObjCModuleMap(
|
|
19614
19741
|
swiftTargetModuleName(target.name),
|
|
19615
|
-
roots2.map((file) => import_node_path27.default.join(layout2.root, file))
|
|
19742
|
+
roots2.map((file) => import_node_path27.default.join(layout2.root, file)),
|
|
19743
|
+
submoduleImports.get(swiftTargetModuleName(target.name))
|
|
19616
19744
|
);
|
|
19617
19745
|
if (moduleContents === void 0)
|
|
19618
19746
|
throw new Error("missing original module map " + modulemap);
|
|
@@ -19937,10 +20065,14 @@ module ${moduleName}.Swift {
|
|
|
19937
20065
|
header ${JSON.stringify(import_node_path27.default.join(headerDirectory, name3 + "-Swift.h"))}
|
|
19938
20066
|
requires objc
|
|
19939
20067
|
}
|
|
19940
|
-
` : swiftObjCModuleMap(
|
|
19941
|
-
|
|
19942
|
-
|
|
19943
|
-
|
|
20068
|
+
` : swiftObjCModuleMap(
|
|
20069
|
+
moduleName,
|
|
20070
|
+
[
|
|
20071
|
+
...(input.nativeTargets?.find((target) => target.name === name3)?.publicHeaders ?? []).map((header) => import_node_path27.default.join(layout2.root, header)),
|
|
20072
|
+
import_node_path27.default.join(headerDirectory, name3 + "-Swift.h")
|
|
20073
|
+
],
|
|
20074
|
+
submoduleImports.get(moduleName)
|
|
20075
|
+
)
|
|
19944
20076
|
);
|
|
19945
20077
|
nativeHeaderFlags.push("-fmodule-map-file=" + modulemap);
|
|
19946
20078
|
}
|
|
@@ -19950,6 +20082,9 @@ module ${moduleName}.Swift {
|
|
|
19950
20082
|
if (!distribution) {
|
|
19951
20083
|
modulePlan.update((0, import_node_fs27.readFileSync)(import_node_path27.default.join(moduleRoot, "Package.swift")));
|
|
19952
20084
|
}
|
|
20085
|
+
modulePlan.update(
|
|
20086
|
+
Object.keys(input.files).filter((file) => file.endsWith(".swift")).sort().join("\n")
|
|
20087
|
+
);
|
|
19953
20088
|
const resourcePlan = (0, import_node_crypto13.createHash)("sha256").update(
|
|
19954
20089
|
JSON.stringify(
|
|
19955
20090
|
resourceTargets.filter((target) => target.resources).map((target) => [
|
|
@@ -20372,6 +20507,10 @@ module ${moduleName}.Swift {
|
|
|
20372
20507
|
import_node_path27.default.join(moduleRoot, "modules"),
|
|
20373
20508
|
moduleExcludes
|
|
20374
20509
|
) : prebuilt ? providedModulesPath(layout2.root, prebuilt.modules, moduleExcludes) : import_node_path27.default.join(layout2.root, ".build", WASM_TRIPLE, "release", "Modules"),
|
|
20510
|
+
...distribution ? distributionClangModuleOptions(
|
|
20511
|
+
layout2.root,
|
|
20512
|
+
import_node_path27.default.join(moduleRoot, "modules")
|
|
20513
|
+
) : [],
|
|
20375
20514
|
...prebuilt?.moduleMaps.flatMap((map) => [
|
|
20376
20515
|
"-Xcc",
|
|
20377
20516
|
`-fmodule-map-file=${map}`
|
|
@@ -20924,8 +21063,12 @@ async function buildFrameworkProducts(scratch2, args) {
|
|
|
20924
21063
|
const linked = frameworkLinkClosure(scratch2, linkedTargets.targets);
|
|
20925
21064
|
const objects = linked.objects;
|
|
20926
21065
|
if (linked.modules.has("UniformTypeIdentifiers")) {
|
|
20927
|
-
const
|
|
20928
|
-
|
|
21066
|
+
const constantsDir = import_node_path27.default.join(scratch2, "uniform-type-constants");
|
|
21067
|
+
const constantsStamp = import_node_path27.default.join(constantsDir, ".complete");
|
|
21068
|
+
const object4 = import_node_path27.default.join(constantsDir, "UniformTypeIdentifiers-NativeConstants.o");
|
|
21069
|
+
if (!(0, import_node_fs27.existsSync)(constantsStamp) || (0, import_node_fs27.readFileSync)(constantsStamp, "utf8") !== args.frameworkKey) {
|
|
21070
|
+
(0, import_node_fs27.rmSync)(constantsDir, { recursive: true, force: true });
|
|
21071
|
+
(0, import_node_fs27.mkdirSync)(constantsDir);
|
|
20929
21072
|
const sdkPaths2 = swiftSdkPaths(args.moduleRoot, args.toolchainBin);
|
|
20930
21073
|
compileUniformTypeConstants({
|
|
20931
21074
|
bin: args.toolchainBin,
|
|
@@ -20933,8 +21076,9 @@ async function buildFrameworkProducts(scratch2, args) {
|
|
|
20933
21076
|
darwin: sdkPaths2.darwin,
|
|
20934
21077
|
packageRoot: args.moduleRoot,
|
|
20935
21078
|
minimum: darwinRecordsMinimum(),
|
|
20936
|
-
out:
|
|
21079
|
+
out: constantsDir
|
|
20937
21080
|
});
|
|
21081
|
+
(0, import_node_fs27.writeFileSync)(constantsStamp, args.frameworkKey);
|
|
20938
21082
|
}
|
|
20939
21083
|
objects.push(object4);
|
|
20940
21084
|
linked.owners.set(object4, "UniformTypeIdentifiers");
|
|
@@ -21240,7 +21384,7 @@ function compileSwiftProjectOnce(input, options) {
|
|
|
21240
21384
|
report("reusing verified disk artifact");
|
|
21241
21385
|
return retain(root, previous);
|
|
21242
21386
|
}
|
|
21243
|
-
if (!options.intermediates && process.platform === "darwin" && process.env.TM_SESSION && !windowAdmission() && process.env.CI !== "true" && moduleRoot === sourceSwiftCheckout() && !swiftDistributionAt(moduleRoot)) {
|
|
21387
|
+
if (!options.intermediates && process.platform === "darwin" && !options.intermediates && process.env.TM_SESSION && !windowAdmission() && process.env.CI !== "true" && moduleRoot === sourceSwiftCheckout() && !swiftDistributionAt(moduleRoot)) {
|
|
21244
21388
|
const requestRoot = (0, import_node_fs27.mkdtempSync)(`${root}.builder-request-`);
|
|
21245
21389
|
const output2 = import_node_path27.default.join(requestRoot, "output");
|
|
21246
21390
|
const request = import_node_path27.default.join(requestRoot, "request.json");
|
|
@@ -30042,6 +30186,62 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
|
30042
30186
|
// src/numbered-lock.ts
|
|
30043
30187
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
30044
30188
|
|
|
30189
|
+
// src/swift-shipped-binaries.ts
|
|
30190
|
+
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
30191
|
+
|
|
30192
|
+
// src/swift-shipped-archives.json
|
|
30193
|
+
var swift_shipped_archives_default = {
|
|
30194
|
+
AppCheckCore: "a18d4e5aff27ff4b9bce8d6e73e55ccf1d11515311e219aa4473319cdff3187b",
|
|
30195
|
+
AppLovinSDK: "c00f052c4b15766a6a2734e2b3685234e6bd28dbc47fbe7cbc3edbf56f701d5c",
|
|
30196
|
+
AppsFlyerLib: "13bae495e63e22579dd9525a1c9e88d8eedc78b4586979b7e2d492cfd3efbe1f",
|
|
30197
|
+
FBAEMKit: "ceaf685683c6a23ae4893150d0d770aeeaec34811ac8c146b3aa351beade5fa0",
|
|
30198
|
+
FBAudienceNetwork: "4d84bf1e404a83852a93af2ae73e22e45bb2b11e0a9a445c3b461173a5d6aec3",
|
|
30199
|
+
FBLPromises: "3544fb457e7f60c69740cdd26617a75bdd613943e948becca643022c7edd76c0",
|
|
30200
|
+
FBSDKCoreKit: "1577edd62ec0c172928befed3b309dc59ae8915d2aaad091460d9d1be5ddc13d",
|
|
30201
|
+
FBSDKCoreKit_Basics: "c780833f204f9ec6eab70a3758a45c5c78bfb6f4e590289ccf395497f204cac1",
|
|
30202
|
+
FirebaseAnalytics: "e3253a494375c5174d20cb81925e20afa1ff6b1419125cb608d39b092b53ff2a",
|
|
30203
|
+
FirebaseAppCheck: "af82d72727d55d14f65eee96845d4d9495e4e603b4673709d6f3448b9595cc63",
|
|
30204
|
+
FirebaseAppCheckInterop: "7ffd54e6fe187bf8cd714e3d863e0095f7cbbb0fb802adb87a40c552de7cffcc",
|
|
30205
|
+
FirebaseAuth: "fcde09db8d45ffba67802e81c17b8046db6b56568226ace3fca898983b08c968",
|
|
30206
|
+
FirebaseAuthInterop: "e8e6f4fb42b3fa76c2bade7a522ab0f224558d27d2321175c791d307541787a8",
|
|
30207
|
+
FirebaseCore: "30e3505c715e17682c1dc20bb26ba475e99e6981a9a0dba3cf9352eea632fc1d",
|
|
30208
|
+
FirebaseCoreExtension: "e37ce2abcd4c218ab5426da78cbe7ab41f79ee7eba1d02dd4b0cde952ed2c4a0",
|
|
30209
|
+
FirebaseCoreInternal: "72a15c0c63585faf93e9ffa91e8a8c1c50b24749405804ffae19a29ec05b07ab",
|
|
30210
|
+
FirebaseCrashlytics: "e03c71913efd97678b895abb1e968c83e58b3fbd7955a81ec6e6581b95db16e3",
|
|
30211
|
+
FirebaseFirestore: "f7a1bb7fc4a2fb09298b514114d6aaca9a4f00fd8868667524a05bc4563bf1fd",
|
|
30212
|
+
FirebaseFirestoreInternal: "d9595a1784beaf5cd4a8e0dda0f4364ddfa6b536ad60f82746d81d14dce037a3",
|
|
30213
|
+
FirebaseInstallations: "141e313325bab001f2dbb79dc8a433f884f4c4a12a5feb665e6958098d637f7b",
|
|
30214
|
+
FirebaseRemoteConfig: "e0ae6d626a423d535bc67216f9f0cd66f98f1c0fb4b5bf88074d4496733e2db1",
|
|
30215
|
+
FirebaseRemoteConfigInterop: "794f599eb4232058715b606fa671639c8cc5d821655a0f739651d17c5ef65c37",
|
|
30216
|
+
FirebaseSessions: "1781d72e47dac0fc7a532412641021730bd5b659135633cd9ef7b97ccd31b0ce",
|
|
30217
|
+
FirebaseSharedSwift: "8d63b09a517733ef3a58390bf1e8cf054f058bdd618bb4f19a1f4b5a0b4f09e5",
|
|
30218
|
+
FirebaseStorage: "636b33180dd5ad60b4878357691fe6472cf3bd57ec691e9d661c5444f523df66",
|
|
30219
|
+
GTMSessionFetcher: "f58dc2bd9db39defd73f0f67e7a11893a0c6e6f0ba45cd83cf420b2b3c15f1bd",
|
|
30220
|
+
GoogleAdsOnDeviceConversion: "31a5a1f5204f4844a480d3889b6ebe2e69473ef32b868935c51812c0483cb08b",
|
|
30221
|
+
GoogleAppMeasurement: "5741e6334392e0345f1b5896111ffef4d5a78859970f5e197fa0b7d881165305",
|
|
30222
|
+
GoogleAppMeasurementIdentitySupport: "b70cb033eeb002ed1c5a8140953ccb3be0221ca754c05fe450ed9c9c6547f274",
|
|
30223
|
+
GoogleDataTransport: "7d08050419e0906f13039cc4d2dd69be075234c0bf5bbb34df9dd4891e48831d",
|
|
30224
|
+
GoogleMobileAds: "f2c09c60ee331ce029f563304ad73a481d57ace0d4bc11ce33a2bf59497c59bf",
|
|
30225
|
+
GoogleUtilities: "37a9d3d3810dad763a8a79bd4c7cc4c37b386240725aca07f45dba1826676c8c",
|
|
30226
|
+
Intercom: "fc8251f24b305b91f83304d4dffaf1a90c424a7bc37be8b595dd1fc5cff566ea",
|
|
30227
|
+
Promises: "6d8f1a4b3d561d67adfc2026834779b05685d1cdacea6e83c70d0641c39f24de",
|
|
30228
|
+
RecaptchaInterop: "cf5cc62ebc237b34d5267c1190d18f33b424dbc7f81713f127108d0ad8a592cf",
|
|
30229
|
+
RiveRuntime: "72b6ff5c5a1d153c9cdbea9a917c09be557cfcb1fafa02853fa06b0268551710",
|
|
30230
|
+
absl: "fff0388cf074c69a2da4bc197a005da0b8e5c23ebdcfa383600c540a342f9df1",
|
|
30231
|
+
grpc: "918737c9f8f93e14127b3894e31c7a0522475f2247b74f87d8166dff3a6bafb0",
|
|
30232
|
+
grpcpp: "b83f85e0256cf06df00cf0ed728b5c0d68373ca401742877935771447450b90a",
|
|
30233
|
+
leveldb: "5521a6e6e4cd01b2e31b099d4341f1bccae7e8ba43de648b028928573daf8bb4",
|
|
30234
|
+
nanopb: "a7fafe2e4e16d99de4c58f72e22dcc53221885aa6d678d1270123e4b01badfa3",
|
|
30235
|
+
openssl_grpc: "b2aaede82457cdd15915762a4f57b38e28ba0f47b9b48556a7e0c46881973096"
|
|
30236
|
+
};
|
|
30237
|
+
|
|
30238
|
+
// src/swift-shipped-binaries.ts
|
|
30239
|
+
var SHIPPED_ARCHIVES = new Map(Object.entries(swift_shipped_archives_default));
|
|
30240
|
+
function shippedBinaryDiffers(target, checksum) {
|
|
30241
|
+
const shipped = SHIPPED_ARCHIVES.get(target);
|
|
30242
|
+
return shipped !== void 0 && checksum !== null && checksum !== shipped;
|
|
30243
|
+
}
|
|
30244
|
+
|
|
30045
30245
|
// src/swift-packages.ts
|
|
30046
30246
|
var swiftBinaryOnDisk = (binary) => binary.url !== null || import_node_fs40.default.existsSync(binary.dir);
|
|
30047
30247
|
var SWIFT_PLACEHOLDER_PACKAGES = /* @__PURE__ */ new Map();
|
|
@@ -30054,16 +30254,22 @@ function remoteSwiftCheckouts(root) {
|
|
|
30054
30254
|
return import_node_path41.default.join(import_node_fs40.default.realpathSync(cacheDir()), "swift-packages", key2, "checkouts");
|
|
30055
30255
|
}
|
|
30056
30256
|
var UNSUPPORTED_NATIVE = /\.(s|S)$/;
|
|
30057
|
-
function
|
|
30257
|
+
function unlowerableSources(files2, target) {
|
|
30258
|
+
if (target.declaresWasiNativeSettings) return [];
|
|
30259
|
+
return [
|
|
30260
|
+
...files2.filter((file) => UNSUPPORTED_NATIVE.test(file)),
|
|
30261
|
+
...files2.filter(isSwiftNativeTranslationUnit).filter((file) => swiftCTakesReturnAddress(import_node_fs40.default.readFileSync(file, "utf8")))
|
|
30262
|
+
];
|
|
30263
|
+
}
|
|
30264
|
+
function unloweredSources(files2, target) {
|
|
30058
30265
|
if (target.type !== "regular") return null;
|
|
30059
|
-
if (target.declaresWasiNativeSettings) return null;
|
|
30060
|
-
const assembly = files2.filter((file) => UNSUPPORTED_NATIVE.test(file));
|
|
30061
|
-
if (assembly.length === 0) return null;
|
|
30062
30266
|
if (!files2.some(isSwiftNativeTranslationUnit)) return null;
|
|
30267
|
+
const unlowered = unlowerableSources(files2, target);
|
|
30268
|
+
if (unlowered.length === 0) return null;
|
|
30063
30269
|
const headers = import_node_path41.default.resolve(target.dir, target.publicHeadersPath);
|
|
30064
30270
|
if (!files2.some((file) => file.startsWith(`${headers}${import_node_path41.default.sep}`) && file.endsWith(".h")))
|
|
30065
30271
|
return null;
|
|
30066
|
-
return
|
|
30272
|
+
return unlowered;
|
|
30067
30273
|
}
|
|
30068
30274
|
var BINARY = "is a binary framework";
|
|
30069
30275
|
var blockers = (reasons) => [...new Set(reasons.flat())];
|
|
@@ -30228,9 +30434,9 @@ function resolveSwiftPackages(options) {
|
|
|
30228
30434
|
if (target.type === "macro") return preservePackage(pkg, [name3], "host");
|
|
30229
30435
|
const files2 = target.type === "regular" || target.type === "system" ? swiftTargetFiles(pkg.manifest, target) : [];
|
|
30230
30436
|
const gap = options.binaryGaps?.get(name3);
|
|
30231
|
-
const
|
|
30437
|
+
const unlowerable = unlowerableSources(files2, target);
|
|
30232
30438
|
const placeholder = placeholderPackage(pkg);
|
|
30233
|
-
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` :
|
|
30439
|
+
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_path41.default.relative(pkg.manifest.dir, file)).join(", ")}${gap ? `; ${gap}` : ""}` : null;
|
|
30234
30440
|
const reasons = target.dependencies.map((dependency) => {
|
|
30235
30441
|
if (dependency.kind === "target") return resolveTarget(pkg, dependency.name);
|
|
30236
30442
|
const nested = resolveDependencyProduct(pkg, dependency);
|
|
@@ -30309,7 +30515,7 @@ function resolveSwiftPackages(options) {
|
|
|
30309
30515
|
(file) => file.endsWith(".swift") && import_node_fs40.default.readFileSync(file, "utf8").trim() === ""
|
|
30310
30516
|
))
|
|
30311
30517
|
return false;
|
|
30312
|
-
if (
|
|
30518
|
+
if (unloweredSources(files2, target)) return false;
|
|
30313
30519
|
claimed.add(key2);
|
|
30314
30520
|
providedTargets.delete(name3);
|
|
30315
30521
|
for (const dependency of target.dependencies) {
|
|
@@ -30323,6 +30529,13 @@ function resolveSwiftPackages(options) {
|
|
|
30323
30529
|
};
|
|
30324
30530
|
const claimProduct = (pkg, product) => {
|
|
30325
30531
|
const roots = pkg.manifest.products.get(product)?.targets ?? [];
|
|
30532
|
+
for (const root of roots) {
|
|
30533
|
+
const target = pkg.manifest.targets.get(root);
|
|
30534
|
+
if (target?.type === "binary" && !options.standinTargets?.has(root) && shippedBinaryDiffers(root, target.checksum)) {
|
|
30535
|
+
providedTargets.delete(root);
|
|
30536
|
+
providedProducts.delete(product);
|
|
30537
|
+
}
|
|
30538
|
+
}
|
|
30326
30539
|
if (roots.map((name3) => claimTarget(pkg, name3)).some(Boolean))
|
|
30327
30540
|
providedProducts.delete(product);
|
|
30328
30541
|
};
|
|
@@ -30350,7 +30563,7 @@ function resolveSwiftPackages(options) {
|
|
|
30350
30563
|
if (target.type === "executable") continue;
|
|
30351
30564
|
const files2 = target.type === "regular" || target.type === "system" ? swiftTargetFiles(pkg.manifest, target) : [];
|
|
30352
30565
|
const objc = target.type === "regular" && files2.some((file) => /\.(m|mm)$/.test(file));
|
|
30353
|
-
const
|
|
30566
|
+
const unlowered = unloweredSources(files2, target);
|
|
30354
30567
|
const gap = placeholderPackage(pkg);
|
|
30355
30568
|
const sources = files2.filter((file) => file.endsWith(".swift"));
|
|
30356
30569
|
const release = (setting) => setting.configuration !== "debug";
|
|
@@ -30377,7 +30590,7 @@ function resolveSwiftPackages(options) {
|
|
|
30377
30590
|
]
|
|
30378
30591
|
}
|
|
30379
30592
|
});
|
|
30380
|
-
else if (target.type === "binary" || objc ||
|
|
30593
|
+
else if (target.type === "binary" || objc || unlowered)
|
|
30381
30594
|
result.binaries.push({
|
|
30382
30595
|
target: name3,
|
|
30383
30596
|
source: pkg.source,
|
|
@@ -30391,8 +30604,8 @@ function resolveSwiftPackages(options) {
|
|
|
30391
30604
|
import_node_path41.default.join(target.dir, target.publicHeadersPath)
|
|
30392
30605
|
)
|
|
30393
30606
|
},
|
|
30394
|
-
...
|
|
30395
|
-
|
|
30607
|
+
...unlowered ? {
|
|
30608
|
+
unloweredSources: unlowered.map(
|
|
30396
30609
|
(file) => import_node_path41.default.relative(pkg.manifest.dir, file)
|
|
30397
30610
|
)
|
|
30398
30611
|
} : {}
|
|
@@ -30649,7 +30862,7 @@ function sourceClosureDigest(srcDir, entrypoints) {
|
|
|
30649
30862
|
return hash.digest("hex");
|
|
30650
30863
|
}
|
|
30651
30864
|
var standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS);
|
|
30652
|
-
var STANDIN_SOURCE_DIGEST = true ? "
|
|
30865
|
+
var STANDIN_SOURCE_DIGEST = true ? "9adf53d6f1cfece1b7a3e23bad712630278818d71b5b718384cf640144349600" : standinSourceDigest();
|
|
30653
30866
|
|
|
30654
30867
|
// src/swift-standins.ts
|
|
30655
30868
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
@@ -30997,6 +31210,13 @@ var NATIVE_STATIC_LIBRARY_RECIPES = [
|
|
|
30997
31210
|
upstream: "b94213a11b3a2edadfae89f0c57a7f4ab72772c9",
|
|
30998
31211
|
recipe: "a2642115a5eeb04559c9f1daaa4b4cbe4b1c211533b4cc80cb8339a4477af205",
|
|
30999
31212
|
archive: "libsksg.a"
|
|
31213
|
+
},
|
|
31214
|
+
{
|
|
31215
|
+
name: "webgpu_dawn",
|
|
31216
|
+
nativeSha256: "95078993275bccc969b1dfa1ad0934cbacc05ae59e8aa2a6cc46ce93e97d4f69",
|
|
31217
|
+
upstream: "3d786993a7ded64c4ebb4884b9b079db9ad0e580",
|
|
31218
|
+
recipe: "c55468cc976e837ad894133f2231beb7d1ed64633af7b457b8a2610d7df45994",
|
|
31219
|
+
archive: "libwebgpu_dawn.a"
|
|
31000
31220
|
}
|
|
31001
31221
|
];
|
|
31002
31222
|
function nativeStaticLibraryEntry(recipe, compiler, sdk, distribution) {
|
|
@@ -31483,6 +31703,238 @@ async function emitCxxStandin(input) {
|
|
|
31483
31703
|
};
|
|
31484
31704
|
}
|
|
31485
31705
|
|
|
31706
|
+
// src/swift-standin-builtin-behavior.ts
|
|
31707
|
+
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
31708
|
+
var BUILTIN_STANDIN_BEHAVIOR = {
|
|
31709
|
+
GoogleCast: {
|
|
31710
|
+
kGCKCastDeviceCategory: { body: 'return "com.google.cast.CastDevice"' },
|
|
31711
|
+
kGCKDefaultMediaReceiverApplicationID: { body: 'return "CC1AD845"' },
|
|
31712
|
+
kGCKErrorDomain: { body: 'return "com.google.cast.GCKError"' },
|
|
31713
|
+
"GCKError.init(code:)": {
|
|
31714
|
+
body: "super.init(domain: kGCKErrorDomain, code: code.rawValue, userInfo: nil)"
|
|
31715
|
+
},
|
|
31716
|
+
"GCKDiscoveryCriteria.applicationIDs": { stored: "" },
|
|
31717
|
+
"GCKDiscoveryCriteria.namespaces": { stored: "" },
|
|
31718
|
+
"GCKDiscoveryCriteria.hasApplicationIDs": { body: "return applicationIDs != nil" },
|
|
31719
|
+
"GCKDiscoveryCriteria.hasNamespaces": { body: "return namespaces != nil" },
|
|
31720
|
+
"GCKDiscoveryCriteria.init(applicationID:)": {
|
|
31721
|
+
body: "super.init(); applicationIDs = NSOrderedSet(object: applicationID)"
|
|
31722
|
+
},
|
|
31723
|
+
"GCKDiscoveryCriteria.init(namespaces:)": {
|
|
31724
|
+
body: "super.init(); self.namespaces = namespaces"
|
|
31725
|
+
},
|
|
31726
|
+
GCKLaunchOptions: {
|
|
31727
|
+
members: `
|
|
31728
|
+
private static var peachDeviceLanguageCode: String? { Locale.preferredLanguages.first }
|
|
31729
|
+
`
|
|
31730
|
+
},
|
|
31731
|
+
"GCKLaunchOptions.languageCode": { stored: "" },
|
|
31732
|
+
"GCKLaunchOptions.relaunchIfRunning": { stored: "false" },
|
|
31733
|
+
"GCKLaunchOptions.androidReceiverCompatible": { stored: "false" },
|
|
31734
|
+
"GCKLaunchOptions.init()": {
|
|
31735
|
+
body: "super.init(); languageCode = GCKLaunchOptions.peachDeviceLanguageCode"
|
|
31736
|
+
},
|
|
31737
|
+
"GCKLaunchOptions.init(relaunchIfRunning:)": {
|
|
31738
|
+
body: `
|
|
31739
|
+
super.init()
|
|
31740
|
+
languageCode = GCKLaunchOptions.peachDeviceLanguageCode
|
|
31741
|
+
self.relaunchIfRunning = relaunchIfRunning
|
|
31742
|
+
`
|
|
31743
|
+
},
|
|
31744
|
+
"GCKLaunchOptions.init(languageCode:relaunchIfRunning:)": {
|
|
31745
|
+
body: `
|
|
31746
|
+
super.init()
|
|
31747
|
+
self.languageCode = languageCode
|
|
31748
|
+
self.relaunchIfRunning = relaunchIfRunning
|
|
31749
|
+
`
|
|
31750
|
+
},
|
|
31751
|
+
"GCKLaunchOptions.init(relaunchIfRunning:androidReceiverCompatible:)": {
|
|
31752
|
+
body: `
|
|
31753
|
+
super.init()
|
|
31754
|
+
languageCode = GCKLaunchOptions.peachDeviceLanguageCode
|
|
31755
|
+
self.relaunchIfRunning = relaunchIfRunning
|
|
31756
|
+
self.androidReceiverCompatible = androidReceiverCompatible
|
|
31757
|
+
`
|
|
31758
|
+
},
|
|
31759
|
+
"GCKLaunchOptions.init(relaunchIfRunning:languageCode:androidReceiverCompatible:)": {
|
|
31760
|
+
body: `
|
|
31761
|
+
super.init()
|
|
31762
|
+
self.languageCode = languageCode
|
|
31763
|
+
self.relaunchIfRunning = relaunchIfRunning
|
|
31764
|
+
self.androidReceiverCompatible = androidReceiverCompatible
|
|
31765
|
+
`
|
|
31766
|
+
},
|
|
31767
|
+
GCKCastOptions: {
|
|
31768
|
+
members: "fileprivate var peachDiscoveryCriteria: GCKDiscoveryCriteria?"
|
|
31769
|
+
},
|
|
31770
|
+
"GCKCastOptions.init(discoveryCriteria:)": {
|
|
31771
|
+
body: "super.init(); peachDiscoveryCriteria = discoveryCriteria"
|
|
31772
|
+
},
|
|
31773
|
+
"GCKCastOptions.init(receiverApplicationID:)": {
|
|
31774
|
+
body: "super.init(); peachDiscoveryCriteria = GCKDiscoveryCriteria(applicationID: applicationID)"
|
|
31775
|
+
},
|
|
31776
|
+
"GCKCastOptions.init(supportedNamespaces:)": {
|
|
31777
|
+
body: "super.init(); peachDiscoveryCriteria = GCKDiscoveryCriteria(namespaces: Set(namespaces))"
|
|
31778
|
+
},
|
|
31779
|
+
"GCKCastOptions.physicalVolumeButtonsWillControlDeviceVolume": { stored: "false" },
|
|
31780
|
+
"GCKCastOptions.disableDiscoveryAutostart": { stored: "false" },
|
|
31781
|
+
"GCKCastOptions.disableAnalyticsLogging": { stored: "false" },
|
|
31782
|
+
"GCKCastOptions.launchOptions": { stored: "" },
|
|
31783
|
+
"GCKCastOptions.sharedContainerIdentifier": { stored: "" },
|
|
31784
|
+
"GCKCastOptions.suspendSessionsWhenBackgrounded": { stored: "true" },
|
|
31785
|
+
"GCKCastOptions.stopReceiverApplicationWhenEndingSession": { stored: "false" },
|
|
31786
|
+
"GCKCastOptions.startDiscoveryAfterFirstTapOnCastButton": { stored: "true" },
|
|
31787
|
+
GCKCastContext: {
|
|
31788
|
+
members: `
|
|
31789
|
+
nonisolated(unsafe) fileprivate static var peachShared: GCKCastContext?
|
|
31790
|
+
fileprivate let peachDiscoveryManager = GCKDiscoveryManager()
|
|
31791
|
+
fileprivate let peachSessionManager = GCKSessionManager()
|
|
31792
|
+
fileprivate var peachCredentialsData: GCKCredentialsData?
|
|
31793
|
+
fileprivate static func peachInitialize(_ options: GCKCastOptions) {
|
|
31794
|
+
let context = GCKCastContext()
|
|
31795
|
+
peachShared = context
|
|
31796
|
+
if !options.disableDiscoveryAutostart && !options.startDiscoveryAfterFirstTapOnCastButton {
|
|
31797
|
+
context.peachDiscoveryManager.startDiscovery()
|
|
31798
|
+
}
|
|
31799
|
+
}
|
|
31800
|
+
`
|
|
31801
|
+
},
|
|
31802
|
+
"GCKCastContext.imageCache": { stored: "" },
|
|
31803
|
+
"GCKCastContext.imagePicker": { stored: "" },
|
|
31804
|
+
"GCKCastContext.useDefaultExpandedMediaControls": { stored: "false" },
|
|
31805
|
+
"GCKCastContext.castState": { body: "return .noDevicesAvailable" },
|
|
31806
|
+
"GCKCastContext.discoveryManager": { body: "return peachDiscoveryManager" },
|
|
31807
|
+
"GCKCastContext.sessionManager": { body: "return peachSessionManager" },
|
|
31808
|
+
"GCKCastContext.setLaunch(_:)": { body: "peachCredentialsData = credentialsData" },
|
|
31809
|
+
"GCKCastContext.isSharedInstanceInitialized()": {
|
|
31810
|
+
body: "return peachShared != nil"
|
|
31811
|
+
},
|
|
31812
|
+
"GCKCastContext.sharedInstance()": {
|
|
31813
|
+
body: `
|
|
31814
|
+
guard let shared = peachShared else {
|
|
31815
|
+
fatalError("GCKCastContext.sharedInstance() was called before the shared instance was initialized")
|
|
31816
|
+
}
|
|
31817
|
+
return unsafeDowncast(shared, to: Self.self)
|
|
31818
|
+
`
|
|
31819
|
+
},
|
|
31820
|
+
"GCKCastContext.setSharedInstanceWith(_:)": {
|
|
31821
|
+
body: `
|
|
31822
|
+
if peachShared != nil {
|
|
31823
|
+
fatalError("GCKCastContext.setSharedInstanceWith(_:) was called when the shared instance was already initialized")
|
|
31824
|
+
}
|
|
31825
|
+
peachInitialize(options)
|
|
31826
|
+
`
|
|
31827
|
+
},
|
|
31828
|
+
"GCKCastContext.setSharedInstanceWith(_:error:)": {
|
|
31829
|
+
body: `
|
|
31830
|
+
if peachShared != nil {
|
|
31831
|
+
error?.pointee = GCKError(code: .alreadyInitialized)
|
|
31832
|
+
return false
|
|
31833
|
+
}
|
|
31834
|
+
peachInitialize(options)
|
|
31835
|
+
return true
|
|
31836
|
+
`
|
|
31837
|
+
},
|
|
31838
|
+
GCKDiscoveryManager: {
|
|
31839
|
+
members: `
|
|
31840
|
+
private final class PeachListener {
|
|
31841
|
+
weak var listener: (any GCKDiscoveryManagerListener)?
|
|
31842
|
+
init(_ listener: any GCKDiscoveryManagerListener) { self.listener = listener }
|
|
31843
|
+
}
|
|
31844
|
+
private var peachListeners: [PeachListener] = []
|
|
31845
|
+
private var peachState: GCKDiscoveryState = .stopped
|
|
31846
|
+
`
|
|
31847
|
+
},
|
|
31848
|
+
"GCKDiscoveryManager.discoveryState": { body: "return peachState" },
|
|
31849
|
+
"GCKDiscoveryManager.hasDiscoveredDevices": { body: "return false" },
|
|
31850
|
+
"GCKDiscoveryManager.passiveScan": { stored: "false" },
|
|
31851
|
+
"GCKDiscoveryManager.discoveryActive": { body: "return peachState == .running" },
|
|
31852
|
+
"GCKDiscoveryManager.deviceCount": { body: "return 0" },
|
|
31853
|
+
"GCKDiscoveryManager.add(_:)": {
|
|
31854
|
+
body: `
|
|
31855
|
+
peachListeners.removeAll { $0.listener == nil }
|
|
31856
|
+
if !peachListeners.contains(where: { $0.listener === listener }) {
|
|
31857
|
+
peachListeners.append(PeachListener(listener))
|
|
31858
|
+
}
|
|
31859
|
+
`
|
|
31860
|
+
},
|
|
31861
|
+
"GCKDiscoveryManager.remove(_:)": {
|
|
31862
|
+
body: "peachListeners.removeAll { $0.listener == nil || $0.listener === listener }"
|
|
31863
|
+
},
|
|
31864
|
+
"GCKDiscoveryManager.startDiscovery()": {
|
|
31865
|
+
body: `
|
|
31866
|
+
if peachState == .running { return }
|
|
31867
|
+
peachState = .running
|
|
31868
|
+
for entry in peachListeners {
|
|
31869
|
+
entry.listener?.didStartDiscovery(forDeviceCategory: kGCKCastDeviceCategory)
|
|
31870
|
+
}
|
|
31871
|
+
`
|
|
31872
|
+
},
|
|
31873
|
+
"GCKDiscoveryManager.stopDiscovery()": { body: "peachState = .stopped" },
|
|
31874
|
+
"GCKDiscoveryManager.isDiscoveryActive(forDeviceCategory:)": {
|
|
31875
|
+
body: "return peachState == .running && deviceCategory == kGCKCastDeviceCategory"
|
|
31876
|
+
},
|
|
31877
|
+
"GCKDiscoveryManager.device(at:)": {
|
|
31878
|
+
body: 'fatalError("GCKDiscoveryManager.device(at:) index \\(index) is out of range: no Cast device is discovered")'
|
|
31879
|
+
},
|
|
31880
|
+
"GCKDiscoveryManager.device(withUniqueID:)": { body: "return nil" },
|
|
31881
|
+
"GCKDiscoveryManager.cancelFindOperation()": { body: "" },
|
|
31882
|
+
GCKSessionManager: {
|
|
31883
|
+
members: `
|
|
31884
|
+
private var peachListeners: [any GCKSessionManagerListener] = []
|
|
31885
|
+
private var peachDefaultSessionOptions: [String: [String: any NSCoding & NSObjectProtocol]] = [:]
|
|
31886
|
+
`
|
|
31887
|
+
},
|
|
31888
|
+
"GCKSessionManager.currentSession": { body: "return nil" },
|
|
31889
|
+
"GCKSessionManager.currentCastSession": { body: "return nil" },
|
|
31890
|
+
"GCKSessionManager.connectionState": { body: "return .disconnected" },
|
|
31891
|
+
"GCKSessionManager.hasConnectedSession()": { body: "return false" },
|
|
31892
|
+
"GCKSessionManager.hasConnectedCastSession()": { body: "return false" },
|
|
31893
|
+
"GCKSessionManager.startSession(with:)": { body: "return false" },
|
|
31894
|
+
"GCKSessionManager.startSession(with:sessionOptions:)": { body: "return false" },
|
|
31895
|
+
"GCKSessionManager.suspendSession(with:)": { body: "return false" },
|
|
31896
|
+
"GCKSessionManager.endSession()": { body: "return false" },
|
|
31897
|
+
"GCKSessionManager.endSessionAndStopCasting(_:)": { body: "return false" },
|
|
31898
|
+
"GCKSessionManager.setDefaultSessionOptions(_:forDeviceCategory:)": {
|
|
31899
|
+
body: "peachDefaultSessionOptions[category] = sessionOptions"
|
|
31900
|
+
},
|
|
31901
|
+
"GCKSessionManager.defaultSessionOptions(forDeviceCategory:)": {
|
|
31902
|
+
body: "return peachDefaultSessionOptions[category]"
|
|
31903
|
+
},
|
|
31904
|
+
"GCKSessionManager.add(_:)": {
|
|
31905
|
+
body: `
|
|
31906
|
+
if !peachListeners.contains(where: { $0 === listener }) { peachListeners.append(listener) }
|
|
31907
|
+
`
|
|
31908
|
+
},
|
|
31909
|
+
"GCKSessionManager.remove(_:)": {
|
|
31910
|
+
body: "peachListeners.removeAll { $0 === listener }"
|
|
31911
|
+
},
|
|
31912
|
+
GCKLogger: {
|
|
31913
|
+
members: "nonisolated(unsafe) fileprivate static let peachShared = GCKLogger()"
|
|
31914
|
+
},
|
|
31915
|
+
"GCKLogger.sharedInstance()": { body: "return peachShared" },
|
|
31916
|
+
"GCKLogger.delegate": { stored: "" },
|
|
31917
|
+
"GCKLogger.filter": { stored: "" },
|
|
31918
|
+
"GCKLogger.loggingEnabled": { stored: "true" },
|
|
31919
|
+
"GCKLogger.fileLoggingEnabled": { stored: "false" },
|
|
31920
|
+
"GCKLogger.consoleLoggingEnabled": { stored: "false" }
|
|
31921
|
+
}
|
|
31922
|
+
};
|
|
31923
|
+
function withBuiltinStandinBehavior(behavior) {
|
|
31924
|
+
const merged = { ...behavior };
|
|
31925
|
+
for (const [module2, members2] of Object.entries(BUILTIN_STANDIN_BEHAVIOR))
|
|
31926
|
+
merged[module2] = {
|
|
31927
|
+
...Object.fromEntries(
|
|
31928
|
+
Object.entries(members2).map(([path51, entry]) => [
|
|
31929
|
+
path51,
|
|
31930
|
+
{ ...entry, builtin: true }
|
|
31931
|
+
])
|
|
31932
|
+
),
|
|
31933
|
+
...behavior[module2]
|
|
31934
|
+
};
|
|
31935
|
+
return merged;
|
|
31936
|
+
}
|
|
31937
|
+
|
|
31486
31938
|
// src/swift-standins.ts
|
|
31487
31939
|
var TRIPLE = "wasm32-unknown-wasip1";
|
|
31488
31940
|
var cacheDir4 = import_node_path49.default.join(cacheDir(), "swift-standins");
|
|
@@ -32278,7 +32730,7 @@ function interfaceEnumValues(graphs, interfaceText) {
|
|
|
32278
32730
|
const declarations = [
|
|
32279
32731
|
...interfaceText.matchAll(
|
|
32280
32732
|
new RegExp(
|
|
32281
|
-
`^([ \\t]*)(?:@[\\w.]+(?:\\([^)]*\\))?\\s+)*(?:nonisolated\\s+)?(?:public|open)\\s+enum\\s+${name3}\\s*:\\s*(?:Swift\\.)?U?Int(?:8|16|32|64)
|
|
32733
|
+
`^([ \\t]*)(?:@[\\w.]+(?:\\([^)]*\\))?\\s+)*(?:nonisolated\\s+)?(?:public|open)\\s+enum\\s+${name3}\\s*:\\s*(?:Swift\\.)?(?:U?Int(?:8|16|32|64)?|IntegerLiteralType)\\b[^{]*\\{[ \\t]*$`,
|
|
32282
32734
|
"gm"
|
|
32283
32735
|
)
|
|
32284
32736
|
)
|
|
@@ -32377,9 +32829,26 @@ function mixedStandin(surface, binary, toolchain, work, behavior, frameworkDirs,
|
|
|
32377
32829
|
view.protocolProperties ?? /* @__PURE__ */ new Map(),
|
|
32378
32830
|
null,
|
|
32379
32831
|
view.inheritedConformances,
|
|
32380
|
-
interfaceProjections(view.graphs, interfaceText)
|
|
32832
|
+
interfaceProjections(view.graphs, interfaceText),
|
|
32833
|
+
[],
|
|
32834
|
+
externalConformances(surface.module, interfaceText)
|
|
32381
32835
|
);
|
|
32382
32836
|
}
|
|
32837
|
+
function externalConformances(module2, interfaceText) {
|
|
32838
|
+
const lines = /* @__PURE__ */ new Set();
|
|
32839
|
+
for (const match of interfaceText.matchAll(
|
|
32840
|
+
/^(?:@\w+\s+)*extension\s+([\w.]+)\s*:\s*([^{\n]+?)\s*\{/gm
|
|
32841
|
+
)) {
|
|
32842
|
+
const [, extended, conformances] = match;
|
|
32843
|
+
if (extended.startsWith(`${module2}.`) || /\bwhere\b/.test(conformances)) continue;
|
|
32844
|
+
const own = conformances.split(",").map((name3) => name3.trim()).filter((name3) => name3.startsWith(`${module2}.`));
|
|
32845
|
+
const type = extended.startsWith("Swift.") ? extended : extended.split(".").slice(1).join(".");
|
|
32846
|
+
if (own.length > 0 && type) lines.add(`extension ${type} : ${own.join(", ")} {}
|
|
32847
|
+
`);
|
|
32848
|
+
}
|
|
32849
|
+
return lines.size > 0 ? `
|
|
32850
|
+
${[...lines].join("")}` : "";
|
|
32851
|
+
}
|
|
32383
32852
|
var WASM_EH_FLAGS = ["-Xllvm", "-wasm-enable-eh"];
|
|
32384
32853
|
function wasmFlags(toolchain, imports2) {
|
|
32385
32854
|
const { sysroot, darwin, resources, cFlags } = swiftSdkPaths(
|
|
@@ -32475,12 +32944,15 @@ function objcStandin(surface, binary, toolchain, work, behavior, frameworks, sib
|
|
|
32475
32944
|
}
|
|
32476
32945
|
var OBJC_UNREPRESENTABLE = "cannot be marked '@objc' because its type cannot be represented in Objective-C";
|
|
32477
32946
|
var INERT_VALUE = /missing argument|cannot be constructed|has no member 'init'|no exact matches in call to initializer|cannot convert return expression|does not conform to '|extra argument|takes no arguments|could not be inferred|cannot infer/;
|
|
32478
|
-
function graphStandin(module2, graphs, values, wasm, binary, toolchain, work, requiredInits2,
|
|
32947
|
+
function graphStandin(module2, graphs, values, wasm, binary, toolchain, work, requiredInits2, declared, imports2 = [], requireSwift = false, objcProperties = /* @__PURE__ */ new Map(), placeholder = null, inheritedConformances = /* @__PURE__ */ new Map(), projections = /* @__PURE__ */ new Map(), dependencyGraphs = [], trailer = "") {
|
|
32479
32948
|
const paths = new Set(
|
|
32480
32949
|
graphs.flatMap(
|
|
32481
32950
|
(graph) => graph.symbols.map((symbol2) => symbol2.pathComponents.join("."))
|
|
32482
32951
|
)
|
|
32483
32952
|
);
|
|
32953
|
+
const behavior = new Map(
|
|
32954
|
+
[...declared].filter(([name3, entry]) => !entry.builtin || paths.has(name3))
|
|
32955
|
+
);
|
|
32484
32956
|
const swiftPaths = new Set(
|
|
32485
32957
|
requireSwift ? graphs.flatMap(
|
|
32486
32958
|
(graph) => graph.symbols.filter(isSwiftDeclaration).map((symbol2) => symbol2.pathComponents.join("."))
|
|
@@ -32513,6 +32985,8 @@ function graphStandin(module2, graphs, values, wasm, binary, toolchain, work, re
|
|
|
32513
32985
|
const plain = /* @__PURE__ */ new Set();
|
|
32514
32986
|
const unobjc = /* @__PURE__ */ new Set();
|
|
32515
32987
|
const trapped = /* @__PURE__ */ new Set();
|
|
32988
|
+
const forced = /* @__PURE__ */ new Set();
|
|
32989
|
+
const nonfailable = /* @__PURE__ */ new Set();
|
|
32516
32990
|
const unconformed = /* @__PURE__ */ new Map();
|
|
32517
32991
|
const objcProtocols = new Set(
|
|
32518
32992
|
graphs.flatMap(
|
|
@@ -32522,7 +32996,7 @@ function graphStandin(module2, graphs, values, wasm, binary, toolchain, work, re
|
|
|
32522
32996
|
)
|
|
32523
32997
|
);
|
|
32524
32998
|
const file = import_node_path49.default.join(work, `${module2}.swift`);
|
|
32525
|
-
const inert = binary.placeholder !== void 0 || binary.publicHeaders !== void 0 && binary.
|
|
32999
|
+
const inert = binary.placeholder !== void 0 || binary.publicHeaders !== void 0 && binary.unloweredSources === void 0;
|
|
32526
33000
|
for (; ; ) {
|
|
32527
33001
|
const { source, owners, skipped } = emitSwiftStandin(graphs, {
|
|
32528
33002
|
module: module2,
|
|
@@ -32535,6 +33009,8 @@ function graphStandin(module2, graphs, values, wasm, binary, toolchain, work, re
|
|
|
32535
33009
|
unobjc,
|
|
32536
33010
|
unconformed,
|
|
32537
33011
|
trapped,
|
|
33012
|
+
forcedOverride: forced,
|
|
33013
|
+
coderNonfailable: nonfailable,
|
|
32538
33014
|
inert,
|
|
32539
33015
|
imports: [...placeholder?.peachImports ?? [], ...imports2],
|
|
32540
33016
|
family: [...imports2, ...placeholder?.peachImports ?? []],
|
|
@@ -32554,7 +33030,7 @@ function graphStandin(module2, graphs, values, wasm, binary, toolchain, work, re
|
|
|
32554
33030
|
`Configured Swift behavior ${module2}.${entry.path} was not emitted: ${entry.reason}`
|
|
32555
33031
|
);
|
|
32556
33032
|
}
|
|
32557
|
-
import_node_fs48.default.writeFileSync(file, source);
|
|
33033
|
+
import_node_fs48.default.writeFileSync(file, source + trailer);
|
|
32558
33034
|
const check2 = (0, import_node_child_process29.spawnSync)(
|
|
32559
33035
|
import_node_path49.default.join(toolchain.toolchainBin, "swiftc"),
|
|
32560
33036
|
// emitting the module runs the diagnostics a typecheck skips, such as
|
|
@@ -32578,10 +33054,10 @@ function graphStandin(module2, graphs, values, wasm, binary, toolchain, work, re
|
|
|
32578
33054
|
return {
|
|
32579
33055
|
module: module2,
|
|
32580
33056
|
target: binary.target,
|
|
32581
|
-
files: { [`${module2}.swift`]: source },
|
|
33057
|
+
files: { [`${module2}.swift`]: source + trailer },
|
|
32582
33058
|
...imports2.length ? { dependencies: imports2 } : {}
|
|
32583
33059
|
};
|
|
32584
|
-
const before = omit.size + plain.size + unobjc.size + trapped.size + unconformed.size;
|
|
33060
|
+
const before = omit.size + plain.size + unobjc.size + trapped.size + unconformed.size + forced.size + nonfailable.size;
|
|
32585
33061
|
const elsewhere = [];
|
|
32586
33062
|
for (const match of check2.stderr.matchAll(/^(\S+?):(\d+):\d+: error: (.*)$/gm)) {
|
|
32587
33063
|
const owner = match[1] === file ? owners[Number(match[2]) - 1] : void 0;
|
|
@@ -32604,14 +33080,22 @@ function graphStandin(module2, graphs, values, wasm, binary, toolchain, work, re
|
|
|
32604
33080
|
throw new Error(
|
|
32605
33081
|
`Configured Swift behavior ${module2}.${owner} does not typecheck: ${match[3]}`
|
|
32606
33082
|
);
|
|
32607
|
-
if (owner && /does not override any|overrides nothing/.test(
|
|
33083
|
+
if (owner && /does not override any|overrides nothing|does not override a designated initializer/.test(
|
|
33084
|
+
match[3]
|
|
33085
|
+
))
|
|
32608
33086
|
plain.add(owner);
|
|
33087
|
+
else if (owner && /failable initializer 'init\(coder:\)' cannot override a non-failable/.test(
|
|
33088
|
+
match[3]
|
|
33089
|
+
) && !nonfailable.has(owner))
|
|
33090
|
+
nonfailable.add(owner);
|
|
33091
|
+
else if (owner && /requires an 'override' keyword/.test(match[3]) && !forced.has(owner))
|
|
33092
|
+
forced.add(owner);
|
|
32609
33093
|
else if (owner && inert && INERT_VALUE.test(match[3]) && !trapped.has(owner))
|
|
32610
33094
|
trapped.add(owner);
|
|
32611
33095
|
else if (owner) omit.set(owner, `rejected by swiftc: ${match[3]}`);
|
|
32612
33096
|
else elsewhere.push(match[3]);
|
|
32613
33097
|
}
|
|
32614
|
-
if (omit.size + plain.size + unobjc.size + trapped.size + unconformed.size === before)
|
|
33098
|
+
if (omit.size + plain.size + unobjc.size + trapped.size + unconformed.size + forced.size + nonfailable.size === before)
|
|
32615
33099
|
throw new Error(
|
|
32616
33100
|
`its generated source does not typecheck: ${elsewhere.slice(0, 3).join("; ") || check2.stderr.trim().slice(0, 400)}`
|
|
32617
33101
|
);
|
|
@@ -33358,7 +33842,8 @@ function readStandinResults(receipt, generation, targets) {
|
|
|
33358
33842
|
return { standins, gaps };
|
|
33359
33843
|
}
|
|
33360
33844
|
var built = /* @__PURE__ */ new Map();
|
|
33361
|
-
function standinGenerationInputs(binaries, toolchain,
|
|
33845
|
+
function standinGenerationInputs(binaries, toolchain, configuredBehavior = {}, sourceDir) {
|
|
33846
|
+
const behavior = withBuiltinStandinBehavior(configuredBehavior);
|
|
33362
33847
|
const { moduleRoot, release } = toolchain;
|
|
33363
33848
|
const sdk = swiftModuleSdk(moduleRoot);
|
|
33364
33849
|
const digest = sourceDir === void 0 ? STANDIN_SOURCE_DIGEST : standinSourceDigest(sourceDir);
|
|
@@ -33424,7 +33909,7 @@ function standinGenerationInputs(binaries, toolchain, behavior = {}, sourceDir)
|
|
|
33424
33909
|
...(binary.headerDependencies ?? []).map(
|
|
33425
33910
|
(dependency) => `${swiftTargetModuleName(dependency.module)}\0${treeDigest(import_node_path49.default.join(binary.dir, dependency.path))}`
|
|
33426
33911
|
),
|
|
33427
|
-
...binary.
|
|
33912
|
+
...binary.unloweredSources ?? []
|
|
33428
33913
|
].join("\0") : swiftBinaryFramework(binary).digest
|
|
33429
33914
|
);
|
|
33430
33915
|
} catch {
|
|
@@ -33621,8 +34106,13 @@ ${roots.map((file) => ` header "${file}"`).join("\n")}
|
|
|
33621
34106
|
}
|
|
33622
34107
|
return settle(result);
|
|
33623
34108
|
}
|
|
33624
|
-
async function swiftStandins(binaries, toolchain, provided = /* @__PURE__ */ new Set(),
|
|
33625
|
-
const built2 = await buildStandins(
|
|
34109
|
+
async function swiftStandins(binaries, toolchain, provided = /* @__PURE__ */ new Set(), configuredBehavior = {}, options = {}) {
|
|
34110
|
+
const built2 = await buildStandins(
|
|
34111
|
+
binaries,
|
|
34112
|
+
toolchain,
|
|
34113
|
+
provided,
|
|
34114
|
+
withBuiltinStandinBehavior(configuredBehavior)
|
|
34115
|
+
);
|
|
33626
34116
|
return {
|
|
33627
34117
|
standins: options.nativeSlices === false ? built2.standins : built2.standins.map((standin) => {
|
|
33628
34118
|
const binary = binaries.find((item) => item.target === standin.target);
|
|
@@ -33630,7 +34120,7 @@ async function swiftStandins(binaries, toolchain, provided = /* @__PURE__ */ new
|
|
|
33630
34120
|
standin,
|
|
33631
34121
|
toolchain.moduleRoot,
|
|
33632
34122
|
STANDIN_SOURCE_DIGEST,
|
|
33633
|
-
Object.keys(
|
|
34123
|
+
Object.keys(configuredBehavior[standin.module] ?? {}).length > 0,
|
|
33634
34124
|
() => swiftBinaryFramework(binary).dir
|
|
33635
34125
|
) : standin;
|
|
33636
34126
|
}),
|
|
@@ -34056,7 +34546,7 @@ function* xcodeObjCInputSteps(app, binaries, moduleRoot, products, sourceRoot =
|
|
|
34056
34546
|
const binaryHeaders = binarySearch.flatMap((search) => search.headers);
|
|
34057
34547
|
const configuration = app.configuration === "Debug" ? "debug" : "release";
|
|
34058
34548
|
for (const binary of binaries) {
|
|
34059
|
-
if (!binary.reached || binary.publicHeaders === void 0 || binary.
|
|
34549
|
+
if (!binary.reached || binary.publicHeaders === void 0 || binary.unloweredSources !== void 0)
|
|
34060
34550
|
continue;
|
|
34061
34551
|
const manifest = swiftPackageManifest(binary.dir);
|
|
34062
34552
|
const target = manifest.targets.get(binary.target);
|
|
@@ -35420,9 +35910,9 @@ guard let dest = CGImageDestinationCreateWithURL(output as CFURL, UTType.png.ide
|
|
|
35420
35910
|
CGImageDestinationAddImage(dest, image, nil)
|
|
35421
35911
|
guard CGImageDestinationFinalize(dest) else { exit(7) }
|
|
35422
35912
|
`;
|
|
35423
|
-
function rasterBinary() {
|
|
35424
|
-
const tag = (0, import_node_crypto28.createHash)("sha256").update(
|
|
35425
|
-
const binary = import_node_path53.default.join(cacheDir(),
|
|
35913
|
+
function rasterBinary(swift = RASTER_SWIFT, name3 = "swift-pdf-raster") {
|
|
35914
|
+
const tag = (0, import_node_crypto28.createHash)("sha256").update(swift).digest("hex").slice(0, 16);
|
|
35915
|
+
const binary = import_node_path53.default.join(cacheDir(), `${name3}-${tag}`);
|
|
35426
35916
|
try {
|
|
35427
35917
|
import_node_fs52.default.accessSync(binary, import_node_fs52.default.constants.X_OK);
|
|
35428
35918
|
return binary;
|
|
@@ -35434,7 +35924,7 @@ function rasterBinary() {
|
|
|
35434
35924
|
import_node_fs52.default.mkdtempSync(import_node_path53.default.join(import_node_os14.default.tmpdir(), "swift-pdf-raster-")),
|
|
35435
35925
|
"raster.swift"
|
|
35436
35926
|
);
|
|
35437
|
-
import_node_fs52.default.writeFileSync(source,
|
|
35927
|
+
import_node_fs52.default.writeFileSync(source, swift);
|
|
35438
35928
|
try {
|
|
35439
35929
|
(0, import_node_child_process32.execFileSync)("xcrun", ["swiftc", "-o", binary, source], { stdio: "pipe" });
|
|
35440
35930
|
} finally {
|
|
@@ -35492,6 +35982,49 @@ function rasterizePdfFile(diskPath, pdfSha256) {
|
|
|
35492
35982
|
import_node_fs52.default.rmSync(import_node_path53.default.dirname(out), { recursive: true, force: true });
|
|
35493
35983
|
}
|
|
35494
35984
|
}
|
|
35985
|
+
var RASTER_SVG_SWIFT = `import AppKit
|
|
35986
|
+
guard CommandLine.arguments.count == 4 else { exit(1) }
|
|
35987
|
+
let input = URL(fileURLWithPath: CommandLine.arguments[1])
|
|
35988
|
+
let scale = CGFloat(Double(CommandLine.arguments[2]) ?? 3.0)
|
|
35989
|
+
let output = URL(fileURLWithPath: CommandLine.arguments[3])
|
|
35990
|
+
guard let image = NSImage(contentsOf: input), image.size.width > 0, image.size.height > 0 else { exit(2) }
|
|
35991
|
+
let width = Int(ceil(image.size.width * scale))
|
|
35992
|
+
let height = Int(ceil(image.size.height * scale))
|
|
35993
|
+
if width > 12000 || height > 12000 { exit(3) }
|
|
35994
|
+
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) }
|
|
35995
|
+
guard let context = NSGraphicsContext(bitmapImageRep: rep) else { exit(5) }
|
|
35996
|
+
NSGraphicsContext.saveGraphicsState()
|
|
35997
|
+
NSGraphicsContext.current = context
|
|
35998
|
+
context.imageInterpolation = .high
|
|
35999
|
+
image.draw(in: NSRect(x: 0, y: 0, width: width, height: height), from: .zero, operation: .copy, fraction: 1)
|
|
36000
|
+
NSGraphicsContext.restoreGraphicsState()
|
|
36001
|
+
guard let data = rep.representation(using: .png, properties: [:]) else { exit(6) }
|
|
36002
|
+
do { try data.write(to: output) } catch { exit(7) }
|
|
36003
|
+
`;
|
|
36004
|
+
function rasterizeSvgFile(diskPath, svgSha256) {
|
|
36005
|
+
if (process.platform !== "darwin") return null;
|
|
36006
|
+
const binary = rasterBinary(RASTER_SVG_SWIFT, "swift-svg-raster");
|
|
36007
|
+
const tag = (0, import_node_crypto28.createHash)("sha256").update(RASTER_SVG_SWIFT).digest("hex").slice(0, 16);
|
|
36008
|
+
const cached = import_node_path53.default.join(cacheDir(), `swift-svg-png-${tag}-${svgSha256}.png`);
|
|
36009
|
+
if (import_node_fs52.default.existsSync(cached)) return { bytes: import_node_fs52.default.readFileSync(cached) };
|
|
36010
|
+
const out = import_node_path53.default.join(
|
|
36011
|
+
import_node_fs52.default.mkdtempSync(import_node_path53.default.join(import_node_os14.default.tmpdir(), "swift-svg-png-")),
|
|
36012
|
+
"out.png"
|
|
36013
|
+
);
|
|
36014
|
+
try {
|
|
36015
|
+
(0, import_node_child_process32.execFileSync)(binary, [diskPath, "3", out], { stdio: "pipe" });
|
|
36016
|
+
const bytes = import_node_fs52.default.readFileSync(out);
|
|
36017
|
+
import_node_fs52.default.mkdirSync(cacheDir(), { recursive: true });
|
|
36018
|
+
import_node_fs52.default.copyFileSync(out, cached);
|
|
36019
|
+
return { bytes: Buffer.from(bytes) };
|
|
36020
|
+
} catch (error) {
|
|
36021
|
+
throw new Error(
|
|
36022
|
+
`swift svg asset ${diskPath} did not rasterize: ${error instanceof Error ? error.message : String(error)}`
|
|
36023
|
+
);
|
|
36024
|
+
} finally {
|
|
36025
|
+
import_node_fs52.default.rmSync(import_node_path53.default.dirname(out), { recursive: true, force: true });
|
|
36026
|
+
}
|
|
36027
|
+
}
|
|
35495
36028
|
|
|
35496
36029
|
// src/swift-standin-config.ts
|
|
35497
36030
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
@@ -35657,7 +36190,7 @@ async function swiftPackages(entry, app) {
|
|
|
35657
36190
|
] : []
|
|
35658
36191
|
);
|
|
35659
36192
|
let reached = [...cached.binaries.filter((binary) => binary.reached), ...vendored];
|
|
35660
|
-
const standinArtifact = (binary) => binary.publicHeaders === void 0 || binary.
|
|
36193
|
+
const standinArtifact = (binary) => binary.publicHeaders === void 0 || binary.unloweredSources !== void 0;
|
|
35661
36194
|
const artifacts = reached.filter(standinArtifact);
|
|
35662
36195
|
if (entry.moduleRoot && entry.provided && artifacts.length > 0) {
|
|
35663
36196
|
const resolved = swiftModuleToolchain(entry.moduleRoot);
|
|
@@ -35676,10 +36209,13 @@ async function swiftPackages(entry, app) {
|
|
|
35676
36209
|
const cxxArtifacts = reached.filter(standinArtifact);
|
|
35677
36210
|
const generation = standinGenerationInputs(cxxArtifacts, toolchain, entry.behavior);
|
|
35678
36211
|
if (cached.standinKey !== generation) {
|
|
36212
|
+
const replaced = new Set(
|
|
36213
|
+
cxxArtifacts.filter((binary) => shippedBinaryDiffers(binary.target, binary.checksum)).map((binary) => binary.target)
|
|
36214
|
+
);
|
|
35679
36215
|
const built2 = await swiftStandins(
|
|
35680
36216
|
cxxArtifacts,
|
|
35681
36217
|
toolchain,
|
|
35682
|
-
entry.provided,
|
|
36218
|
+
new Set([...entry.provided].filter((name3) => !replaced.has(name3))),
|
|
35683
36219
|
entry.behavior
|
|
35684
36220
|
);
|
|
35685
36221
|
cached.packages = await resolveSwiftPackagesAsync({
|
|
@@ -35693,6 +36229,9 @@ async function swiftPackages(entry, app) {
|
|
|
35693
36229
|
...entry.provided,
|
|
35694
36230
|
...cxxArtifacts.map((binary) => binary.target).filter((target) => !built2.gaps.has(target))
|
|
35695
36231
|
]),
|
|
36232
|
+
standinTargets: new Set(
|
|
36233
|
+
[...replaced].filter((target) => !built2.gaps.has(target))
|
|
36234
|
+
),
|
|
35696
36235
|
binaryGaps: built2.gaps,
|
|
35697
36236
|
owners
|
|
35698
36237
|
});
|
|
@@ -36592,6 +37131,12 @@ function buildSwiftResourceTable(project, baseUrl, inputs) {
|
|
|
36592
37131
|
throw new Error("swift image pack exceeds the compile service caps");
|
|
36593
37132
|
}
|
|
36594
37133
|
bytes = readPackageFile2(project.packagePath, disk, limits.imageBytes);
|
|
37134
|
+
const svg = ext === ".svg" ? rasterizeSvgFile(disk, (0, import_node_crypto29.createHash)("sha256").update(bytes).digest("hex")) : null;
|
|
37135
|
+
if (svg) {
|
|
37136
|
+
bytes = svg.bytes;
|
|
37137
|
+
ext = ".png";
|
|
37138
|
+
uploadName = `${import_node_path54.default.posix.basename(file, import_node_path54.default.posix.extname(file))}.png`;
|
|
37139
|
+
}
|
|
36595
37140
|
}
|
|
36596
37141
|
if (imageBytes + bytes.length > limits.imageTotalBytes) {
|
|
36597
37142
|
throw new Error("swift image pack exceeds the compile service caps");
|