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 788990 - Include licensing information in output from glib-mkenums, glib-genmarshal
Include licensing information in output from glib-mkenums, glib-genmarshal
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2017-10-14 16:17 UTC by Joël Krähemann
Modified: 2017-10-25 11:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
glib-mkenums: Add default comment template if none is provided (1.57 KB, patch)
2017-10-19 09:18 UTC, Philip Withnall
committed Details | Review
glib-genmarshal/glib-mkenums: Add comment clarifying licensing (3.14 KB, patch)
2017-10-19 09:19 UTC, Philip Withnall
none Details | Review
glib-genmarshal/glib-mkenums: Add comment clarifying licensing (3.19 KB, patch)
2017-10-23 07:32 UTC, Philip Withnall
committed Details | Review

Description Joël Krähemann 2017-10-14 16:17:21 UTC
Hi,
I need some authoritative answer what copyright and license information is needed to distribute header and body produced by `glib-genmarshal`.

My libraries use either GNU GPLv3+ or AGPLv3+.
http://git.savannah.gnu.org/cgit/gsequencer.git

I need to proceed a new submission on savannah.gnu.org to split the application.

Bests,
Joël
Comment 1 Emmanuele Bassi (:ebassi) 2017-10-14 16:41:52 UTC
Of course, I am not a lawyer, so this must not be construed as legal advice. If you want legal advice, I strongly encourage you to consult a lawyer.

The clear intention of the GLib project is that the license of the tools provided by GLib does not propagate to the code generated as the output of those tools; the generated code has the same license as the rest of the project.

The generated code contains calls to the GLib API, and once it's compiled, it expects the GLib ABI; this means that the project must comply with the requirements of the GNU Lesser General Public License, either version 2.1 or, at your option, any later version, since GLib falls under those licensing terms.
Comment 2 Joël Krähemann 2017-10-14 17:04:04 UTC
Hi,
I did a license note as following:
http://git.savannah.gnu.org/cgit/gsequencer.git/tree/README?h=1.1.x#n193

I hope it meets your demands.

regards,
Joël
Comment 3 Philip Withnall 2017-10-17 13:06:03 UTC
(In reply to Joël Krähemann from comment #2)
> Hi,
> I did a license note as following:
> http://git.savannah.gnu.org/cgit/gsequencer.git/tree/README?h=1.1.x#n193

It looks like you’ve slightly misunderstood. The code generated by glib-genmarshal is under whatever license *your project* is under. In this case, that seems to be the GPLv3. What Emmanuele was saying about the LGPL refers to the fact that by using code generated by glib-genmarshal, your project needs to link against GLib. Since GLib is licensed under the LGPL, that means your project has to comply with the LGPL to be allowed to link against it. Since your project is GPLv3, it does comply.

What we could do to GLib is to include a summary of the licensing information in the code generated by glib-mkenums and glib-genmarshal, to make things clearer.
Comment 4 Philip Withnall 2017-10-19 09:18:58 UTC
Created attachment 361847 [details] [review]
glib-mkenums: Add default comment template if none is provided

The fallback code for providing a default comment template only worked
if a template file was provided. It didn’t work if individual templates
were provided on the command line (and --comment wasn’t).

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Comment 5 Philip Withnall 2017-10-19 09:19:03 UTC
Created attachment 361848 [details] [review]
glib-genmarshal/glib-mkenums: Add comment clarifying licensing

Clarify the licensing of the code generated by the two scripts in a
comment in the header of each generated file. The intention is that the
license of GLib does *not* apply to the generated files; but that they
are subject to the linking restrictions of the LGPL, since they link to
GLib and GLib is licensed under the LGPL. The generated files themselves
are under the license of whatever project they’re generated for.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Comment 6 Emmanuele Bassi (:ebassi) 2017-10-19 09:56:13 UTC
Review of attachment 361847 [details] [review]:

Comment 7 Emmanuele Bassi (:ebassi) 2017-10-19 10:00:40 UTC
Review of attachment 361848 [details] [review]:

::: gobject/glib-genmarshal.in
@@ +165,1 @@
+def generate_licensing_header(outfile):

Nitpick: maybe should be called `generate_licensing_comment()`, since you use it in the `generate_header_preamble()` and `generate_body_preamble()` functions.

@@ +165,2 @@
+def generate_licensing_header(outfile):
+    outfile.write('/* Generated data (by glib-genmarshal). This code is '

Minor nitpicks:

  - the comment should still say

'''This file is generated by glib-genmarshal, do not modify it'''

  - the comment style should probably follow GLib's own, and thus use:

```
/* ...
 * ...
 */
```

::: gobject/glib-mkenums.in
@@ +383,3 @@
 # put auto-generation comment
+comment = comment_tmpl.replace('\u0040comment\u0040',
+                               'Generated data (by glib-mkenums). This code '

Same nitpicks as the comment for glib-genmarshal.
Comment 8 Philip Withnall 2017-10-19 10:28:54 UTC
Review of attachment 361848 [details] [review]:

::: gobject/glib-genmarshal.in
@@ +165,1 @@
+def generate_licensing_header(outfile):

Fair.

@@ +165,2 @@
+def generate_licensing_header(outfile):
+    outfile.write('/* Generated data (by glib-genmarshal). This code is '

I was aiming to standardise the comments between glib-mkenums and glib-genmarshal. How about changing them both to be:

This file is generated by (program), do not modify it. This code is…

I deliberately didn’t do multi-line comments, because then I’d have to support them in the template file and support C and C++ style versions, and that would be a nightmare.
Comment 9 Philip Withnall 2017-10-19 10:29:52 UTC
Comment on attachment 361847 [details] [review]
glib-mkenums: Add default comment template if none is provided

Attachment 361847 [details] pushed as fcfbaf8 - glib-mkenums: Add default comment template if none is provided
Comment 10 Philip Withnall 2017-10-23 07:32:52 UTC
Created attachment 362068 [details] [review]
glib-genmarshal/glib-mkenums: Add comment clarifying licensing

Clarify the licensing of the code generated by the two scripts in a
comment in the header of each generated file. The intention is that the
license of GLib does *not* apply to the generated files; but that they
are subject to the linking restrictions of the LGPL, since they link to
GLib and GLib is licensed under the LGPL. The generated files themselves
are under the license of whatever project they’re generated for.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Comment 11 Emmanuele Bassi (:ebassi) 2017-10-25 11:34:07 UTC
Review of attachment 362068 [details] [review]:

Looks good
Comment 12 Philip Withnall 2017-10-25 11:39:48 UTC
Attachment 362068 [details] pushed as 9a319a1 - glib-genmarshal/glib-mkenums: Add comment clarifying licensing