Skip to content

PrebuiltModuleGen: add an option for skipping the job execution #610

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
Apr 22, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Sources/swift-build-sdk-interfaces/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ let coreMode = CommandLine.arguments.contains("-core")
/// Verbose to print more info
let verbose = CommandLine.arguments.contains("-v")

/// Skip executing the jobs
let skipExecution = CommandLine.arguments.contains("-n")

do {
let sdkPath = try VirtualPath(path: sdkPathRaw).absolutePath!
if !localFileSystem.exists(sdkPath) {
Expand Down Expand Up @@ -117,6 +120,15 @@ do {
executor: executor,
compilerExecutableDir: swiftcPath.parentDirectory)
let (jobs, danglingJobs) = try driver.generatePrebuitModuleGenerationJobs(with: inputMap, into: outputDir, exhaustive: !coreMode)
if verbose {
Driver.stdErrQueue.sync {
stderrStream <<< "job count: \(jobs.count + danglingJobs.count)\n"
stderrStream.flush()
}
}
if skipExecution {
exit(0)
}
let delegate = PrebuitModuleGenerationDelegate(jobs, diagnosticsEngine, verbose)
do {
try executor.execute(workload: DriverExecutorWorkload.init(jobs, nil, continueBuildingAfterErrors: true),
Expand Down