peachsim 0.1.1875 → 0.1.1877
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/bundle-channel.cjs +124 -109
- 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 +25 -19
- 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 +26 -20
- package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +5 -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 +5 -3
- package/dist-lib/native-app-identity-project.cjs +5 -3
- package/dist-lib/native-app-identity-project.mjs +5 -3
- 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 +54 -54
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/reap-browser.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +26 -20
- package/dist-lib/swift-compile.cjs +20 -16
- package/dist-lib/swift-compile.mjs +20 -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 +21 -17
- package/dist-lib/vite.cjs +1 -1
- 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/Security.framework/Headers/SecImportExport.h +722 -0
- package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecSharedCredential.h +119 -0
- package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/Security.h +2 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIGestureRecognizer.h +1 -1
- package/src/bundle-channel.mjs +21 -11
- package/src/native-app-identity-project.ts +3 -1
- package/src/swift-compile.ts +22 -14
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2014-2020 Apple Inc. All Rights Reserved.
|
|
3
|
+
*
|
|
4
|
+
* @APPLE_LICENSE_HEADER_START@
|
|
5
|
+
*
|
|
6
|
+
* This file contains Original Code and/or Modifications of Original Code
|
|
7
|
+
* as defined in and that are subject to the Apple Public Source License
|
|
8
|
+
* Version 2.0 (the 'License'). You may not use this file except in
|
|
9
|
+
* compliance with the License. Please obtain a copy of the License at
|
|
10
|
+
* http://www.opensource.apple.com/apsl/ and read it before using this
|
|
11
|
+
* file.
|
|
12
|
+
*
|
|
13
|
+
* The Original Code and all software distributed under the License are
|
|
14
|
+
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
|
15
|
+
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
|
16
|
+
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
|
18
|
+
* Please see the License for the specific language governing rights and
|
|
19
|
+
* limitations under the License.
|
|
20
|
+
*
|
|
21
|
+
* @APPLE_LICENSE_HEADER_END@
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
/*!
|
|
25
|
+
@header SecSharedCredential
|
|
26
|
+
SecSharedCredential defines CoreFoundation-based functions for
|
|
27
|
+
storing and requesting shared password-based credentials.
|
|
28
|
+
These credentials are currently able to be shared with Safari and
|
|
29
|
+
applications which have a 'com.apple.developer.associated-domains'
|
|
30
|
+
entitlement that includes the domain being requested.
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
#ifndef _SECURITY_SECSHAREDCREDENTIAL_H_
|
|
34
|
+
#define _SECURITY_SECSHAREDCREDENTIAL_H_
|
|
35
|
+
|
|
36
|
+
#include <Security/SecItem.h>
|
|
37
|
+
#include <CoreFoundation/CoreFoundation.h>
|
|
38
|
+
#include <AvailabilityMacros.h>
|
|
39
|
+
|
|
40
|
+
__BEGIN_DECLS
|
|
41
|
+
|
|
42
|
+
CF_ASSUME_NONNULL_BEGIN
|
|
43
|
+
CF_IMPLICIT_BRIDGING_ENABLED
|
|
44
|
+
|
|
45
|
+
#ifdef __BLOCKS__
|
|
46
|
+
|
|
47
|
+
/*!
|
|
48
|
+
@enum Credential Key Constants
|
|
49
|
+
@discussion Predefined key constants used to get values in a dictionary
|
|
50
|
+
of credentials returned by SecRequestWebCredential.
|
|
51
|
+
@constant kSecSharedPassword Specifies a dictionary key whose value is a
|
|
52
|
+
shared password. You use this key to get a value of type CFStringRef
|
|
53
|
+
that contains a password.
|
|
54
|
+
*/
|
|
55
|
+
extern const CFStringRef kSecSharedPassword
|
|
56
|
+
API_AVAILABLE(ios(8.0), macCatalyst(14.0), macos(11.0))
|
|
57
|
+
API_UNAVAILABLE(tvos, watchos);
|
|
58
|
+
|
|
59
|
+
/*!
|
|
60
|
+
@function SecAddSharedWebCredential
|
|
61
|
+
@abstract Asynchronously store (or update) a shared password for a website.
|
|
62
|
+
@param fqdn The fully qualified domain name of the website requiring the password.
|
|
63
|
+
@param account The account name associated with this password.
|
|
64
|
+
@param password The password to be stored. Pass NULL to remove a shared password if it exists.
|
|
65
|
+
@param completionHandler A block which will be invoked when the function has completed. If the shared password was successfully added (or removed), the CFErrorRef parameter passed to the block will be NULL. If the error parameter is non-NULL, an error occurred and the error reference will hold the result. Note: the error reference will be automatically released after this handler is called, though you may optionally retain it for as long as needed.
|
|
66
|
+
@discussion This function adds a shared password item which will be accessible by Safari and applications that have the specified fully-qualified domain name in their 'com.apple.developer.associated-domains' entitlement. If a shared password item already exists for the specified website and account, it will be updated with the provided password. To remove a password, pass NULL for the password parameter.
|
|
67
|
+
|
|
68
|
+
Note: since a request involving shared web credentials may potentially require user interaction or other verification to be approved, this function is dispatched asynchronously; your code provides a completion handler that will be called once the results (if any) are available.
|
|
69
|
+
*/
|
|
70
|
+
void SecAddSharedWebCredential(CFStringRef fqdn, CFStringRef account, CFStringRef __nullable password,
|
|
71
|
+
void (^completionHandler)(CFErrorRef __nullable error))
|
|
72
|
+
API_DEPRECATED("Use ASCredentialDataManager.save(password:for:title:anchor:) (AuthenticationServices framework)",
|
|
73
|
+
ios(8.0, 26.2), macCatalyst(14.0, 26.2), macos(11.0, 26.2))
|
|
74
|
+
API_UNAVAILABLE(tvos, watchos);
|
|
75
|
+
|
|
76
|
+
/*!
|
|
77
|
+
@function SecRequestSharedWebCredential
|
|
78
|
+
@abstract Asynchronously obtain one or more shared passwords for a website.
|
|
79
|
+
@param fqdn (Optional) Fully qualified domain name of the website for which passwords are being requested. If NULL is passed in this argument, the domain name(s) listed in the calling application's 'com.apple.developer.associated-domains' entitlement are searched implicitly.
|
|
80
|
+
@param account (Optional) Account name for which passwords are being requested. The account may be NULL to request all shared credentials which are available for the site, allowing the caller to discover an existing account.
|
|
81
|
+
@param completionHandler A block which will be called to deliver the requested credentials. If no matching items were found, the credentials array will be empty, and the CFErrorRef parameter will provide the error result. Note: the credentials and error references will be automatically released after this handler is called, though you may optionally retain either for as long as needed.
|
|
82
|
+
@discussion This function requests one or more shared passwords for a given website, depending on whether the optional account parameter is supplied. To obtain results, the website specified in the fqdn parameter must be one which matches an entry in the calling application's 'com.apple.developer.associated-domains' entitlement.
|
|
83
|
+
|
|
84
|
+
If matching shared password items are found, the credentials provided to the completionHandler will be a CFArrayRef containing CFDictionaryRef entries. Each dictionary entry will contain the following pairs (see Security/SecItem.h):
|
|
85
|
+
key: kSecAttrServer value: CFStringRef (the website)
|
|
86
|
+
key: kSecAttrAccount value: CFStringRef (the account)
|
|
87
|
+
key: kSecSharedPassword value: CFStringRef (the password)
|
|
88
|
+
|
|
89
|
+
If the found item specifies a non-standard port number (i.e. other than 443 for https), the following key may also be present:
|
|
90
|
+
key: kSecAttrPort value: CFNumberRef (the port number)
|
|
91
|
+
|
|
92
|
+
Note: since a request involving shared web credentials may potentially require user interaction or other verification to be approved, this function is dispatched asynchronously; your code provides a completion handler that will be called once the results (if any) are available.
|
|
93
|
+
*/
|
|
94
|
+
void SecRequestSharedWebCredential(CFStringRef __nullable fqdn, CFStringRef __nullable account,
|
|
95
|
+
void (^completionHandler)(CFArrayRef __nullable credentials, CFErrorRef __nullable error))
|
|
96
|
+
API_DEPRECATED("Use ASAuthorizationController to make an ASAuthorizationPasswordRequest (AuthenticationServices framework)",
|
|
97
|
+
ios(8.0,14.0), macCatalyst(14.0,14.0), macos(10.16,11.0))
|
|
98
|
+
API_UNAVAILABLE(tvos, watchos);
|
|
99
|
+
|
|
100
|
+
/*!
|
|
101
|
+
@function SecCreateSharedWebCredentialPassword
|
|
102
|
+
@abstract Returns a randomly generated password.
|
|
103
|
+
@return CFStringRef password in the form xxx-xxx-xxx-xxx where x is taken from the sets "abcdefghkmnopqrstuvwxy", "ABCDEFGHJKLMNPQRSTUVWXYZ", "3456789" with at least one character from each set being present.
|
|
104
|
+
*/
|
|
105
|
+
__nullable
|
|
106
|
+
CFStringRef SecCreateSharedWebCredentialPassword(void)
|
|
107
|
+
API_AVAILABLE(ios(8.0), macCatalyst(14.0), macos(11.0))
|
|
108
|
+
API_UNAVAILABLE(tvos, watchos);
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
#endif /* __BLOCKS__ */
|
|
112
|
+
|
|
113
|
+
CF_IMPLICIT_BRIDGING_DISABLED
|
|
114
|
+
CF_ASSUME_NONNULL_END
|
|
115
|
+
|
|
116
|
+
__END_DECLS
|
|
117
|
+
|
|
118
|
+
#endif /* !_SECURITY_SECSHAREDCREDENTIAL_H_ */
|
|
119
|
+
|
|
@@ -77,7 +77,7 @@ PEACH_SWIFT_CLASS(UIKitCore) @interface UIGestureRecognizer : NSObject
|
|
|
77
77
|
|
|
78
78
|
|
|
79
79
|
API_UNAVAILABLE(watchos) NS_SWIFT_UI_ACTOR
|
|
80
|
-
@protocol UIGestureRecognizerDelegate <NSObject>
|
|
80
|
+
PEACH_SWIFT_CLASS(UIKitCore) @protocol UIGestureRecognizerDelegate <NSObject>
|
|
81
81
|
@optional
|
|
82
82
|
// called when a gesture recognizer attempts to transition out of UIGestureRecognizerStatePossible. returning NO causes it to transition to UIGestureRecognizerStateFailed
|
|
83
83
|
- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer;
|
package/src/bundle-channel.mjs
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
// publish the plain OTA bundle for Peach without changing the phone's bytecode.
|
|
2
2
|
import { createHash } from 'node:crypto'
|
|
3
|
+
import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from 'node:fs'
|
|
4
|
+
import { basename, dirname, join } from 'node:path'
|
|
3
5
|
import { Script } from 'node:vm'
|
|
4
6
|
import { brotliCompressSync, constants as zlibConstants, gunzipSync } from 'node:zlib'
|
|
5
7
|
import { isLoopbackHost } from './backend-origin'
|
|
6
8
|
import { resolveConnectionInput } from './dev-bundle-resolution'
|
|
9
|
+
import { cacheDir } from './home-paths'
|
|
7
10
|
import { readInstalledNativePackageVersionsAsync } from './installed-package-versions'
|
|
8
11
|
import { buildNativeBundles, insertNativeBundleFooters } from './native-bundles'
|
|
9
12
|
import { nodeHttpFetch } from './node-http-fetch'
|
|
@@ -219,6 +222,23 @@ function prepareChannel({
|
|
|
219
222
|
return { platform, key: `${prefix}/${channelKey(platform)}`, metadata, objects }
|
|
220
223
|
}
|
|
221
224
|
|
|
225
|
+
// quality 11 takes minutes on the large swift and icu objects, which rarely
|
|
226
|
+
// change between releases, so their compressed bytes are kept by content.
|
|
227
|
+
function brotliCompressCached(bytes) {
|
|
228
|
+
const file = join(cacheDir(), 'bundle-channel-brotli', `${digest(bytes)}-q11-w24.br`)
|
|
229
|
+
if (existsSync(file)) return readFileSync(file)
|
|
230
|
+
const compressed = brotliCompressSync(bytes, {
|
|
231
|
+
params: {
|
|
232
|
+
[zlibConstants.BROTLI_PARAM_QUALITY]: 11,
|
|
233
|
+
[zlibConstants.BROTLI_PARAM_LGWIN]: 24,
|
|
234
|
+
},
|
|
235
|
+
})
|
|
236
|
+
mkdirSync(dirname(file), { recursive: true })
|
|
237
|
+
writeFileSync(`${file}.${process.pid}`, compressed)
|
|
238
|
+
renameSync(`${file}.${process.pid}`, file)
|
|
239
|
+
return compressed
|
|
240
|
+
}
|
|
241
|
+
|
|
222
242
|
export async function publishBundleChannel(release, { put, fetchObject = fetch }) {
|
|
223
243
|
const precompressBrotli = !isLoopbackHost(new URL(release.origin).hostname)
|
|
224
244
|
// prove every immutable object is downloadable before changing a channel.
|
|
@@ -238,12 +258,7 @@ export async function publishBundleChannel(release, { put, fetchObject = fetch }
|
|
|
238
258
|
object.contentType === 'application/gzip'
|
|
239
259
|
? gunzipSync(object.bytes)
|
|
240
260
|
: object.bytes
|
|
241
|
-
wireBytes =
|
|
242
|
-
params: {
|
|
243
|
-
[zlibConstants.BROTLI_PARAM_QUALITY]: 11,
|
|
244
|
-
[zlibConstants.BROTLI_PARAM_LGWIN]: 24,
|
|
245
|
-
},
|
|
246
|
-
})
|
|
261
|
+
wireBytes = brotliCompressCached(expectedDecoded)
|
|
247
262
|
if (object.contentType === 'application/gzip')
|
|
248
263
|
contentType = 'application/octet-stream'
|
|
249
264
|
contentEncoding = 'br'
|
|
@@ -297,8 +312,6 @@ async function packagePlatformBundle(
|
|
|
297
312
|
bundle,
|
|
298
313
|
{ config, versions, readAssetFile, configuration },
|
|
299
314
|
) {
|
|
300
|
-
const { readFileSync } = await import('node:fs')
|
|
301
|
-
const { basename } = await import('node:path')
|
|
302
315
|
const { produceConfiguredBundle } = await import('./configured-bundle-producer')
|
|
303
316
|
const assets = new Map()
|
|
304
317
|
for (const [registration] of bundle
|
|
@@ -426,7 +439,6 @@ export async function snapshotOneProductionBundle(
|
|
|
426
439
|
const { execFile } = await import('node:child_process')
|
|
427
440
|
const { mkdtemp, readFile, rm } = await import('node:fs/promises')
|
|
428
441
|
const { tmpdir } = await import('node:os')
|
|
429
|
-
const { join } = await import('node:path')
|
|
430
442
|
const { promisify } = await import('node:util')
|
|
431
443
|
const inputs = await readPackagingInputs(projectRoot)
|
|
432
444
|
const snapshots = []
|
|
@@ -470,9 +482,7 @@ export async function snapshotOneDevBundle(
|
|
|
470
482
|
{ runtimeExecutable = process.execPath, platforms = ['ios', 'android'] } = {},
|
|
471
483
|
) {
|
|
472
484
|
const { spawn } = await import('node:child_process')
|
|
473
|
-
const { readFileSync } = await import('node:fs')
|
|
474
485
|
const { createServer } = await import('node:net')
|
|
475
|
-
const { dirname, join } = await import('node:path')
|
|
476
486
|
const { createRequire } = await import('node:module')
|
|
477
487
|
const onePackage = createRequire(join(projectRoot, 'package.json')).resolve(
|
|
478
488
|
'one/package.json',
|
|
@@ -61,7 +61,9 @@ export function readNativeAppIdentityFromXcodeTarget(
|
|
|
61
61
|
nonEmptyString(dictionary.CFBundleVersion) ??
|
|
62
62
|
nonEmptyString(settings?.('CURRENT_PROJECT_VERSION'))
|
|
63
63
|
if (!appVersion || !buildVersion) {
|
|
64
|
-
throw new Error(
|
|
64
|
+
throw new Error(
|
|
65
|
+
'native app has no version or build version; values its Xcode scheme derives in a build phase can be exported as process environment variables when opening',
|
|
66
|
+
)
|
|
65
67
|
}
|
|
66
68
|
|
|
67
69
|
const bundleName =
|
package/src/swift-compile.ts
CHANGED
|
@@ -1613,6 +1613,8 @@ export function emitSwiftPackageManifest(args: {
|
|
|
1613
1613
|
* then links only the stdlib and system archives its sources reference.
|
|
1614
1614
|
*/
|
|
1615
1615
|
distributionLink?: { path: string; files: Map<string, string | Buffer> }
|
|
1616
|
+
/** link the distribution as an archive pruned after the link: size-optimized artifacts only. */
|
|
1617
|
+
lazyDistribution?: boolean
|
|
1616
1618
|
/**
|
|
1617
1619
|
* framework products already built in their own scratch. objects link whole,
|
|
1618
1620
|
* and modules import from that scratch, so this package's targets never
|
|
@@ -1673,9 +1675,11 @@ export function emitSwiftPackageManifest(args: {
|
|
|
1673
1675
|
foundationCategoryObjects.map((name) => `lib/Foundation-${name}.o`),
|
|
1674
1676
|
)
|
|
1675
1677
|
const roots = swiftObjcRootObjects(distribution.id, moduleRoot, distribution.objects)
|
|
1676
|
-
const eager =
|
|
1677
|
-
|
|
1678
|
-
|
|
1678
|
+
const eager = args.lazyDistribution
|
|
1679
|
+
? new Set(
|
|
1680
|
+
objects.filter((object) => roots.has(object) || categoryObjects.has(object)),
|
|
1681
|
+
)
|
|
1682
|
+
: new Set(objects)
|
|
1679
1683
|
// native headers can reference a framework without a Swift import, and a
|
|
1680
1684
|
// native target can share a module name with distribution Swift helpers.
|
|
1681
1685
|
// retain those objects in the archive so undefined symbols select them.
|
|
@@ -5449,6 +5453,7 @@ export function writeSwiftProject(
|
|
|
5449
5453
|
path: path.join(layout.root, '.peach-distribution-objects.rsp'),
|
|
5450
5454
|
files,
|
|
5451
5455
|
},
|
|
5456
|
+
lazyDistribution: input.optimize,
|
|
5452
5457
|
}
|
|
5453
5458
|
: {}),
|
|
5454
5459
|
...(prebuilt && frameworkLink
|
|
@@ -6526,7 +6531,7 @@ function compileSwiftProjectOnce(
|
|
|
6526
6531
|
.join(':'),
|
|
6527
6532
|
}
|
|
6528
6533
|
: {}),
|
|
6529
|
-
PEACH_DEFER_WASM_LINK: '1',
|
|
6534
|
+
...(input.optimize ? { PEACH_DEFER_WASM_LINK: '1' } : {}),
|
|
6530
6535
|
},
|
|
6531
6536
|
maxBuffer: 64 * 1024 * 1024,
|
|
6532
6537
|
timeout: options.timeoutMs,
|
|
@@ -6646,9 +6651,11 @@ function compileSwiftProjectOnce(
|
|
|
6646
6651
|
]),
|
|
6647
6652
|
]
|
|
6648
6653
|
const linked = builtArtifact(layout)
|
|
6649
|
-
|
|
6650
|
-
|
|
6651
|
-
|
|
6654
|
+
if (input.optimize) {
|
|
6655
|
+
rmSync(path.join(root, '.peach-link.rsp'), { force: true })
|
|
6656
|
+
if (existsSync(linked) && statSync(linked).size <= 8)
|
|
6657
|
+
rmSync(linked, { force: true })
|
|
6658
|
+
}
|
|
6652
6659
|
report('compiling and linking Swift modules')
|
|
6653
6660
|
try {
|
|
6654
6661
|
// clang consumes the real emitted headers after swift finishes.
|
|
@@ -6786,13 +6793,14 @@ function compileSwiftProjectOnce(
|
|
|
6786
6793
|
)
|
|
6787
6794
|
}
|
|
6788
6795
|
if (options.project) removeProjectLinks(root)
|
|
6789
|
-
|
|
6790
|
-
|
|
6791
|
-
|
|
6792
|
-
|
|
6793
|
-
|
|
6794
|
-
|
|
6795
|
-
|
|
6796
|
+
if (input.optimize)
|
|
6797
|
+
pruneSwiftWasmLink(
|
|
6798
|
+
root,
|
|
6799
|
+
options.toolchainBin,
|
|
6800
|
+
frameworkRoot,
|
|
6801
|
+
input.staticClangTargets,
|
|
6802
|
+
options.project,
|
|
6803
|
+
)
|
|
6796
6804
|
const output = options.project
|
|
6797
6805
|
? projectOutputFile(root, linked, options.project)
|
|
6798
6806
|
: linked
|