GNOME Bugzilla – Bug 752239
Missing dependency for python files in build file
Last modified: 2017-10-11 11:27:19 UTC
Created attachment 307243 [details] [review] patch for adding missing dependencies I am a researcher from the Software Analysis and Intelligence Lab (SAIL) from Queen's University in Kingston, Canada. Currently, we are working on an approach for finding missing dependencies in build files and we are using glib as a case study. We have found several bugs which I will submit in the following days, together with a patch for fixing them. The targets: gdbus-daemon-generated.h gdbus-daemon-generated.c are depending on the output of gdbus-codegen.in only. If any of these other python files change, the target will not be rebuilt: $(srcdir)/gdbus-2.0/codegen/gdbus-codegen.in $(srcdir)/gdbus-2.0/codegen/codegen_main.py $(srcdir)/gdbus-2.0/codegen/parser.py $(srcdir)/gdbus-2.0/codegen/codegen_docbook.py $(srcdir)/gdbus-2.0/codegen/codegen.py $(srcdir)/gdbus-2.0/codegen/__init__.py $(srcdir)/gdbus-2.0/codegen/dbustypes.py $(srcdir)/gdbus-2.0/codegen/config.py $(srcdir)/gdbus-2.0/codegen/utils.py The included patch adds these dependencies for the latest HEAD. We observed that these dependencies are missing since at least version 2.36.0.
Review of attachment 307243 [details] [review]: This seems a bit over the top (the likelihood of those files being changed and causing a problem is low), but the patch looks good. Thanks.
Nirbheek, is this something which Meson already takes care of, or is it something we need to worry about there too?
Generally, this is not something meson would be able to automatically account for since the resources that gdbus-codegen uses are opaque to the build system; in this case the modules that it imports from within the source tree. I looked at the build file, and although the situation is different in meson (we copy all the files to the builddir), we won't regenerate the custom target if these are changed. The fix is easy though, I'll attach it here in a bit.
Created attachment 361315 [details] [review] meson: Improve gdbus-codegen custom target dependencies Ensure that the custom targets that use gdbus-codegen get rebuilt when any of the gdbus-codegen files are changed.
Forgot to note that to test this you have to actually change the files, not just `touch` them because meson won't replace the built files if the contents haven't changed.
Review of attachment 361315 [details] [review]: Looks good to me, thanks!
Comment on attachment 361315 [details] [review] meson: Improve gdbus-codegen custom target dependencies Attachment 361315 [details] pushed as b444ae0 - meson: Improve gdbus-codegen custom target dependencies