From b69b6cb5baebc8aba6642ed62c6cbd4b1c1f9c44 Mon Sep 17 00:00:00 2001 From: Boris Buegling Date: Wed, 12 Apr 2023 20:51:45 -0700 Subject: [PATCH 1/2] Potential workaround for a CI issue The macOS CI does not seem to work with Xcode 14.2 as superior, hitting ``` error: Error Domain=NSCocoaErrorDomain Code=4 "The file "swiftpm" doesn't exist." UserInfo={NSFilePath=/Users/ec2-user/jenkins/workspace/pr-swift-tools-support-core-macos/branch-main/swift-tools-support-core/Utilities/ci.xcworkspace/xcshareddata/swiftpm, NSUnderlyingError=0x600000a5a310 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}} ``` I have a theory that this is triggered by us using a workspace that does not contain a resolved file, but that case works for me with SwiftPM 5.9 locally, so not sure. --- .../xcshareddata/swiftpm/Package.resolved | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 Utilities/ci.xcworkspace/xcshareddata/swiftpm/Package.resolved diff --git a/Utilities/ci.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Utilities/ci.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 00000000..f7e90ace --- /dev/null +++ b/Utilities/ci.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,79 @@ +{ + "object": { + "pins": [ + { + "package": "IndexStoreDB", + "repositoryURL": "https://github.com/apple/indexstore-db.git", + "state": { + "branch": "main", + "revision": "89ec16c2ac1bb271614e734a2ee792224809eb20", + "version": null + } + }, + { + "package": "swift-asn1", + "repositoryURL": "https://github.com/apple/swift-asn1.git", + "state": { + "branch": null, + "revision": "805deae27a7506dcad043604c00a9dc52d465dcb", + "version": "0.7.0" + } + }, + { + "package": "swift-certificates", + "repositoryURL": "https://github.com/apple/swift-certificates.git", + "state": { + "branch": null, + "revision": "54b9711034c0bd9b18f9ac0fb262d493130bcf13", + "version": "0.1.0" + } + }, + { + "package": "swift-collections", + "repositoryURL": "https://github.com/apple/swift-collections.git", + "state": { + "branch": null, + "revision": "937e904258d22af6e447a0b72c0bc67583ef64a2", + "version": "1.0.4" + } + }, + { + "package": "swift-crypto", + "repositoryURL": "https://github.com/apple/swift-crypto.git", + "state": { + "branch": null, + "revision": "da0fe44138ab86e380f40a2acbd8a611b07d3f64", + "version": "2.4.0" + } + }, + { + "package": "llbuild", + "repositoryURL": "https://github.com/apple/swift-llbuild.git", + "state": { + "branch": "main", + "revision": "4cc1ea448e236c2f4dfe622cec786bce4bd56c45", + "version": null + } + }, + { + "package": "SwiftSyntax", + "repositoryURL": "https://github.com/apple/swift-syntax.git", + "state": { + "branch": "main", + "revision": "2d5575b8771c5ccd5673428d959085ddb74dbbf7", + "version": null + } + }, + { + "package": "swift-system", + "repositoryURL": "https://github.com/apple/swift-system.git", + "state": { + "branch": null, + "revision": "836bc4557b74fe6d2660218d56e3ce96aff76574", + "version": "1.1.1" + } + } + ] + }, + "version": 1 +} From e5becf915cda1863e57a85643b7d7a90e6e5992c Mon Sep 17 00:00:00 2001 From: Boris Buegling Date: Wed, 12 Apr 2023 21:49:39 -0700 Subject: [PATCH 2/2] Use python 3 macOS 12 comes with updated python. --- Tests/TSCBasicTests/ProcessTests.swift | 7 +------ Tests/TSCBasicTests/processInputs/deadlock-if-blocking-io | 2 +- Tests/TSCBasicTests/processInputs/in-to-out | 2 +- Tests/TSCBasicTests/processInputs/long-stdout-stderr | 2 +- Tests/TSCBasicTests/processInputs/simple-stdout-stderr | 2 +- 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/Tests/TSCBasicTests/ProcessTests.swift b/Tests/TSCBasicTests/ProcessTests.swift index cb5f98df..5c63ecf1 100644 --- a/Tests/TSCBasicTests/ProcessTests.swift +++ b/Tests/TSCBasicTests/ProcessTests.swift @@ -466,12 +466,7 @@ class ProcessTests: XCTestCase { fileprivate extension Process { private static func env() -> [String:String] { - var env = ProcessEnv.vars - #if os(macOS) - // Many of these tests use Python which might not be in the default `PATH` when running these tests from Xcode. - env["PATH"] = "\(env["PATH"] ?? ""):/usr/local/bin" - #endif - return env + return ProcessEnv.vars } private static func script(_ name: String) -> String { diff --git a/Tests/TSCBasicTests/processInputs/deadlock-if-blocking-io b/Tests/TSCBasicTests/processInputs/deadlock-if-blocking-io index 88ad54d0..9bc79efe 100755 --- a/Tests/TSCBasicTests/processInputs/deadlock-if-blocking-io +++ b/Tests/TSCBasicTests/processInputs/deadlock-if-blocking-io @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import sys diff --git a/Tests/TSCBasicTests/processInputs/in-to-out b/Tests/TSCBasicTests/processInputs/in-to-out index 3b86f0d9..94490b16 100755 --- a/Tests/TSCBasicTests/processInputs/in-to-out +++ b/Tests/TSCBasicTests/processInputs/in-to-out @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import sys diff --git a/Tests/TSCBasicTests/processInputs/long-stdout-stderr b/Tests/TSCBasicTests/processInputs/long-stdout-stderr index d630a026..684fcca5 100755 --- a/Tests/TSCBasicTests/processInputs/long-stdout-stderr +++ b/Tests/TSCBasicTests/processInputs/long-stdout-stderr @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import sys diff --git a/Tests/TSCBasicTests/processInputs/simple-stdout-stderr b/Tests/TSCBasicTests/processInputs/simple-stdout-stderr index c4f58949..a840caee 100755 --- a/Tests/TSCBasicTests/processInputs/simple-stdout-stderr +++ b/Tests/TSCBasicTests/processInputs/simple-stdout-stderr @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import sys