Skip to content

[SR-2855] Show inputs mismatch in -driver-show-incremental #5340

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

Conversation

modocache
Copy link
Contributor

SR-2855 suggests -driver-show-incremental not only print information about why certain files are included in incremental compilation, but also print out why incremental compilation may be disabled altogether.

Add a message for one such reason: when the inputs passed to the Swift compiler don't match the ones used previously.

This addresses one part of SR-2855.

inputArgs.insert(inputPair.second->getValue());
}

llvm::StringSet<> missingInputs;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use a SmallVector for this, so that the results come out deterministically!

llvm::StringSet<> missingInputs;
for (auto &previousInput : previousInputs) {
auto previousInputArg = previousInput.getKey();
if(inputArgs.find(previousInputArg) == inputArgs.end()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: missing space after 'if'.

<< "in the current compilation.\n"
<< "\tInputs not included in this compilation:";
for (auto &missing : missingInputs) {
llvm::outs() << " " << missing.getKey();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of the time these are going to be absolute paths, so I suggest putting them on their own lines.

@modocache modocache force-pushed the sr-2855-driver-show-incremental-inputs-mismatch branch from c5cbcb9 to 336d1bc Compare October 18, 2016 20:59
@modocache
Copy link
Contributor Author

@swift-ci please test

// CHECK-INCREMENTAL: Queuing main.swift (initial)

// RUN: cd %t && %swiftc_driver -driver-use-frontend-path %S/Inputs/update-dependencies.py -c ./main.swift -module-name main -incremental -v -driver-show-incremental -output-file-map %t/output.json | %FileCheck --check-prefix CHECK-INPUTS-MISMATCH %s
// CHECK-INPUTS-MISMATCH: Incremental compilation has been disabled
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's important to include enough of the message to say why it was disabled, since you're adding several of these messages.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be clear, I'm worried about the test matching a case where it's disabled for some other reason.

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - 336d1bc23567571c909d34301e7801b1368e9071
Test requested by - @modocache

SR-2855 suggests `-driver-show-incremental` not only print information
about why certain files are included in incremental compilation, but
also print out why incremental compilation may be disabled altogether.

Add a message for one such reason: when the inputs passed to the
Swift compiler don't match the ones used previously.
@modocache modocache force-pushed the sr-2855-driver-show-incremental-inputs-mismatch branch from 336d1bc to c2002ea Compare October 19, 2016 19:13
@modocache
Copy link
Contributor Author

@swift-ci please smoke test

@modocache
Copy link
Contributor Author

@swift-ci please smoke test os x platform

@modocache modocache merged commit 4ac7968 into swiftlang:master Oct 20, 2016
@modocache modocache deleted the sr-2855-driver-show-incremental-inputs-mismatch branch October 20, 2016 01:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants