Move structured sources handling to Build - #15900
Open
bonzini wants to merge 26 commits into
Open
Conversation
bonzini
force-pushed
the
structured-sources-no-backend
branch
from
June 5, 2026 15:18
351415d to
2cc7f4a
Compare
bonzini
marked this pull request as ready for review
June 5, 2026 16:07
bonzini
force-pushed
the
structured-sources-no-backend
branch
from
June 5, 2026 17:02
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 |
bonzini
force-pushed
the
structured-sources-no-backend
branch
from
June 8, 2026 03:15
3302c47 to
90925a9
Compare
Contributor
Author
|
More or less fixes #3023. |
Continue the job started by commit 687cb97 ("backends: use Build.get_project_args", 2026-01-16). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Make this more consistent with get_project_*args. Either way the arguments are only used together with a build target. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Per-machine compiler arguments (whether global or project) are separated for "native: true" and "native: false" targets. This means that it is incorrect to simply drop them for "native: true" targets when not cross compiling. Instead, the BuildTarget needs to know the *original* value of native and use it to apply the correct set of arguments. Start by adding all the infrastructure and handling project arguments. Global arguments need more care; they are not yet fully fixed.
Reduced from QEMU. Reported-by: Katalin Rebhan <me@dblsaiko.net> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Per-machine compiler arguments (whether global or project) are separated for "native: true" and "native: false" targets. This means that it is incorrect to simply drop them for "native: true" targets when not cross compiling. For global arguments, the BuildTarget needs to whether "native: true" appeared in the *original* value of native as well as in any subproject call.
Only apply machine map in the leaf functions, which are _dependency_method_impl and Interpreter.build_target. dependency_method was not applying it while extension_module_method was doing it too early (resulting in double application later in build_target). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This was fixed as a result of the effort to clean up typing of the Ninja backend. Detect the situation and raise a FeatureNew for it, so that users get a notice that they are relying on something that never worked prior to commit 8e705ad. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This reverts commit 7d4c05a. The correct fix is to check for the version number, since -object_path_lto was added in ld64 123.2. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Bound its inclusion using the same scheme as export_dynamic_args. Use _apply_prefix for consistency. Fixes: mesonbuild#15808 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
For xtools ld64, Meson currently passes the xtools version (e.g. 2.2.4) instead of the linker version. Fix this so that all the features are available. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
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>
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>
bonzini
force-pushed
the
structured-sources-no-backend
branch
from
July 19, 2026 14:03
90925a9 to
b63b088
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.
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.