After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 650875 - codegen should include command-line
codegen should include command-line
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gdbus
unspecified
Other Linux
: Normal normal
: ---
Assigned To: David Zeuthen (not reading bugmail)
gtkdev
Depends on:
Blocks:
 
 
Reported: 2011-05-23 15:02 UTC by Bastien Nocera
Modified: 2018-04-23 19:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
codegen: List basenames of input files in generated preamble (4.96 KB, patch)
2018-04-23 14:54 UTC, Philip Withnall
committed Details | Review

Description Bastien Nocera 2011-05-23 15:02:30 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.
Comment 1 David Zeuthen (not reading bugmail) 2011-05-23 15:18:56 UTC
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?
Comment 2 Bastien Nocera 2011-05-23 15:27:13 UTC
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.
Comment 3 Philip Withnall 2018-04-18 11:05:34 UTC
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.
Comment 4 Bastien Nocera 2018-04-18 15:44:46 UTC
(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?
Comment 5 Philip Withnall 2018-04-23 14:35:59 UTC
(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.
Comment 6 Philip Withnall 2018-04-23 14:54:47 UTC
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>
Comment 7 Philip Withnall 2018-04-23 14:55:18 UTC
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.
 */
Comment 8 Bastien Nocera 2018-04-23 16:39:12 UTC
(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!
Comment 9 Philip Withnall 2018-04-23 19:05:09 UTC
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