Skip to content

Move Triple to TSCUtility #117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 24, 2020
Merged

Conversation

neonichu
Copy link
Contributor

We need to use Triple in SwiftPM's ManifestLoader as part of some upcoming changes and that requires moving it here.

We need to use `Triple` in SwiftPM's `ManifestLoader` as part of some
upcoming changes and that requires moving it here.
@neonichu
Copy link
Contributor Author

@swift-ci please test


public enum OS: String, Encodable, CaseIterable {
case darwin
case macOS = "macosx"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ಠ_ಠ

return self.tripleString + version
}

public static let macOS = try! Triple("x86_64-apple-macosx")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just being moved over from SwiftPM, right? Eventually we'll need to fix this. If it's new code, then we should fix it from the start.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yah, it's just being moved over. Fix it in what sense?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant to not include the hardcoded architecture.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, that's only being used for this fallback case anyway: https://github.com/apple/swift-package-manager/blob/master/Sources/SPMBuildCore/Triple.swift#L147-L150

I think we can probably remove that at this point and this static member with it, but I'd like to be conservative for now since this will need to end up in a 5.3.x release.

@neonichu neonichu merged commit 32a1836 into swiftlang:master Aug 24, 2020
@neonichu neonichu deleted the move-triple branch August 24, 2020 23:29
@compnerd
Copy link
Member

I seem to be seeing this after this change:

