jextract: resolve cross-module types via --depends-on#766
Merged
ktoso merged 6 commits intoMay 26, 2026
Conversation
04c9f94 to
52cb189
Compare
Previously --depends-on was used only to map Java packages and look up wrapped Java classes; When using swift-java jextract on modules which extended or used types from another module, we'd not be able to map them unless we manually write stubs for them in the swift-java config. This was annoying, we can do better than that -- emit --depends-on for jextract such that it is aware of the other modules and can attempt to scan them. - `SourceDependenciesResolver` owns dependent-module source parsing and per-module input registration. - `SwiftSymbolTable.setup` gains a `dependencies:` parameter and builds real symbol tables for each dependent module before falling back to `importedModuleStubs` - Failed-import diagnostics upgraded debug -> warning and hint about --depends-on
52cb189 to
c520574
Compare
75b263f to
79d016c
Compare
92c6bce to
512633c
Compare
512633c to
8293a48
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously --depends-on was used only to map Java packages and look up wrapped Java classes; When using swift-java jextract on modules which extended or used types from another module, we'd not be able to map them unless we manually write stubs for them in the swift-java config.
This was annoying, we can do better than that -- emit --depends-on for jextract such that it is aware of the other modules and can attempt to scan them.
SourceDependenciesowns dependency modules and known typesSwiftSymbolTable.setupgains adependencies:parameter and builds real symbol tables for each dependent module before falling back toimportedModuleStubs