Skip to content

[6.0][Macro] Get accurate dependency information for macro in explicit module build #75181

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

Conversation

cachemeifyoucan
Copy link
Contributor

Explanation: Add capability for discover accurate macro plugin dependency in the dependency scanner for better swift caching build.
Scope: this fixes some issues for macro plugin lookup in swift EBM or caching build, including building interface files that has macro expansion inside or false cache miss from swift caching build.
Issue: rdar://127116512&131214106
Original PR: #73421 #75082
Reviewer: @artemcm
Risk: Low.
Test Plan: Unit tests

@cachemeifyoucan cachemeifyoucan requested a review from a team as a code owner July 11, 2024 20:43
@cachemeifyoucan
Copy link
Contributor Author

@swift-ci please test

@cachemeifyoucan cachemeifyoucan force-pushed the eng/PR-macro-deps-swift-6 branch from 67c7064 to c1ea526 Compare July 15, 2024 18:01
@cachemeifyoucan
Copy link
Contributor Author

@swift-ci please test

1 similar comment
@cachemeifyoucan
Copy link
Contributor Author

@swift-ci please test

@cachemeifyoucan cachemeifyoucan force-pushed the eng/PR-macro-deps-swift-6 branch from 71999aa to 19a5974 Compare July 15, 2024 22:45
@cachemeifyoucan
Copy link
Contributor Author

@swift-ci please test

@cachemeifyoucan cachemeifyoucan force-pushed the eng/PR-macro-deps-swift-6 branch from 19a5974 to 36f6f06 Compare July 15, 2024 22:53
@cachemeifyoucan
Copy link
Contributor Author

@swift-ci please test

Build an accurate macro dependency for swift caching. Specifically, do
not include not used macro plugins into the dependency, which might
cause false negatives for cache hits.

This also builds the foundation for future improvement when dependency
scanning will determine the macro plugin to load and swift-frontend do
not need to redo the work.

rdar://127116512
(cherry picked from commit 4125e8c)
Fix few issues from previous implementation from explicit module build
with macros and accurate macro dependency scanning in
swiftlang#73421.

First, there is a crash when propagating the macro dependencies. It
turns out that the current macro plugin implementation doesn't need the
downstream users to know about the plugin search path from the upstream
dependencies.

Secondly, fix a bug that the swiftinterface that has macro usage won't
build because the build command doesn't inherit the plugin search path
option.

Finally, add JSON output for macro dependencies so it is easier to
debug the macro dependencies.

rdar://131214106
(cherry picked from commit da10a02)
@cachemeifyoucan cachemeifyoucan force-pushed the eng/PR-macro-deps-swift-6 branch from 36f6f06 to 36f98e1 Compare July 16, 2024 03:43
@cachemeifyoucan
Copy link
Contributor Author

@swift-ci please test

Fix a memory leak from swiftlang#75134.

(cherry picked from commit ed93685)
@cachemeifyoucan cachemeifyoucan force-pushed the eng/PR-macro-deps-swift-6 branch from 36f98e1 to a845dac Compare July 16, 2024 16:40
@cachemeifyoucan
Copy link
Contributor Author

@swift-ci please test

@cachemeifyoucan cachemeifyoucan merged commit e6a1db7 into swiftlang:release/6.0 Jul 17, 2024
5 checks passed
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.

2 participants