Skip to content

[5.9] Add support for an externally defined block list configuration file #66688

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 9 commits into from
Jun 16, 2023

Conversation

nkcsgexi
Copy link
Contributor

@nkcsgexi nkcsgexi commented Jun 15, 2023

nkcsgexi added 8 commits June 15, 2023 16:44
An example of this format is:

---
actionToTakeFor:
  ModuleName:
    - moduleName1
  ProjectName:
    - projectName1
…n't given by swift-driver

Although swift-driver always passes down these blocklist for the compiler to consume, some frontend
tools, like ABI checker, are invoked by the build system directly. Therefore, we need to teach
the compiler to infer these blocklist files like prebuilt module cache.
@nkcsgexi nkcsgexi requested a review from a team as a code owner June 15, 2023 23:54
@nkcsgexi
Copy link
Contributor Author

@swift-ci please test

@nkcsgexi nkcsgexi requested a review from xymus June 15, 2023 23:56
Copy link
Contributor

@xymus xymus left a comment

Choose a reason for hiding this comment

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

This will be very useful. None of my comments are blocking.

return nullptr;
}
}
static std::string getScalaString(llvm::yaml::Node *N) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo on scalar?

F != FE; F.increment(EC)) {
StringRef ext = llvm::sys::path::extension(F->path());
if (ext == "yml" || ext == "yaml") {
LangOpts.BlocklistConfigFilePaths.push_back(F->path());
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the main advantage of supporting many blocklists like this? My first though would be that one blocklist would be enough, unless we want different owners of each blocklist?

Copy link
Contributor Author

@nkcsgexi nkcsgexi Jun 16, 2023

Choose a reason for hiding this comment

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

Thank you for taking a look! The reasons for supporting multiple block lists are that (1) one single file may get too long over time, and (2) we could group similar actions into a single block list file, such as module loading related actions.


BLOCKLIST_ACTION(ShouldUseBinaryModule)
BLOCKLIST_ACTION(ShouldUseTextualModule)
BLOCKLIST_ACTION(DowngradeInterfaceVerificationFailure)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do I understand correctly that only DowngradeInterfaceVerificationFailure is enforced by this PR, and not ShouldUseBinaryModule nor ShouldUseTextualModule?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right. I suspect honoring ShouldUseBinaryModule and ShouldUseTextualModule here may cause a later merge conflict.

@nkcsgexi
Copy link
Contributor Author

@swift-ci please test

@nkcsgexi nkcsgexi merged commit 30cb02a into release/5.9 Jun 16, 2023
@nkcsgexi nkcsgexi deleted the block-list-cherry-pick-5.9 branch June 16, 2023 16:47
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