-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Fix 'meson introspect --target-files' for a custom target #3061
Fix 'meson introspect --target-files' for a custom target #3061
Conversation
Thanks, but this is a leftover from the bad old days when everything was a string. The "correct" solution would be to convert custom target sources to Files with
|
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.
I have a few nits, but otherwise the test seems correct to me.
503ca56
to
29380cc
Compare
Yes, that also works for custom targets in mesa. I'm not sure about breaking |
This is my bad, I have been totally asleep at the wheel to accept that. Manually building paths to files is bad. We should never promote that in our tests or official docs. I really want to fix this properly, though, because this kind of string inconsistency is a big maintenance burden. |
Ok. This PR just contains the test case now (which currently fails in CI) |
Funnily enough, somehow I missed that too, so I share the blame. |
v2: Use asssertCountEqual for list comparison ignoring order
For backwards compatibility, tolerate but warn about custom target sources which can't be converted to Files
29380cc
to
6a21389
Compare
Rebased to fix conflicts. I added something to handle non-file inputs in a backwards compatble way, with a warning: jon@tambora /meson/test cases/vala/9 gir
$ rm -r _build ; /meson/meson.py _build
[...]
WARNING: Custom target input '/meson/test cases/vala/9 gir/_build/Foo-1.0.gir' can't be converted to a File object.
This will become a hard error in the future. This warning should probably say something more about what's probably wrong and how to remedy things.
I guess a defect needs to be created about how vala libraries don't expose the |
6a21389
to
e702d75
Compare
I created the bug as #4481. |
Thanks. Does this PR need anything further? |
Currently there is a try/except around the function that detects and rejects this, which instead of rejecting it, spawns a warning and continus. This warning exists because of 'test cases/vala/9 gir/' which passes a vala generated output that isn't a return value (!!!) using string joining with the meson.current_build_dir() function (also !!!) because we officially document this (!!! for a third time) as the only way to make a vala shared library generate a typelib with a custom_command from the automatically generated gir: https://mesonbuild.com/Vala.html#gobject-introspection-and-language-bindings In mesonbuild#3061 we converted strings to Files, but only if none of them were this vala hack. Due to the precise implementation, we also failed to convert strings to Files if any other error occurred, but since we only want to ignore errors for generated vala outputs, tighten that check and specifically call out generated files in the warning. Fixes mesonbuild#8635
Currently there is a try/except around the function that detects and rejects this, which instead of rejecting it, spawns a warning and continue. This warning exists because of 'test cases/vala/9 gir/' which passes a vala generated output that isn't a return value (!!!) using string joining with the meson.current_build_dir() function (also !!!) because we officially document this (!!! for a third time) as the only way to make a vala shared library generate a typelib with a custom_command from the automatically generated gir: https://mesonbuild.com/Vala.html#gobject-introspection-and-language-bindings In mesonbuild#3061 we converted strings to Files, but only if none of them were this vala hack. Due to the precise implementation, we also failed to convert strings to Files if any other error occurred, but since we only want to ignore errors for generated vala outputs, tighten that check and specifically call out generated files in the warning. Fixes mesonbuild#8635
Currently there is a try/except around the function that detects and rejects this, which instead of rejecting it, spawns a warning and continue. This warning exists because of 'test cases/vala/9 gir/' which passes a vala generated output that isn't a return value (!!!) using string joining with the meson.current_build_dir() function (also !!!) because we officially document this (!!! for a third time) as the only way to make a vala shared library generate a typelib with a custom_command from the automatically generated gir: https://mesonbuild.com/Vala.html#gobject-introspection-and-language-bindings In mesonbuild#3061 we converted strings to Files, but only if none of them were this vala hack. Due to the precise implementation, we also failed to convert strings to Files if any other error occurred, but since we only want to ignore errors for generated vala outputs, tighten that check and specifically call out generated files in the warning. Fixes mesonbuild#8635
Currently there is a try/except around the function that detects and rejects this, which instead of rejecting it, spawns a warning and continue. This warning exists because of 'test cases/vala/9 gir/' which passes a vala generated output that isn't a return value (!!!) using string joining with the meson.current_build_dir() function (also !!!) because we officially document this (!!! for a third time) as the only way to make a vala shared library generate a typelib with a custom_command from the automatically generated gir: https://mesonbuild.com/Vala.html#gobject-introspection-and-language-bindings In mesonbuild#3061 we converted strings to Files, but only if none of them were this vala hack. Due to the precise implementation, we also failed to convert strings to Files if any other error occurred, but since we only want to ignore errors for generated vala outputs, tighten that check and specifically call out generated files in the warning. Fixes mesonbuild#8635
Currently there is a try/except around the function that detects and rejects this, which instead of rejecting it, spawns a warning and continue. This warning exists because of 'test cases/vala/9 gir/' which passes a vala generated output that isn't a return value (!!!) using string joining with the meson.current_build_dir() function (also !!!) because we officially document this (!!! for a third time) as the only way to make a vala shared library generate a typelib with a custom_command from the automatically generated gir: https://mesonbuild.com/Vala.html#gobject-introspection-and-language-bindings In mesonbuild#3061 we converted strings to Files, but only if none of them were this vala hack. Due to the precise implementation, we also failed to convert strings to Files if any other error occurred, but since we only want to ignore errors for generated vala outputs, tighten that check and specifically call out generated files in the warning. Fixes mesonbuild#8635
Currently there is a try/except around the function that detects and rejects this, which instead of rejecting it, spawns a warning and continue. This warning exists because of 'test cases/vala/9 gir/' which passes a vala generated output that isn't a return value (!!!) using string joining with the meson.current_build_dir() function (also !!!) because we officially document this (!!! for a third time) as the only way to make a vala shared library generate a typelib with a custom_command from the automatically generated gir: https://mesonbuild.com/Vala.html#gobject-introspection-and-language-bindings In mesonbuild#3061 we converted strings to Files, but only if none of them were this vala hack. Due to the precise implementation, we also failed to convert strings to Files if any other error occurred, but since we only want to ignore errors for generated vala outputs, tighten that check and specifically call out generated files in the warning. Fixes mesonbuild#8635
Add testcase for, and fix
meson introspect --target-files
for a custom target, broken since 0.26.0 (PR #225)For a CustomTarget, sources is a list of filenames as strings, not File objects.
Closes #2783