File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
Sources/SwiftDriver/Driver Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -2347,7 +2347,8 @@ extension Driver {
2347
2347
}
2348
2348
2349
2349
var appliesToFetchingTargetInfo : Bool {
2350
- return overridePath? . basename != " Python "
2350
+ return overridePath? . basename != " Python " &&
2351
+ overridePath? . basename != " python3 "
2351
2352
}
2352
2353
func setUpForTargetInfo( _ toolchain: Toolchain ) {
2353
2354
if !appliesToFetchingTargetInfo {
Original file line number Diff line number Diff line change @@ -23,6 +23,10 @@ private func bundleRoot() -> AbsolutePath {
23
23
24
24
private let packageDirectory = AbsolutePath ( #file) . parentDirectory. parentDirectory. parentDirectory
25
25
26
+ // The "default" here means lit.py will be invoked as an executable, while otherwise let's use
27
+ // python 3 explicitly.
28
+ private let pythonExec = ProcessEnv . vars. keys. contains ( " SWIFT_DRIVER_INTEGRATION_TESTS_USE_PYTHON_DEFAULT " ) ? " " : " python3 "
29
+
26
30
func makeDriverSymlinks(
27
31
in tempDir: AbsolutePath ,
28
32
with swiftBuildDir: AbsolutePath ? = nil
@@ -207,6 +211,7 @@ final class IntegrationTests: IntegrationTestCase {
207
211
" --param " , " swift_driver " ,
208
212
testDir. pathString
209
213
]
214
+ let commandArgs = pythonExec. isEmpty ? args : [ pythonExec] + args
210
215
211
216
let extraEnv = [
212
217
" SWIFT " : swift. pathString,
@@ -215,10 +220,10 @@ final class IntegrationTests: IntegrationTestCase {
215
220
" LC_ALL " : " en_US.UTF-8 "
216
221
]
217
222
218
- printCommand ( args: args , extraEnv: extraEnv)
223
+ printCommand ( args: commandArgs , extraEnv: extraEnv)
219
224
220
225
let process = TSCBasic . Process (
221
- arguments: args ,
226
+ arguments: commandArgs ,
222
227
environment: ProcessEnv . vars. merging ( extraEnv) { $1 } ,
223
228
outputRedirection: . none
224
229
)
You can’t perform that action at this time.
0 commit comments