Skip to content

[Dependency Scanner] Use pragma clang module import in the hack file used to invoke the clang dependency scanner. #32590

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 30, 2020

Conversation

artemcm
Copy link
Contributor

@artemcm artemcm commented Jun 28, 2020

Using @import does not with in C-mode (-disable-objc-interop), so C modules cannot be found in this mode.
This also means the dependency scanner is not able to invoke the Clang dependency scanner tool on Linux.

@artemcm artemcm requested a review from DougGregor June 28, 2020 03:03
@artemcm
Copy link
Contributor Author

artemcm commented Jun 28, 2020

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 27b667bc13730b634f6fc5921cc644b34ae426d0

@artemcm artemcm force-pushed the HackingWithCModules branch 3 times, most recently from 7180006 to 5b27b38 Compare June 28, 2020 06:12
@artemcm
Copy link
Contributor Author

artemcm commented Jun 28, 2020

@swift-ci test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 5b27b38458b6d2b9ef7bf88a37d90e9d91dc482a

@artemcm artemcm force-pushed the HackingWithCModules branch from 5b27b38 to 3e03ffd Compare June 28, 2020 15:46
@artemcm
Copy link
Contributor Author

artemcm commented Jun 28, 2020

@swift-ci test

1 similar comment
@artemcm
Copy link
Contributor Author

artemcm commented Jun 28, 2020

@swift-ci test

@artemcm
Copy link
Contributor Author

artemcm commented Jun 29, 2020

@swift-ci Please test Windows platform

/// dependencies.
/// FIXME: This should go away once Clang's dependency scanning library
/// can scan by module name.
std::string importHackFile;
llvm::DenseMap<StringRef, std::string> importHackFileCache;
Copy link
Member

Choose a reason for hiding this comment

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

Please use StringMap here, because I don't think it's guaranteed that the keys will live forever (and they won't be that large overall).

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

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

Approved once you've switched to StringMap

…e used to invoke the clang dependency scanner.

Using `@import` does not woth in C-mode(`-disable-objc-interop`), so C modules cannot be found in this mode.
This also means the dependency scanner is not able to invoke the Clang dependency scanner tool on Linux at all.
@artemcm artemcm force-pushed the HackingWithCModules branch from 3e03ffd to 9ee4ebf Compare June 29, 2020 20:44
@artemcm
Copy link
Contributor Author

artemcm commented Jun 29, 2020

@swift-ci test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 3e03ffd414369931703d3b14c1ca4b00c8ad4783

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 3e03ffd414369931703d3b14c1ca4b00c8ad4783

@artemcm
Copy link
Contributor Author

artemcm commented Jun 29, 2020

@swift-ci test Linux platform

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 9ee4ebf

@DougGregor
Copy link
Member

@swift-ci please test platform Linux

@DougGregor
Copy link
Member

@swift-ci clean test Linux

@artemcm artemcm merged commit 6bc0385 into swiftlang:master Jun 30, 2020
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