Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
2c69a82
Do not pass index store options if indexing is disabled
ahoppen Nov 11, 2025
51fa0ae
Merge pull request #903 from ahoppen/no-compress-if-index-disabled
ahoppen Nov 13, 2025
541733f
Use the platform of a stub binary when looking up compatible architec…
owenv Nov 13, 2025
756579b
Merge pull request #905 from owenv/owenv/stub-fix
owenv Nov 13, 2025
0f6d00d
Change use of deprecated index(of:) to firstIndex(of:) to fix build w…
mhrawdon Nov 13, 2025
a3ed975
Change import of System/SystemPackage to not be public, to fix a buil…
mhrawdon Nov 13, 2025
0582986
Fix IndexDependencyResolutionTests when EnableDebugActivityLogs is en…
owenv Nov 14, 2025
1017aac
Update automerge workflow to merge release/6.3 into main
jakepetroules Nov 14, 2025
e951fd9
Update the branch automerge workflow name (#913)
jakepetroules Nov 14, 2025
15d2edb
Cleanup targetArchitecture handling in macOS test run destination
owenv Nov 14, 2025
22b2f57
Further reduce lock contention around `macroConfigPaths` (#908)
neonichu Nov 14, 2025
a964197
Merge pull request #912 from owenv/owenv/index-test-fixes
owenv Nov 14, 2025
3bdc19e
Merge pull request #910 from owenv/owenv/dest-cleanup
owenv Nov 14, 2025
2685e8d
Stop passing -fobjc-arc to linker invocations
owenv Nov 14, 2025
9bbfd45
Ignore exit code when checking for system-level packages
jakepetroules Nov 14, 2025
aa60a37
Don't skip coreLoadErrors on Linux
jakepetroules Nov 14, 2025
f8e9d6c
Ensure the build description is regenerated when entitlements change
owenv Nov 15, 2025
df96201
Prevent ProcessProductPackaging from re-running on every settingas ch…
owenv Nov 15, 2025
a06f426
Merge pull request #918 from owenv/owenv/arc-link
owenv Nov 15, 2025
4396e8a
Merge pull request #920 from owenv/owenv/incremental-signing-fixes
owenv Nov 16, 2025
5b73823
Correct linker file list escaping depending on the LINKER_DRIVER used
owenv Nov 16, 2025
83f2b44
Correctly locate chown on all platforms
jakepetroules Nov 15, 2025
8c8804e
Update check in appClips_MacCatalyst_Error() to check for different e…
mhrawdon Nov 15, 2025
f11a4fd
Merge pull request #921 from owenv/owenv/driver-format
owenv Nov 17, 2025
e8c1d1b
Flip direction of the 6.3 merge workflow
owenv Nov 17, 2025
3b0c0b1
Merge pull request #925 from owenv/owenv/flip
owenv Nov 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Create PR to merge main into release branch
# In the first period after branching the release branch, we typically want to include many changes from `main` in the release branch. This workflow automatically creates a PR every Monday to merge main into the release branch.
# Later in the release cycle we should stop this practice to avoid landing risky changes by disabling this workflow. To do so, disable the workflow as described in https://docs.github.com/en/actions/managing-workflow-runs-and-deployments/managing-workflow-runs/disabling-and-enabling-a-workflow
# In the first period after branching the release branch,
# we typically want to include many changes from `main` in the release branch.
# This workflow automatically creates a PR to merge the main branch into the release branch.
# Later in the release cycle we should stop this practice to avoid landing risky changes by disabling this workflow.
# To do so, disable the workflow as described in https://docs.github.com/en/actions/managing-workflow-runs-and-deployments/managing-workflow-runs/disabling-and-enabling-a-workflow
permissions:
contents: read
on:
Expand All @@ -12,8 +15,8 @@ jobs:
name: Create PR to merge main into release branch
uses: swiftlang/github-workflows/.github/workflows/create_automerge_pr.yml@main
with:
head_branch: release/6.2
base_branch: main
head_branch: main
base_branch: release/6.3
permissions:
contents: write
pull-requests: write
Expand Down
2 changes: 0 additions & 2 deletions Sources/SWBAndroidPlatform/Plugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,6 @@ struct AndroidPlatformExtension: PlatformInfoExtension {
"GENERATE_TEXT_BASED_STUBS": "NO",
"GENERATE_INTERMEDIATE_TEXT_BASED_STUBS": "NO",

"CHOWN": "/usr/bin/chown",

"LIBTOOL": .plString(host.imageFormat.executableName(basename: "llvm-lib")),
"AR": .plString(host.imageFormat.executableName(basename: "llvm-ar")),
]
Expand Down
2 changes: 1 addition & 1 deletion Sources/SWBApplePlatform/Specs/MetalCompiler.xcspec
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@
Name = "METAL_INDEX_STORE_ONLY_PROJECT_FILES";
Type = Boolean;
DefaultValue = "$(INDEX_STORE_ONLY_PROJECT_FILES)";
Condition = "$(MTL_ENABLE_INDEX_STORE)";
Condition = "$(MTL_ENABLE_INDEX_STORE) && ( $(COMPILER_INDEX_STORE_ENABLE) == YES || ( $(COMPILER_INDEX_STORE_ENABLE) == Default && $(MTL_ENABLE_DEBUG_INFO) != NO ) )";
CommandLineArgs = {
YES = (
// See corresponding definition in Clang.xcspec
Expand Down
10 changes: 5 additions & 5 deletions Sources/SWBCore/MacroConfigFileLoader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ final class MacroConfigFileLoader: Sendable {
return MacroConfigFileParser(byteString: data, path: path, delegate: delegate)
}

mutating func foundMacroValueAssignment(_ macroName: String, conditions: [(param: String, pattern: String)], value: String, path: Path, startLine: Int, endLine: Int, startColumn: Int, endColumn: Int, parser: MacroConfigFileParser) {
mutating func foundMacroValueAssignment(_ macroName: String, conditions: [(param: String, pattern: String)], value: String, path: Path, pathRef: OrderedSet<Path>.Index, startLine: Int, endLine: Int, startColumn: Int, endColumn: Int, parser: MacroConfigFileParser) {
// Look up the macro name, creating it as a user-defined macro if it isn’t already known.
let macro = table.namespace.lookupOrDeclareMacro(UserDefinedMacroDeclaration.self, macroName)

Expand All @@ -259,8 +259,8 @@ final class MacroConfigFileLoader: Sendable {
}

// Parse the value in a manner consistent with the macro definition.
let location = MacroValueAssignmentLocation(path: path, startLine: startLine, endLine: endLine, startColumn: startColumn, endColumn: endColumn)
table.push(macro, table.namespace.parseForMacro(macro, value: value), conditions: conditionSet, location: location)
let locationRef = InternedMacroValueAssignmentLocation(pathRef: pathRef, startLine: startLine, endLine: endLine, startColumn: startColumn, endColumn: endColumn)
table.push(macro, table.namespace.parseForMacro(macro, value: value), conditions: conditionSet, locationRef: locationRef)
}

func handleDiagnostic(_ diagnostic: MacroConfigFileDiagnostic, parser: MacroConfigFileParser) {
Expand Down Expand Up @@ -308,8 +308,8 @@ fileprivate final class MacroValueAssignmentTableRef {
table.namespace
}

func push(_ macro: MacroDeclaration, _ value: MacroExpression, conditions: MacroConditionSet? = nil, location: MacroValueAssignmentLocation? = nil) {
table.push(macro, value, conditions: conditions, location: location)
func push(_ macro: MacroDeclaration, _ value: MacroExpression, conditions: MacroConditionSet? = nil, locationRef: InternedMacroValueAssignmentLocation? = nil) {
table.push(macro, value, conditions: conditions, locationRef: locationRef)
}
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/SWBCore/PlannedTaskAction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ public protocol TaskActionCreationDelegate
func createLinkAssetCatalogTaskAction() -> any PlannedTaskAction
func createLSRegisterURLTaskAction() -> any PlannedTaskAction
func createODRAssetPackManifestTaskAction() -> any PlannedTaskAction
func createProcessProductEntitlementsTaskAction(scope: MacroEvaluationScope, mergedEntitlements: PropertyListItem, entitlementsVariant: EntitlementsVariant, destinationPlatformName: String, entitlementsFilePath: Path?, fs: any FSProxy) -> any PlannedTaskAction
func createProcessProductEntitlementsTaskAction(mergedEntitlements: PropertyListItem, entitlementsVariant: EntitlementsVariant, allowEntitlementsModification: Bool, entitlementsDestination: EntitlementsDestination, destinationPlatformName: String, entitlementsFilePath: Path?, fs: any FSProxy) -> any PlannedTaskAction
func createProcessProductProvisioningProfileTaskAction() -> any PlannedTaskAction
func createRegisterExecutionPolicyExceptionTaskAction() -> any PlannedTaskAction
func createSwiftHeaderToolTaskAction() -> any PlannedTaskAction
Expand Down
5 changes: 4 additions & 1 deletion Sources/SWBCore/Settings/BuiltinMacros.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1198,6 +1198,8 @@ public final class BuiltinMacros {
public static let _WRAPPER_RESOURCES_DIR = BuiltinMacros.declareStringMacro("_WRAPPER_RESOURCES_DIR")
public static let __INPUT_FILE_LIST_PATH__ = BuiltinMacros.declarePathMacro("__INPUT_FILE_LIST_PATH__")
public static let LINKER_FILE_LIST_FORMAT = BuiltinMacros.declareEnumMacro("LINKER_FILE_LIST_FORMAT") as EnumMacroDeclaration<ResponseFileFormat>
public static let LIBTOOL_FILE_LIST_FORMAT = BuiltinMacros.declareEnumMacro("LIBTOOL_FILE_LIST_FORMAT") as EnumMacroDeclaration<ResponseFileFormat>

public static let LINKER_RESPONSE_FILE_FORMAT = BuiltinMacros.declareEnumMacro("LINKER_RESPONSE_FILE_FORMAT") as EnumMacroDeclaration<ResponseFileFormat>
public static let SWIFT_RESPONSE_FILE_PATH = BuiltinMacros.declarePathMacro("SWIFT_RESPONSE_FILE_PATH")
public static let __ARCHS__ = BuiltinMacros.declareStringListMacro("__ARCHS__")
Expand Down Expand Up @@ -2459,6 +2461,7 @@ public final class BuiltinMacros {
_WRAPPER_RESOURCES_DIR,
__INPUT_FILE_LIST_PATH__,
LINKER_FILE_LIST_FORMAT,
LIBTOOL_FILE_LIST_FORMAT,
LINKER_RESPONSE_FILE_FORMAT,
__ARCHS__,
__SWIFT_MODULE_ONLY_ARCHS__,
Expand Down Expand Up @@ -2876,7 +2879,7 @@ public enum StickerSharingLevel: String, Equatable, Hashable, EnumerationMacroTy
}

/// Enumeration macro type for the value of the `ENTITLEMENTS_DESTINATION` build setting.
public enum EntitlementsDestination: String, Equatable, Hashable, EnumerationMacroType {
public enum EntitlementsDestination: String, Equatable, Hashable, EnumerationMacroType, Serializable {
public static let defaultValue = EntitlementsDestination.none

case codeSignature = "Signature"
Expand Down
5 changes: 3 additions & 2 deletions Sources/SWBCore/SpecImplementations/LinkerSpec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,9 @@ open class LinkerSpec : CommandLineToolSpec, @unchecked Sendable {
return ruleInfo
}

public func inputFileListContents(_ cbc: CommandBuildContext) -> ByteString {
return ByteString(encodingAsUTF8: ResponseFiles.responseFileContents(args: cbc.inputs.map { $0.absolutePath.strWithPosixSlashes }, format: cbc.scope.evaluate(BuiltinMacros.LINKER_FILE_LIST_FORMAT)))
public func inputFileListContents(_ cbc: CommandBuildContext, lookup: ((MacroDeclaration) -> MacroExpression?)? = nil) -> ByteString {
let format = cbc.scope.evaluate(BuiltinMacros.LINKER_FILE_LIST_FORMAT, lookup: lookup)
return ByteString(encodingAsUTF8: ResponseFiles.responseFileContents(args: cbc.inputs.map { $0.absolutePath.strWithPosixSlashes }, format: format))
}

open override func constructTasks(_ cbc: CommandBuildContext, _ delegate: any TaskGenerationDelegate) async {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ private final class EnumBuildOptionType : BuildOptionType {
return try namespace.declareEnumMacro(name) as EnumMacroDeclaration<SwiftAPIDigesterMode>
case "LINKER_FILE_LIST_FORMAT":
return try namespace.declareEnumMacro(name) as EnumMacroDeclaration<ResponseFileFormat>
case "LIBTOOL_FILE_LIST_FORMAT":
return try namespace.declareEnumMacro(name) as EnumMacroDeclaration<ResponseFileFormat>
case "LINKER_RESPONSE_FILE_FORMAT":
return try namespace.declareEnumMacro(name) as EnumMacroDeclaration<ResponseFileFormat>
case "DOCC_MINIMUM_ACCESS_LEVEL":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ public final class LdLinkerSpec : GenericLinkerSpec, SpecIdentifierType, @unchec
let fileListPath = cbc.scope.evaluate(BuiltinMacros.__INPUT_FILE_LIST_PATH__, lookup: linkerDriverLookup)
if !fileListPath.isEmpty {
let fileListPath = fileListPath
cbc.producer.writeFileSpec.constructFileTasks(CommandBuildContext(producer: cbc.producer, scope: cbc.scope, inputs: [], output: fileListPath), delegate, contents: inputFileListContents(cbc), permissions: nil, preparesForIndexing: false, additionalTaskOrderingOptions: [.immediate, .ignorePhaseOrdering])
cbc.producer.writeFileSpec.constructFileTasks(CommandBuildContext(producer: cbc.producer, scope: cbc.scope, inputs: [], output: fileListPath), delegate, contents: inputFileListContents(cbc, lookup: linkerDriverLookup), permissions: nil, preparesForIndexing: false, additionalTaskOrderingOptions: [.immediate, .ignorePhaseOrdering])
inputPaths.append(fileListPath)
}

Expand Down Expand Up @@ -1655,6 +1655,11 @@ public final class LibtoolLinkerSpec : GenericLinkerSpec, SpecIdentifierType, @u
return resolveExecutablePath(producer, lookupPath)
}

public override func inputFileListContents(_ cbc: CommandBuildContext, lookup: ((MacroDeclaration) -> MacroExpression?)? = nil) -> ByteString {
let format = cbc.scope.evaluate(BuiltinMacros.LIBTOOL_FILE_LIST_FORMAT, lookup: lookup)
return ByteString(encodingAsUTF8: ResponseFiles.responseFileContents(args: cbc.inputs.map { $0.absolutePath.strWithPosixSlashes }, format: format))
}

static func discoveredCommandLineToolSpecInfo(_ producer: any CommandProducer, _ delegate: any CoreClientTargetDiagnosticProducingDelegate, toolPath: Path) async throws -> DiscoveredLibtoolLinkerToolSpecInfo {
if toolPath.basenameWithoutSuffix == "llvm-lib" || toolPath.basenameWithoutSuffix == "ar" || toolPath.basenameWithoutSuffix.hasSuffix("-ar") {
return DiscoveredLibtoolLinkerToolSpecInfo(toolPath: toolPath, toolVersion: nil)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,11 @@ public final class ProductPackagingToolSpec : GenericCommandLineToolSpec, SpecId
}

// Create the task action, and then the task.
let action = delegate.taskActionCreationDelegate.createProcessProductEntitlementsTaskAction(scope: cbc.scope, mergedEntitlements: entitlements, entitlementsVariant: entitlementsVariant, destinationPlatformName: platform.name, entitlementsFilePath: codeSignEntitlementsInput?.absolutePath, fs: fs)
let action = delegate.taskActionCreationDelegate.createProcessProductEntitlementsTaskAction(mergedEntitlements: entitlements, entitlementsVariant: entitlementsVariant, allowEntitlementsModification: cbc.scope.evaluate(BuiltinMacros.CODE_SIGN_ALLOW_ENTITLEMENTS_MODIFICATION), entitlementsDestination: cbc.scope.evaluate(BuiltinMacros.ENTITLEMENTS_DESTINATION), destinationPlatformName: platform.name, entitlementsFilePath: codeSignEntitlementsInput?.absolutePath, fs: fs)
// The action records a timestamp representing the last modification date of the entitlements file, so changes to the input must invalidate the build description.
if let path = codeSignEntitlementsInput?.absolutePath {
delegate.access(path: path)
}

delegate.createTask(type: self, ruleInfo: ["ProcessProductPackaging", codeSignEntitlementsInput?.absolutePath.str ?? "", outputPath.str], commandLine: commandLine, additionalOutput: additionalOutput, environment: environmentFromSpec(cbc, delegate), workingDirectory: cbc.producer.defaultWorkingDirectory, inputs: inputs.map(\.absolutePath), outputs: [ outputPath ], action: action, execDescription: resolveExecutionDescription(cbc, delegate), enableSandboxing: enableSandboxing)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public final class SetAttributesSpec: CommandLineToolSpec, SpecImplementationTyp
execDescription = "Set Group"
}

let args = [cbc.scope.evaluate(BuiltinMacros.CHOWN).str, "-RH", attrs, input.absolutePath.str]
let args = [resolveExecutablePath(cbc.producer, cbc.scope.evaluate(BuiltinMacros.CHOWN)).str, "-RH", attrs, input.absolutePath.str]

let commandOutput = delegate.createVirtualNode("SetOwner \(input.absolutePath.str)")
let outputs: [any PlannedNode] = [delegate.createNode(input.absolutePath), commandOutput]
Expand Down
2 changes: 1 addition & 1 deletion Sources/SWBCore/Specs/NativeBuildSystem.xcspec
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ When `GENERATE_INFOPLIST_FILE` is enabled, sets the value of the [CFBundleExecut
},
{ Name = CHOWN;
Type = Path;
DefaultValue = "/usr/sbin/chown";
DefaultValue = "chown";
},
{ Name = CHMOD;
Type = Path;
Expand Down
1 change: 0 additions & 1 deletion Sources/SWBGenericUnixPlatform/Plugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ struct GenericUnixSDKRegistryExtension: SDKRegistryExtension {
"GENERATE_TEXT_BASED_STUBS": "NO",
"GENERATE_INTERMEDIATE_TEXT_BASED_STUBS": "NO",

"CHOWN": "/usr/bin/chown",
"AR": "llvm-ar",
]
default:
Expand Down
3 changes: 2 additions & 1 deletion Sources/SWBGenericUnixPlatform/Specs/UnixLibtool.xcspec
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,11 @@
DefaultValue = YES;
},
{
Name = "LINKER_FILE_LIST_FORMAT";
Name = "LIBTOOL_FILE_LIST_FORMAT";
Type = Enumeration;
Values = (
unescapedNewlineSeparated,
unixShellQuotedSpaceSeparated,
unixShellQuotedNewlineSeparated,
windowsShellQuotedNewlineSeparated,
);
Expand Down
9 changes: 6 additions & 3 deletions Sources/SWBMacro/MacroConfigFileParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

public import SWBUtil
import Foundation
import Synchronization

private extension UInt8 {
var isASCIISpace: Bool {
Expand All @@ -35,6 +36,7 @@ public final class MacroConfigFileParser {

/// The path to the xcconfig file being parsed, for diagnostic purposes.
public let path: Path
private let pathRef: OrderedSet<Path>.Index

/// Current index into the UTF-8 byte sequence that’s being parsed. Starts at zero. All meaningful characters are in the ASCII range, which is what lets us do this optimization.
var currIdx: Int
Expand All @@ -57,6 +59,7 @@ public final class MacroConfigFileParser {
self.delegate = delegate
self.bytes = byteString.bytes
self.path = path
self.pathRef = MacroValueAssignment.macroConfigPaths.withLock({ $0.append(path).index })
self.currIdx = 0
self.currLine = 1
}
Expand Down Expand Up @@ -399,7 +402,7 @@ public final class MacroConfigFileParser {
}
// Finally, now that we have the name, conditions, and value, we tell the delegate about it.
let value = chunks.joined(separator: " ")
delegate?.foundMacroValueAssignment(name, conditions: conditions, value: value, path: path, startLine: startLine, endLine: currLine, startColumn: startColumn, endColumn: currIdx - startOfLine, parser: self)
delegate?.foundMacroValueAssignment(name, conditions: conditions, value: value, path: path, pathRef: pathRef, startLine: startLine, endLine: currLine, startColumn: startColumn, endColumn: currIdx - startOfLine, parser: self)
}

public func parseNonListAssignmentRHS() -> String? {
Expand Down Expand Up @@ -538,7 +541,7 @@ public final class MacroConfigFileParser {
}
func endPreprocessorInclusion() {
}
func foundMacroValueAssignment(_ macroName: String, conditions: [(param: String, pattern: String)], value: String, path: Path, startLine: Int, endLine: Int, startColumn: Int, endColumn: Int, parser: MacroConfigFileParser) {
func foundMacroValueAssignment(_ macroName: String, conditions: [(param: String, pattern: String)], value: String, path: Path, pathRef: OrderedSet<Path>.Index, startLine: Int, endLine: Int, startColumn: Int, endColumn: Int, parser: MacroConfigFileParser) {
self.macroName = macroName
self.conditions = conditions.isEmpty ? nil : conditions
}
Expand Down Expand Up @@ -585,7 +588,7 @@ public protocol MacroConfigFileParserDelegate {
func endPreprocessorInclusion()

/// Invoked once for each macro value assignment. The `macroName` is guaranteed to be non-empty, but `value` may be empty. Any macro conditions are passed as tuples in the `conditions`; parameters are guaranteed to be non-empty strings, but patterns may be empty.
mutating func foundMacroValueAssignment(_ macroName: String, conditions: [(param: String, pattern: String)], value: String, path: Path, startLine: Int, endLine: Int, startColumn: Int, endColumn: Int, parser: MacroConfigFileParser)
mutating func foundMacroValueAssignment(_ macroName: String, conditions: [(param: String, pattern: String)], value: String, path: Path, pathRef: OrderedSet<Path>.Index, startLine: Int, endLine: Int, startColumn: Int, endColumn: Int, parser: MacroConfigFileParser)

/// Invoked if an error, warning, or other diagnostic is detected.
func handleDiagnostic(_ diagnostic: MacroConfigFileDiagnostic, parser: MacroConfigFileParser)
Expand Down
2 changes: 1 addition & 1 deletion Sources/SWBMacro/MacroEvaluationScope.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ private extension MacroValueAssignmentTable {
func lookupMacro(_ macro: MacroDeclaration, overrideLookup: ((MacroDeclaration) -> MacroExpression?)? = nil) -> MacroValueAssignment? {
// See if we have an overriding binding.
if let override = overrideLookup?(macro) {
return MacroValueAssignment(expression: override, conditions: nil, next: lookupMacro(macro), location: nil)
return MacroValueAssignment(expression: override, conditions: nil, next: lookupMacro(macro), locationRef: nil)
}

// Otherwise, return the normal lookup.
Expand Down
Loading