FAILED: lib/libBuild.so Sources/Build/CMakeFiles/Build.dir/BuildDelegate.swift.o Sources/Build/CMakeFiles/Build.dir/BuildOperation.swift.o Sources/Build/CMakeFiles/Build.dir/BuildPlan.swift.o Sources/Build/CMakeFiles/Build.dir/ManifestBuilder.swift.o Sources/Build/CMakeFiles/Build.dir/SwiftCompilerOutputParser.swift.o Sources/Build/CMakeFiles/Build.dir/XCFrameworkInfo.swift.o swift/Build.swiftmodule 
: && /home/ci/AzureAgent/_work/25/toolchain-linux-x64/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc -output-file-map Sources/Build/CMakeFiles/Build.dir/output-file-map.json -incremental -num-threads 16 -emit-library -o lib/libBuild.so -module-name Build -module-link-name Build -emit-module -emit-module-path swift/Build.swiftmodule -emit-dependencies -DBuild_EXPORTS -resource-dir /home/ci/AzureAgent/_work/25/sdk-linux-x64/Library/Developer/Platforms/Linux.platform/Developer/SDKs/Linux.sdk/usr/lib/swift -use-ld=lld   -swift-version 5 -Xcc -I -I swift -I /home/ci/AzureAgent/_work/25/a/tsc/swift -I /home/ci/AzureAgent/_work/25/s/swift-tools-support-core/Sources/TSCclibc/include -I /home/ci/AzureAgent/_work/25/a/llbuild/products/llbuildSwift -I /home/ci/AzureAgent/_work/25/s/swift-llbuild/products/libllbuild/include -I /home/ci/AzureAgent/_work/25/s/Yams/Sources/CYaml/include -I /home/ci/AzureAgent/_work/25/b/Yams/swift -I /home/ci/AzureAgent/_work/25/b/swift-driver/swift /home/ci/AzureAgent/_work/25/s/swift-package-manager/Sources/Build/BuildDelegate.swift /home/ci/AzureAgent/_work/25/s/swift-package-manager/Sources/Build/BuildOperation.swift /home/ci/AzureAgent/_work/25/s/swift-package-manager/Sources/Build/BuildPlan.swift /home/ci/AzureAgent/_work/25/s/swift-package-manager/Sources/Build/ManifestBuilder.swift /home/ci/AzureAgent/_work/25/s/swift-package-manager/Sources/Build/SwiftCompilerOutputParser.swift /home/ci/AzureAgent/_work/25/s/swift-package-manager/Sources/Build/XCFrameworkInfo.swift  -Xlinker -soname -Xlinker libBuild.so -L /home/ci/AzureAgent/_work/25/a/spm/lib  -L /home/ci/AzureAgent/_work/25/a/spm/lib  -L /home/ci/AzureAgent/_work/25/b/swift-driver/lib  -L /home/ci/AzureAgent/_work/25/a/spm/lib  -L /home/ci/AzureAgent/_work/25/a/spm/lib  -L /home/ci/AzureAgent/_work/25/a/spm/lib  -L /home/ci/AzureAgent/_work/25/a/spm/lib  -L /home/ci/AzureAgent/_work/25/a/spm/lib  -L /home/ci/AzureAgent/_work/25/b/Yams/lib  -L /home/ci/AzureAgent/_work/25/b/Yams/lib  -L /home/ci/AzureAgent/_work/25/a/tsc/lib  -L /home/ci/AzureAgent/_work/25/b/swift-driver/lib  -L /home/ci/AzureAgent/_work/25/a/tsc/lib  -L /home/ci/AzureAgent/_work/25/a/tsc/lib  -L /home/ci/AzureAgent/_work/25/a/tsc/lib  -L /home/ci/AzureAgent/_work/25/a/llbuild/lib  -L /home/ci/AzureAgent/_work/25/a/llbuild/lib  -L /usr/lib/gcc/x86_64-linux-gnu/7.4.0  -L /home/ci/AzureAgent/_work/25/toolchain-linux-x64/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/lib lib/libLLBuildManifest.so lib/libSPMBuildCore.so /home/ci/AzureAgent/_work/25/b/swift-driver/lib/libSwiftDriver.so lib/libPackageGraph.so lib/libPackageLoading.so lib/libSPMLLBuild.so lib/libPackageModel.so lib/libSourceControl.so /home/ci/AzureAgent/_work/25/b/Yams/lib/libCYaml.so /home/ci/AzureAgent/_work/25/b/Yams/lib/libYams.so /home/ci/AzureAgent/_work/25/a/tsc/lib/libTSCUtility.so -lFoundationNetworking /home/ci/AzureAgent/_work/25/b/swift-driver/lib/libSwiftOptions.so /home/ci/AzureAgent/_work/25/a/tsc/lib/libTSCBasic.so /home/ci/AzureAgent/_work/25/a/tsc/lib/libTSCLibc.so /home/ci/AzureAgent/_work/25/a/tsc/lib/libTSCclibc.a -lFoundation /home/ci/AzureAgent/_work/25/a/llbuild/lib/libllbuildSwift.so /home/ci/AzureAgent/_work/25/a/llbuild/lib/libllbuild.so -lgcc -lgcc_s -lc -lgcc -lgcc_s && :
/home/ci/AzureAgent/_work/25/s/swift-package-manager/Sources/Build/BuildPlan.swift:1896:23: error: 'Triple' is ambiguous for type lookup in this context
fileprivate extension Triple.OS {
                      ^~~~~~
/home/ci/AzureAgent/_work/25/s/swift-tools-support-core/Sources/TSCUtility/Triple.swift:21:15: note: found this candidate
public struct Triple: Encodable, Equatable {
              ^
/home/ci/AzureAgent/_work/25/s/swift-package-manager/Sources/SPMBuildCore/Triple.swift:21:15: note: found this candidate
public struct Triple: Encodable, Equatable {
              ^
ninja: build stopped: subcommand failed.

Is there supposed to be an associated s-p-m change?

compnerd added a commit to swiftlang/swift-package-manager that referenced this pull request Aug 25, 2020
Remove `Triple.swift` as tools-support-core now has this defined.  This repairs the CMake based build.
@compnerd
Copy link
Member

swiftlang/swift-package-manager#2885 should hopefully address it

compnerd added a commit to swiftlang/swift-package-manager that referenced this pull request Aug 25, 2020
Remove Triple.swift as tools-support-core now has this defined.

```
/Users/buildnode/jenkins/workspace/swift-package-manager-with-xcode-self-hosted-PR-osx/branch-master/swiftpm/Sources/Build/BuildPlan.swift:1896:23: error: 'Triple' is ambiguous for type lookup in this context
fileprivate extension Triple.OS {
                      ^~~~~~
/Users/buildnode/jenkins/workspace/swift-package-manager-with-xcode-self-hosted-PR-osx/branch-master/swiftpm/.build/checkouts/swift-tools-support-core/Sources/TSCUtility/Triple.swift:21:15: note: found this candidate
public struct Triple: Encodable, Equatable {
              ^
/Users/buildnode/jenkins/workspace/swift-package-manager-with-xcode-self-hosted-PR-osx/branch-master/swiftpm/Sources/SPMBuildCore/Triple.swift:21:15: note: found this candidate
public struct Triple: Encodable, Equatable {
              ^
```
compnerd added a commit to swiftlang/swift-package-manager that referenced this pull request Aug 25, 2020
Remove Triple.swift as tools-support-core now has this defined.

```
/Users/buildnode/jenkins/workspace/swift-package-manager-with-xcode-self-hosted-PR-osx/branch-master/swiftpm/Sources/Build/BuildPlan.swift:1896:23: error: 'Triple' is ambiguous for type lookup in this context
fileprivate extension Triple.OS {
                      ^~~~~~
/Users/buildnode/jenkins/workspace/swift-package-manager-with-xcode-self-hosted-PR-osx/branch-master/swiftpm/.build/checkouts/swift-tools-support-core/Sources/TSCUtility/Triple.swift:21:15: note: found this candidate
public struct Triple: Encodable, Equatable {
              ^
/Users/buildnode/jenkins/workspace/swift-package-manager-with-xcode-self-hosted-PR-osx/branch-master/swiftpm/Sources/SPMBuildCore/Triple.swift:21:15: note: found this candidate
public struct Triple: Encodable, Equatable {
              ^
```
compnerd added a commit to swiftlang/swift-package-manager that referenced this pull request Aug 25, 2020
Remove Triple.swift as tools-support-core now has this defined.

```
/Users/buildnode/jenkins/workspace/swift-package-manager-with-xcode-self-hosted-PR-osx/branch-master/swiftpm/Sources/Build/BuildPlan.swift:1896:23: error: 'Triple' is ambiguous for type lookup in this context
fileprivate extension Triple.OS {
                      ^~~~~~
/Users/buildnode/jenkins/workspace/swift-package-manager-with-xcode-self-hosted-PR-osx/branch-master/swiftpm/.build/checkouts/swift-tools-support-core/Sources/TSCUtility/Triple.swift:21:15: note: found this candidate
public struct Triple: Encodable, Equatable {
              ^
/Users/buildnode/jenkins/workspace/swift-package-manager-with-xcode-self-hosted-PR-osx/branch-master/swiftpm/Sources/SPMBuildCore/Triple.swift:21:15: note: found this candidate
public struct Triple: Encodable, Equatable {
              ^
```
compnerd added a commit to swiftlang/swift-package-manager that referenced this pull request Aug 25, 2020
Remove Triple.swift as tools-support-core now has this defined.

```
/Users/buildnode/jenkins/workspace/swift-package-manager-with-xcode-self-hosted-PR-osx/branch-master/swiftpm/Sources/Build/BuildPlan.swift:1896:23: error: 'Triple' is ambiguous for type lookup in this context
fileprivate extension Triple.OS {
                      ^~~~~~
/Users/buildnode/jenkins/workspace/swift-package-manager-with-xcode-self-hosted-PR-osx/branch-master/swiftpm/.build/checkouts/swift-tools-support-core/Sources/TSCUtility/Triple.swift:21:15: note: found this candidate
public struct Triple: Encodable, Equatable {
              ^
/Users/buildnode/jenkins/workspace/swift-package-manager-with-xcode-self-hosted-PR-osx/branch-master/swiftpm/Sources/SPMBuildCore/Triple.swift:21:15: note: found this candidate
public struct Triple: Encodable, Equatable {
              ^
```
compnerd added a commit to swiftlang/swift-package-manager that referenced this pull request Aug 25, 2020
Remove Triple.swift as tools-support-core now has this defined.

```
/Users/buildnode/jenkins/workspace/swift-package-manager-with-xcode-self-hosted-PR-osx/branch-master/swiftpm/Sources/Build/BuildPlan.swift:1896:23: error: 'Triple' is ambiguous for type lookup in this context
fileprivate extension Triple.OS {
                      ^~~~~~
/Users/buildnode/jenkins/workspace/swift-package-manager-with-xcode-self-hosted-PR-osx/branch-master/swiftpm/.build/checkouts/swift-tools-support-core/Sources/TSCUtility/Triple.swift:21:15: note: found this candidate
public struct Triple: Encodable, Equatable {
              ^
/Users/buildnode/jenkins/workspace/swift-package-manager-with-xcode-self-hosted-PR-osx/branch-master/swiftpm/Sources/SPMBuildCore/Triple.swift:21:15: note: found this candidate
public struct Triple: Encodable, Equatable {
              ^
```
compnerd added a commit to swiftlang/swift-package-manager that referenced this pull request Aug 25, 2020
Remove Triple.swift as tools-support-core now has this defined.

```
/Users/buildnode/jenkins/workspace/swift-package-manager-with-xcode-self-hosted-PR-osx/branch-master/swiftpm/Sources/Build/BuildPlan.swift:1896:23: error: 'Triple' is ambiguous for type lookup in this context
fileprivate extension Triple.OS {
                      ^~~~~~
/Users/buildnode/jenkins/workspace/swift-package-manager-with-xcode-self-hosted-PR-osx/branch-master/swiftpm/.build/checkouts/swift-tools-support-core/Sources/TSCUtility/Triple.swift:21:15: note: found this candidate
public struct Triple: Encodable, Equatable {
              ^
/Users/buildnode/jenkins/workspace/swift-package-manager-with-xcode-self-hosted-PR-osx/branch-master/swiftpm/Sources/SPMBuildCore/Triple.swift:21:15: note: found this candidate
public struct Triple: Encodable, Equatable {
              ^
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants