-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Allow .version() to be called for overridden executables #14543
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
c2f155f to
3ea8415
Compare
I think that's smart and qualifies this patch as more of a bugfix than a feature. |
3ea8415 to
fa6bf44
Compare
eli-schwartz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now this only uses the version of the subproject that called override_find_program but an additional
versionkwarg formeson.override_find_programcould be added if required (at least from the Executable side, not sure about ExternalProgram)
This is probably "usually correct", but while less common there are projects that have separate version numbers for a library and a program that are built together.
We can infer versions of a dependency from the project version but there is still a way to annotate them with an explicit version. There's not currently a way to do that for an executable though! (And of course we can't run it with the --version flag at setup time.)
I know, thats why I mentioned the possibility of having a version kwarg for Right now it is linked to subproject version regardless of this PR or not, as if you do |
fa6bf44 to
30e47ba
Compare
Also ensure that .get_version() can be called on the output of _find_tool by the modules (kind of required for mesonbuild#14422).
30e47ba to
52aeaa0
Compare
|
We can add functionality to specify a custom version later if need for it comes up. Test failures are unrelated. |
Right now, the set of available methods depends on the type of object returned by find_program. Specifically it fails if you attempt to call version on it, if it was an Executable put there with
meson.override_find_program.This also makes it possible that .get_version() can be called on the output of _find_tool by the modules (which is kind of required for #14422 [not really, as the returned value should never be an executable; but the mypy can't know that]).
For now this only uses the version of the subproject that called override_find_program but an additional
versionkwarg formeson.override_find_programcould be added if required (at least from the Executable side, not sure about ExternalProgram)