Skip to content

Commit 459d652

Browse files
committed
Address review feedback
1 parent 39372f4 commit 459d652

File tree

5 files changed

+24
-10
lines changed

5 files changed

+24
-10
lines changed

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ let package = Package(
154154
.product(name: "SwiftToolsSupport-auto", package: "swift-tools-support-core"),
155155
.product(name: "SystemPackage", package: "swift-system"),
156156
],
157-
exclude: ["CMakeLists.txt"]
157+
exclude: ["CMakeLists.txt", "Vendor/README.md"]
158158
),
159159

160160
.target(

Sources/Basics/Vendor/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# README
2+
3+
The Triple.swift and Triple+Platform.swift files in this directory have been
4+
vendored from SwiftDriver. The purpose of this approach is to avoid
5+
introducing a dependency on Driver in the "data model" section of SwiftPM,
6+
which could currently lead to complications with the Xcode integration.
7+
8+
In the long term, our goal is to consolidate this code into a shared
9+
implementation that can be utilized by both SwiftPM and SwiftDriver through a
10+
package. However, until we reach that point, it is important to keep the files
11+
in this directory up to date by incorporating any relevant additions from the
12+
original copies.
13+
14+
Moreover, it is crucial to note that any modifications made to these files
15+
should be first applied to the original files in SwiftDriver, and then copied
16+
over to this directory to maintain synchronization.

Sources/Basics/Vendor/Triple+Platforms.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
//===----------------------------------------------------------------------===//
1414
//
1515
// Warning: This file has been copied with minimal modifications from
16-
// swift-driver to avoid a direct dependency (for now). Any modification to this
17-
// file, must first be made in the original file, then copied here.
16+
// swift-driver to avoid a direct dependency. See Vendor/README.md for details.
1817
//
1918
// Changes:
2019
// - Replaced usage of `\(_:or:)` string interpolation.

Sources/Basics/Vendor/Triple.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
//===----------------------------------------------------------------------===//
1414
//
1515
// Warning: This file has been copied with minimal modifications from
16-
// swift-driver to avoid a direct dependency (for now). Any modification to this
17-
// file, must first be made in the original file, then copied here.
16+
// swift-driver to avoid a direct dependency. See Vendor/README.md for details.
1817
//
1918
// Changes:
2019
// - Replaced usage of `\(_:or:)` string interpolation.

Sources/PackageModel/UserToolchain.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -716,32 +716,32 @@ public final class UserToolchain: Toolchain {
716716
// (~5.7), we always had a singular installed SDK. Prefer the
717717
// new variant which has an architecture subdirectory in `bin`
718718
// if available.
719-
switch triple.archName.lowercased() {
720-
case "x86_64", "x86_64h":
719+
switch triple.arch { // Name.lowercased() {
720+
case .x86_64: // amd64 x86_64 x86_64h
721721
let path: AbsolutePath =
722722
xctest.appending("usr")
723723
.appending("bin64")
724724
if localFileSystem.exists(path) {
725725
return path
726726
}
727727

728-
case "i686":
728+
case .x86: // i386 i486 i586 i686 i786 i886 i986
729729
let path: AbsolutePath =
730730
xctest.appending("usr")
731731
.appending("bin32")
732732
if localFileSystem.exists(path) {
733733
return path
734734
}
735735

736-
case "armv7":
736+
case .arm: // armv7 and many more
737737
let path: AbsolutePath =
738738
xctest.appending("usr")
739739
.appending("bin32a")
740740
if localFileSystem.exists(path) {
741741
return path
742742
}
743743

744-
case "arm64":
744+
case .aarch64: // aarch6 arm64
745745
let path: AbsolutePath =
746746
xctest.appending("usr")
747747
.appending("bin64a")

0 commit comments

Comments
 (0)