You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This provides new metadata during builds:
- Use the new `-sdk_imports` linker option when appropriate and provide a post-processed version of it as a resource in each bundle.
- For each codeless bundle, "stamp" its Info.plist with any clients, this allows finding the library associated with a particular codeless bundle.
Both behaviors are enabled by the `ENABLE_SDK_IMPORTS` build setting which defaults to the inverse of `ASSETCATALOG_COMPILER_SKIP_APP_STORE_DEPLOYMENT`.
Co-authored-by: Owen Voorhees <[email protected]>
@@ -105,7 +108,7 @@ public struct InfoPlistProcessorTaskActionContext: PlatformBuildContext, Seriali
105
108
// Get the platform registry to use to look up the platform from the deserializer's delegate.
106
109
guardlet delegate = deserializer.delegate as?(anyInfoPlistProcessorTaskActionContextDeserializerDelegate)else{throwDeserializerError.invalidDelegate("delegate must be a BuildDescriptionDeserializerDelegate")}
Copy file name to clipboardExpand all lines: Sources/SWBCore/Specs/CoreBuildSystem.xcspec
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -4462,6 +4462,13 @@ When this setting is enabled:
4462
4462
DisplayName = "Sticker Sharing Level";
4463
4463
Description = "When `GENERATE_INFOPLIST_FILE` is enabled, sets the value of the NSStickerSharingLevel key in the `Info.plist` file to the value of this build setting.";
if !usesLDClassic, supportsSDKImportsFeature, !sdkImportsInfoFile.isEmpty, cbc.scope.evaluate(BuiltinMacros.ENABLE_SDK_IMPORTS), cbc.producer.isApplePlatform {
564
+
commandLine.insert(contentsOf:["-Xlinker","-sdk_imports","-Xlinker", sdkImportsInfoFile.str,"-Xlinker","-sdk_imports_each_object"], at: commandLine.count -2) // This preserves the assumption that the last argument is the linker output which a few tests make.
@@ -1582,6 +1533,73 @@ public final class LibtoolLinkerSpec : GenericLinkerSpec, SpecIdentifierType {
1582
1533
}
1583
1534
}
1584
1535
1536
+
/// Consults the global cache of discovered info for the linker at `toolPath` and returns it, creating it if necessary.
1537
+
///
1538
+
/// This is global and public because it is used by `SWBTaskExecution` and `CoreBasedTests`, which is the basis of many of our tests (so caching this info across tests is desirable).
1539
+
publicfunc discoveredLinkerToolsInfo(_ producer:anyCommandProducer, _ delegate:anyCoreClientTargetDiagnosticProducingDelegate, at toolPath:Path)async->(anyDiscoveredCommandLineToolSpecInfo)?{
1540
+
do{
1541
+
do{
1542
+
letcommandLine=[toolPath.str,"-version_details"]
1543
+
returntryawait producer.discoveredCommandLineToolSpecInfo(delegate,nil, commandLine,{ executionResult in
1544
+
letgnuLD=[
1545
+
#/GNU ld version (?<version>[\d.]+)-.*/#,
1546
+
#/GNU ld \(GNU Binutils.*\) (?<version>[\d.]+)/#,
1547
+
]
1548
+
iflet match =try gnuLD.compactMap({try $0.firstMatch(in:String(decoding: executionResult.stdout, as:UTF8.self))}).first {
/// Enumerates a linker command line, calling the provided `handle` closure for each logical argument, providing the argument name as `arg` and a `value` function which returns the value of that argument at `offset` positions distance from the `arg` value based on how many arguments it takes.
1586
1604
///
1587
1605
/// The purpose of this function is to automatically abstract away handling of the `-Xlinker` and `-Wl` syntax used by compiler drivers to forward arguments to the linker which they themselves do not understand.
0 commit comments