Skip to content

Commit 0fc8f73

Browse files
committed
Deprecate enablement of explicit modules with an environment variable
1 parent e500fe7 commit 0fc8f73

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

Sources/SwiftDriver/Jobs/Job.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,11 @@ public struct Job: Codable, Equatable, Hashable {
9696
public var outputs: [TypedVirtualPath]
9797

9898
/// Any extra environment variables which should be set while running the job.
99-
public var extraEnvironment: ProcessEnvironmentBlock
99+
@available(*, deprecated, message: "use extraEnvironmentBlock")
100+
public var extraEnvironment: [String: String]
101+
102+
/// Any extra environment variables which should be set while running the job.
103+
public var extraEnvironmentBlock: ProcessEnvironmentBlock
100104

101105
/// Whether or not the job must be executed in place, replacing the current driver process.
102106
public var requiresInPlaceExecution: Bool

Sources/SwiftDriver/ToolingInterface/SimpleExecutor.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import typealias TSCBasic.ProcessEnvironmentBlock
3838
let arguments: [String] = try resolver.resolveArgumentList(for: job,
3939
useResponseFiles: .heuristic)
4040
var childEnv = env
41-
childEnv.merge(job.extraEnvironment, uniquingKeysWith: { (_, new) in new })
41+
childEnv.merge(job.extraEnvironmentBlock, uniquingKeysWith: { (_, new) in new })
4242
let process = try Process.launchProcess(arguments: arguments, env: childEnv)
4343
return try process.waitUntilExit()
4444
}

Sources/SwiftDriverExecution/MultiJobExecutor.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ class ExecuteJobRule: LLBuildRule {
584584
let context = self.context
585585
let resolver = context.argsResolver
586586
let job = myJob
587-
let env = context.env.merging(job.extraEnvironment, uniquingKeysWith: { $1 })
587+
let env = context.env.merging(job.extraEnvironmentBlock, uniquingKeysWith: { $1 })
588588

589589
let value: DriverBuildValue
590590
var pendingFinish = false

Sources/SwiftDriverExecution/SwiftDriverExecutor.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ public final class SwiftDriverExecutor: DriverExecutor {
5151
fileSystem: fileSystem)
5252

5353
if job.requiresInPlaceExecution {
54-
for (envVar, value) in job.extraEnvironment {
54+
for (envVar, value) in job.extraEnvironmentBlock {
5555
try ProcessEnv.setVar(envVar.value, value: value)
5656
}
5757

5858
try exec(path: arguments[0], args: arguments)
5959
} else {
6060
var childEnv = env
61-
childEnv.merge(job.extraEnvironment, uniquingKeysWith: { (_, new) in new })
61+
childEnv.merge(job.extraEnvironmentBlock, uniquingKeysWith: { (_, new) in new })
6262
let process : ProcessProtocol
6363
if job.inputs.contains(TypedVirtualPath(file: .standardInput, type: .swift)) {
6464
process = try Process.launchProcessAndWriteInput(

Sources/swift-driver/main.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,6 @@ do {
113113
}
114114
}
115115

116-
if ProcessEnv.block["SWIFT_ENABLE_EXPLICIT_MODULE"] != nil {
117-
CommandLine.arguments.append("-explicit-module-build")
118-
}
119-
120116
let (mode, arguments) = try Driver.invocationRunMode(forArgs: CommandLine.arguments)
121117
if case .subcommand(let subcommand) = mode {
122118
// We are running as a subcommand, try to find the subcommand adjacent to the executable we are running as.

0 commit comments

Comments
 (0)