Skip to content
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

Text interface dependency improvements #20425

Closed

Conversation

graydon
Copy link
Contributor

@graydon graydon commented Nov 8, 2018

Continuation of #20355 (which is taking forever to merge due to CI issues, but whatever), covering the next few important steps with Dependencies. Start with 47e6e5a.

  • Switch over to hashing rather than using mtimes
  • Store transitive dependencies in .swiftmodules
  • Thread dependency data up to the outer DependencyTracker for use in .d files

@graydon graydon requested a review from jrose-apple November 8, 2018 06:54
@graydon
Copy link
Contributor Author

graydon commented Nov 8, 2018

@swift-ci please test

@swift-ci
Copy link
Contributor

swift-ci commented Nov 8, 2018

Build failed
Swift Test OS X Platform
Git Sha - 40f30ce

@swift-ci
Copy link
Contributor

swift-ci commented Nov 8, 2018

Build failed
Swift Test Linux Platform
Git Sha - 40f30ce

@graydon
Copy link
Contributor Author

graydon commented Nov 9, 2018

@swift-ci please test

@swift-ci
Copy link
Contributor

swift-ci commented Nov 9, 2018

Build failed
Swift Test OS X Platform
Git Sha - 40f30ce

include/swift/Serialization/ModuleFormat.h Show resolved Hide resolved
@@ -72,6 +73,22 @@ extractSwiftInterfaceVersionAndArgs(DiagnosticEngine &Diags,
return false;
}

static bool
Copy link
Contributor

Choose a reason for hiding this comment

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

You could avoid the out-parameter with Optional<uint64_t>, but I don't know if that's better.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm pretty consistently doing this file with the "bool-as-error + out-params" style. I'd slightly prefer not to switch it all over to option-as-error, but will if you have a strong preference.

lib/Frontend/ParseableInterfaceSupport.cpp Outdated Show resolved Hide resolved
}

static bool buildSwiftModuleFromSwiftInterface(
clang::vfs::FileSystem &FS, DiagnosticEngine &Diags,
CompilerInvocation &SubInvocation, StringRef InPath, StringRef OutPath) {
CompilerInvocation &SubInvocation, StringRef InPath, StringRef OutPath,
StringRef ModuleCachePath) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Weird (auto-)indentation here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just clang-format doing its thing.

Copy link
Contributor

Choose a reason for hiding this comment

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

This looks more like an Xcode-ism.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Emacs if anything! But it gets resolved in 40f30ce anyway.

@@ -188,6 +189,8 @@ swiftModuleIsUpToDate(clang::vfs::FileSystem &FS,
return false;

for (auto In : AllDeps) {
if (OuterTracker)
OuterTracker->addDependency(In.Path, /*IsSystem=*/false);
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess we ought to be tracking system-ness too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I meant to ask about that. The existing DependencyTracker can't provide this bit since it just forwards through to Clang's dependency tracker, which also provides no interface for it, and in fact doesn't even store it -- it's only an in-flight flag that controls whether or not a dependency gets added, but it's not recorded anywhere whether each dependency originated as a system or non-system entry. So I'd need to extend the interfaces and implementations of .. both? Seems a bit heavy. I'm not sure what else to do here.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hm. Let's file a bug to come back to it and think about it later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok: rdar://45957588

include/swift/AST/ModuleLoader.h Show resolved Hide resolved
@swift-ci
Copy link
Contributor

swift-ci commented Nov 9, 2018

Build failed
Swift Test Linux Platform
Git Sha - 40f30ce

@graydon
Copy link
Contributor Author

graydon commented Nov 9, 2018

@swift-ci please test

@swift-ci
Copy link
Contributor

swift-ci commented Nov 9, 2018

Build failed
Swift Test OS X Platform
Git Sha - eeccb29

@swift-ci
Copy link
Contributor

swift-ci commented Nov 9, 2018

Build failed
Swift Test Linux Platform
Git Sha - eeccb29

@graydon
Copy link
Contributor Author

graydon commented Nov 14, 2018

subsumed by #20458, closing.

@graydon graydon closed this Nov 14, 2018
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