meson icon indicating copy to clipboard operation
meson copied to clipboard

Add depend_files argument to generator

Open touilleMan opened this issue 2 years ago • 8 comments

see https://github.com/mesonbuild/meson/issues/2320#issuecomment-1316748696

touilleMan avatar Nov 16 '22 11:11 touilleMan

you may want to see if any custom_target() tests use depend_files, and copy the test a bit.

tristan957 avatar Nov 16 '22 15:11 tristan957

You will also need to add a release snippet in addition to editing the yaml docs for the new kwarg. The next version of Meson will be 1.0.0

tristan957 avatar Nov 16 '22 15:11 tristan957

@tristan957 Thanks for the prompt feedback ! I've added a test and updated the documentation & release snippet as you suggested ;-)

touilleMan avatar Nov 16 '22 16:11 touilleMan

I'm wondering if we should instead extend depends kwarg to allow files/strings and deprecate depend_files from custom_target. IMHO it makes little sense from an API pov to split them. It also makes things a bit ugly in at least glib: https://gitlab.gnome.org/GNOME/glib/-/commit/b8be62b523d79d93a46bac70f37a982610130df3.

I'm working on a PR for that ATM.

xclaesse avatar Nov 16 '22 19:11 xclaesse

See https://github.com/mesonbuild/meson/pull/11061

xclaesse avatar Nov 16 '22 20:11 xclaesse

@dcbaker thanks for the feedback, I've updated the PR ;-)

but I'm a little confused as to why you'd add this to generator() and not to generator().process()

generator() already takes depends argument (which is very similar to depend_files as @xclaesse pointed out)

The idea here is to create a generator that depend on multiple files (e.g. a python script that is divided into multiple .py files), then use it with the .process()

touilleMan avatar Nov 17 '22 14:11 touilleMan

Codecov Report

Merging #11056 (de351f4) into master (bfc8132) will decrease coverage by 1.66%. The diff coverage is n/a.

:exclamation: Current head de351f4 differs from pull request most recent head ffe34f6. Consider uploading reports for the commit ffe34f6 to get more accurate results

@@            Coverage Diff             @@
##           master   #11056      +/-   ##
==========================================
- Coverage   68.58%   66.92%   -1.67%     
==========================================
  Files         412      207     -205     
  Lines       87861    44930   -42931     
  Branches    20728     9282   -11446     
==========================================
- Hits        60261    30069   -30192     
+ Misses      23093    12584   -10509     
+ Partials     4507     2277    -2230     
Impacted Files Coverage Δ
modules/cuda.py 0.00% <0.00%> (-72.64%) :arrow_down:
templates/cudatemplates.py 37.50% <0.00%> (-62.50%) :arrow_down:
compilers/cuda.py 19.63% <0.00%> (-45.40%) :arrow_down:
dependencies/cuda.py 20.19% <0.00%> (-42.79%) :arrow_down:
compilers/mixins/clang.py 37.93% <0.00%> (-28.74%) :arrow_down:
compilers/objc.py 80.95% <0.00%> (-19.05%) :arrow_down:
compilers/objcpp.py 80.95% <0.00%> (-19.05%) :arrow_down:
scripts/coverage.py 56.43% <0.00%> (-7.93%) :arrow_down:
compilers/c.py 45.49% <0.00%> (-4.63%) :arrow_down:
compilers/detect.py 42.74% <0.00%> (-3.87%) :arrow_down:
... and 220 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov[bot] avatar Nov 17 '22 18:11 codecov[bot]

CI is all good ;-)

touilleMan avatar Nov 26 '22 04:11 touilleMan