Move structured sources handling to Build#15900
Open
bonzini wants to merge 14 commits into
Open
Conversation
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Information on which generated files are handled as mere orderdeps is split between ninjabackend and vs2010backend. Create a single function for that. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
List both the output (if only one) and the source. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This simplifies debugging, since all the interesting information is added to these fields by Generator.process_files. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Prepare for adding structured_sources support to backends other than ninja. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This is not exposed via generator.process(), but it can be used by the conversion of StructuredSources to GeneratedLists. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Apply it to any language that does not support separate compilation. This is still only Rust, but it provides the foundation for transforming structured sources into normal ones. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Similar to CustomTargets, and likewise not exposed by the Meson DSL. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
351415d to
2cc7f4a
Compare
Use GeneratedLists to copy all resources into the root of the jar file. No resources argument is treated simply as an empty list. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Remove the duplicated code to find the main .rs file across both structured and normal sources, as well as the code to generate copy targets: instead just reuse the GeneratedList mechanism. This provides support across multiple backends, makes Rust less of a special case, and in fact makes structured sources themselves less of a special case. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2cc7f4a to
b4334da
Compare
Contributor
Author
|
One note: moving directly to Interpreter seems trivial/obvious, but there's a wrinkle, in that the check for mixed structured/unstructured sources (which this patch places in |
structured_sources is not allowed in declare_dependency()'s sources argument. Remove it, together with all of its ramifications. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
3302c47 to
90925a9
Compare
Contributor
Author
|
More or less fixes #3023. |
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.
Move the handling of structured sources from the backend to the Build object; structured sources are now lowered to GeneratedLists. This removes all the special casing of structured sources, only leaving a small lowering pass before
process_compilers().I chose to allow using structured sources for non-Rust programs. This can be done or not independent of the new implementation. If it is undesirable, I can remove it - but it's simpler to basically treat
structured_sources()as syntactic sugar for generators, which they are now.