-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Caching][Macro] Make macro plugin options cacheable #80474
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
[Caching][Macro] Make macro plugin options cacheable #80474
Conversation
@swift-ci please smoke test |
32d8cab
to
f6b1cab
Compare
This is part 1. Also need swift-driver and lldb part. |
@swift-ci please smoke test |
f6b1cab
to
c9d216e
Compare
@swift-ci please smoke test |
c9d216e
to
80508df
Compare
@swift-ci please smoke test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you looked at the performance implications of comparing the plugin binaries?
The macro dylibs are not too big right now (biggest fat macro we ship is around 1M), even we are comparing the entire fat binary sometimes. Future improvements are definitely on the table but the good thing is the comparing method is just between frontend and scanner, thus it is easy to make improvements. Few other possibilities without completely redo the logics right now:
|
80508df
to
ec1db28
Compare
@swift-ci please smoke test |
ec1db28
to
101ca60
Compare
@swift-ci please smoke test |
ping |
Currently, the macro plugin options are included as cache key and the absolute path of the plugin executable and library will affect cache hit, even the plugin itself is identical. Using the new option `-resolved-plugin-validation` flag, the macro plugin paths are remapped just like the other paths during dependency scanning. `swift-frontend` will unmap to its original path during the compilation, make sure the content hasn't changed, and load the plugin. It also hands few other corner cases for macro plugins: * Make sure the plugin options in the swift module is prefix mapped. * Make sure the remarks of the macro loading is not cached, as the mesasge includes the absolute path of the plugin, and is not cacheable. rdar://148465899
101ca60
to
3d38d0d
Compare
@swift-ci please smoke test |
Currently, the macro plugin options are included as cache key and the absolute path of the plugin executable and library will affect cache hit, even the plugin itself is identical.
Using the new option
-resolved-plugin-validation
flag, the macro plugin paths are remapped just like the other paths during dependency scanning.swift-frontend
will unmap to its original path during the compilation, make sure the content hasn't changed, and load the plugin. It also hands few other corner cases for macro plugins:rdar://148465899