Skip to content

[Incremental] Relax currency test to fix ci errors #758

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
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,6 @@ extension IncrementalCompilationState {
incrementalOptions: options, buildStartTime: buildStartTime,
buildEndTime: buildEndTime)
}

var buildTimeSpan: ClosedRange<Date> {
buildStartTime...buildEndTime
}
}
}

Expand Down Expand Up @@ -227,10 +223,10 @@ extension IncrementalCompilationState.IncrementalDependencyAndInputSetup {
warning: "Will not do cross-module incremental builds, wrong version of priors; expected \(expected) but read \(read) at '\(dependencyGraphPath)'")
graphIfPresent = nil
}
catch let ModuleDependencyGraph.ReadError.timeTravellingPriors(priorsDate, timeSpan) {
catch let ModuleDependencyGraph.ReadError.timeTravellingPriors(priorsModTime: priorsModTime, buildRecordModTime: buildRecordModTime) {
diagnosticEngine.emit(
warning: "Will not do cross-module incremental builds, priors saved at \(priorsDate), " +
"but the previous build happend from \(timeSpan.lowerBound) to \(timeSpan.upperBound), at '\(dependencyGraphPath)'")
warning: "Will not do cross-module incremental builds, priors saved at \(priorsModTime)), " +
"but the previous build started at \(buildRecordModTime), at '\(dependencyGraphPath)'")
graphIfPresent = nil
}
catch {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ extension ModuleDependencyGraph {
case bogusNameOrContext
case unknownKind
case unknownDependencySourceExtension
case timeTravellingPriors(Date, ClosedRange<Date>)
case timeTravellingPriors(priorsModTime: Date, buildRecordModTime: Date)
}

/// Attempts to read a serialized dependency graph from the given path.
Expand Down Expand Up @@ -809,13 +809,14 @@ extension ModuleDependencyGraph {
fileprivate static func ensurePriorsCreatedDuringPriorBuild(
at path: VirtualPath,
info: IncrementalCompilationState.IncrementalDependencyAndInputSetup) throws {
guard let priorsModTime = try? info.fileSystem.lastModificationTime(for: path)
guard let priorsModTime = try? info.fileSystem.lastModificationTime(for: path),
let buildRecordModTime =
try? info.fileSystem.lastModificationTime(for: info.buildRecordInfo.buildRecordPath)
else {
return
}
let priorBuildTimeSpan = info.buildTimeSpan
guard priorBuildTimeSpan.contains(priorsModTime) else {
throw ReadError.timeTravellingPriors(priorsModTime, priorBuildTimeSpan)
guard info.buildStartTime <= priorsModTime else {
throw ReadError.timeTravellingPriors(priorsModTime: priorsModTime, buildRecordModTime: buildRecordModTime)
}
}
}
Expand Down
1 change: 0 additions & 1 deletion Tests/SwiftDriverTests/IncrementalCompilationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,6 @@ extension IncrementalCompilationTests {
else {
let firstWave = haveGraph ? changedInputs : inputs
let omittedFromFirstWave = haveGraph ? unchangedInputs : []
let forcedInFirstWave = haveGraph ? [] : inputs
schedulingChanged(changedInputs)
maySkip(unchangedInputs)
queuingInitial(firstWave)
Expand Down