GNOME Bugzilla – Bug 650875
codegen should include command-line
Last modified: 2018-04-23 19:05:13 UTC
Currently the code just says: Generated by gdbus-codegen 2.29.5. DO NOT EDIT. It should also mention the command-line which generated the file, which would make it easier to recreate if required.
This one I'm not so sure about because in most cases people would be checking out the full source tree including e.g. Makefile rules to invoke gdbus-codegen. Do you have any specific use-case in mind that isn't covered by this?
Well, for one thing, it would make debugging easier. My particular case was trying to reproduce the dtm.[ch] files that exist in gnome-control-center, from the .xml file that exists in gnome-settings-daemon. The problem might not happen in the future, but I think just the debugging part would make this easier to reproduce bugs, and correct problems.
A problem with this is that it would potentially harm reproducible builds: it would cause build paths to leak into the output files. https://reproducible-builds.org/docs/build-path/ Given that, I don’t think it’s beneficial overall to implement this.
(In reply to Philip Withnall from comment #3) > A problem with this is that it would potentially harm reproducible builds: > it would cause build paths to leak into the output files. > > https://reproducible-builds.org/docs/build-path/ > > Given that, I don’t think it’s beneficial overall to implement this. Have we removed the version number as well, or is that not harmful to this endeavour? Could we have the basename of the file it's generated from in the results still?
(In reply to Bastien Nocera from comment #4) > (In reply to Philip Withnall from comment #3) > > A problem with this is that it would potentially harm reproducible builds: > > it would cause build paths to leak into the output files. > > > > https://reproducible-builds.org/docs/build-path/ > > > > Given that, I don’t think it’s beneficial overall to implement this. > > Have we removed the version number as well, or is that not harmful to this > endeavour? Could we have the basename of the file it's generated from in the > results still? The current preamble is: /* * Generated by gdbus-codegen 2.57.0. DO NOT EDIT. * * The license of this code is the same as for the D-Bus interface description * it was derived from. */ The gdbus-codegen version number is in there, but I don’t *think* that’s harmful, since Reproducible Builds is all about ensuring reproducible binaries using the same toolchain. The basename is a good shout. Let’s add that.
Created attachment 371279 [details] [review] codegen: List basenames of input files in generated preamble This makes it a bit easier for debugging which files were generated from which introspection XML. Signed-off-by: Philip Withnall <withnall@endlessm.com>
Example output: /* * Generated by gdbus-codegen 2.57.0 from test-codegen.xml. DO NOT EDIT. * * The license of this code is the same as for the D-Bus interface description * it was derived from. */
(In reply to Philip Withnall from comment #7) > Example output: > > /* > * Generated by gdbus-codegen 2.57.0 from test-codegen.xml. DO NOT EDIT. > * > * The license of this code is the same as for the D-Bus interface > description > * it was derived from. > */ Looks good, thanks!
I'm happy with that as an a-c-n. Thanks; pushed to master. Attachment 371279 [details] pushed as 1217b1b - codegen: List basenames of input files in generated preamble