Skip to content

DependenciesScanner: teach the scanner to handle cross-import overlays #32245

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
Jun 9, 2020

Conversation

nkcsgexi
Copy link
Contributor

@nkcsgexi nkcsgexi commented Jun 8, 2020

Swift cross-import overlays are implicitly imported. The dependencies scanner needs to read the YAML files to figure out these modules and add them to the dependencies graph.

@nkcsgexi nkcsgexi force-pushed the scan-overlay-file branch 5 times, most recently from 7daca9c to 39b5391 Compare June 9, 2020 17:01
@nkcsgexi
Copy link
Contributor Author

nkcsgexi commented Jun 9, 2020

@swift-ci please smoke test

@nkcsgexi nkcsgexi force-pushed the scan-overlay-file branch from 39b5391 to 42cc989 Compare June 9, 2020 17:39
@nkcsgexi nkcsgexi changed the title [WIP] DependenciesScanner: teach the scanner to handle cross-import overlays DependenciesScanner: teach the scanner to handle cross-import overlays Jun 9, 2020
@nkcsgexi
Copy link
Contributor Author

nkcsgexi commented Jun 9, 2020

@swift-ci please smoke test

@nkcsgexi nkcsgexi requested a review from DougGregor June 9, 2020 19:22
@nkcsgexi nkcsgexi merged commit b65300f into swiftlang:master Jun 9, 2020
@@ -80,6 +80,9 @@ import SubE
// CHECK-NEXT: {
// CHECK-NEXT: "swift": "A"
// CHECK-NEXT: }
// CHECK-NEXT: {
// CHECK-NEXT: "swift": "_cross_import_E"
Copy link
Member

Choose a reason for hiding this comment

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

I think we should report the YAML files we loaded as dependencies, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch! Does it suffice if we add the YAML file as part of the sources of this depending module?

@davezarzycki
Copy link
Contributor

This is failing to build with master-next for me. Do you might if I switch to emplace_back which does work?

/home/dave/ro_s/n/swift/lib/FrontendTool/ScanDependencies.cpp:167:20: error: no matching member function for call to 'push_back'
            result.push_back({overlayName.str(), found->getKind()});
            ~~~~~~~^~~~~~~~~
/p/llvm/bin/../include/c++/v1/vector:713:36: note: candidate function not viable: cannot convert initializer list argument to 'const std::__1::__vector_base<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, swift::ModuleDependenciesKind>, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, swift::ModuleDependenciesKind>>>::value_type' (aka 'const std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, swift::ModuleDependenciesKind>')
    _LIBCPP_INLINE_VISIBILITY void push_back(const_reference __x);
                                   ^
/p/llvm/bin/../include/c++/v1/vector:716:36: note: candidate function not viable: cannot convert initializer list argument to 'std::__1::vector<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, swift::ModuleDependenciesKind>, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, swift::ModuleDependenciesKind>>>::value_type' (aka 'std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, swift::ModuleDependenciesKind>')
    _LIBCPP_INLINE_VISIBILITY void push_back(value_type&& __x);
                                   ^
1 error generated.

@nkcsgexi
Copy link
Contributor Author

@davezarzycki ah, thanks for letting me know! Feel free to change this to emplace_back.

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