File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -508,15 +508,19 @@ public final class ToolchainRegistry: @unchecked Sendable {
508508 /// Look up the toolchain with the given identifier.
509509 public func lookup( _ identifier: String ) -> Toolchain ? {
510510 let lowercasedIdentifier = identifier. lowercased ( )
511- if [ " default " , " xcode " ] . contains ( lowercasedIdentifier ) {
512- if hostOperatingSystem == . macOS {
511+ if hostOperatingSystem == . macOS {
512+ if [ " default " , " xcode " ] . contains ( lowercasedIdentifier ) {
513513 return toolchainsByIdentifier [ ToolchainRegistry . defaultToolchainIdentifier] ?? toolchainsByAlias [ lowercasedIdentifier]
514514 } else {
515- // On non-Darwin, assume if there is only one registered toolchain, it is the default.
516- return toolchainsByIdentifier [ ToolchainRegistry . defaultToolchainIdentifier] ?? toolchainsByAlias [ lowercasedIdentifier] ?? toolchainsByIdentifier. values. only
515+ return toolchainsByIdentifier [ identifier] ?? toolchainsByAlias [ lowercasedIdentifier]
517516 }
518517 } else {
519- return toolchainsByIdentifier [ identifier] ?? toolchainsByAlias [ lowercasedIdentifier]
518+ // On non-Darwin, assume if there is only one registered toolchain, it is the default.
519+ if [ " default " , " xcode " ] . contains ( lowercasedIdentifier) || identifier == ToolchainRegistry . defaultToolchainIdentifier {
520+ return toolchainsByIdentifier [ ToolchainRegistry . defaultToolchainIdentifier] ?? toolchainsByAlias [ lowercasedIdentifier] ?? toolchainsByIdentifier. values. only
521+ } else {
522+ return toolchainsByIdentifier [ identifier] ?? toolchainsByAlias [ lowercasedIdentifier]
523+ }
520524 }
521525 }
522526
You can’t perform that action at this time.
0 commit comments