-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Clean up BuildTarget(install_dir) #15185
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
Open
dcbaker
wants to merge
7
commits into
mesonbuild:master
Choose a base branch
from
dcbaker:wip/2025-10/build-target-install-dir
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Clean up BuildTarget(install_dir) #15185
dcbaker
wants to merge
7
commits into
mesonbuild:master
from
dcbaker:wip/2025-10/build-target-install-dir
+252
−72
Conversation
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
6bd15ae to
33b7fa2
Compare
40 tasks
c3bb989 to
da3b3b3
Compare
This just puts the type checking in the frontend, there's still some serious cleanup in the build and backend that need to happen.
Among other things it will say "expects X but only has Y", even if Y > X.
This `install_dir` is slightly different than the one in `BuildTarget` (though I'd like to make them the same in the future). It is only allowed to be `str | bool | None`, and the implementation has always assumed this, it would have broken with an array value.
This simplifies a lot of code, and allows us to read an attribute rather than call a method in `get_link_dep_mappings`.
This pulls some of the setting of default install dirs out of the ninja backend and into the common build layer and interpreter. There is still more work to do here, but this reworks the internals to be more consistent.
…BuildTarget
For an end user it's opaque what these extra dirs do (even if in the
backend it's a fine data layout). Additionally, it isn't exactly obvious
that passing `install_dir : [true, true, true, true]` isn't valid if
`vala_gir` isn't set. This makes things much more obvious, and means
that an end user only needs to set values they want to overwrite.
Consider this:
```meson
library(
'foo',
'foo.vala',
vala_gir : 'foo.gir',
install : true,
install_dir : [true, true, true, get_option('datadir') / 'mygir'],
)
```
The end use needs to know what all of these fields mean, and they need
to specify *every* field. Consider now:
```meson
library(
'foo',
'foo.vala',
vala_gir : 'foo.gir',
install : true,
install_vala_gir_dir : get_option('datadir') / 'mygir',
)
```
This does not change the backend representation, since that works and is
mostly fine. There's probably some improvements that could be made to
group outputs and their install status together in such a way that we
cant have mismatched lists, but I haven't undertaken that here.
da3b3b3 to
63863cc
Compare
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.
This series is a largish project to try to move more of the input validation up to the Interpreter level and out of the Build and Backend levels.
Initially it uses
typed_kwargs()to manageinstall_dir.Second, it moves some information that we were previously (re)computing on the fly to precomputation.
Finally, it splits out of the vala specific install handling into it's own vala specific keyword arguments in the interpreter. This allows for: