GPL compliance notice in proc macros

The GPL encourages showing a GPL notice on program startup. It'd be nice to get our proc macros to show the relevant notice on startup. Is there any way to do so?

This would get incredibly obnoxious and annoying if all your proc macros do that. And the GPL does not encourage you to do it on startup; it encourages it somewhere in your app that people can see. I'm pretty sure its not a legal requirement though.


Most(?) GPL apps do show a startup notice too.

Some applications do, but most libraries do not. Otherwise, you'd get a lot of messages at start up.

Start up messages are not part of the terms and conditions of the GPL, but part of the description on how to apply them.


But then, proc macros are more like apps than libs.

Proc macros absolutely should not print anything at all.


We should probably strive to stigmatize randomly dumping things during builds. Just imagine how annoying builds will become once corporations realize they can sponsor developers to dump really annoying ads during builds. Let's nip this in the bud.


You'd think legal notices are quite different from ads.

Well, they are different in many ways, but the difference doesn't really matter here. When compiling your code, you shouldn't get any output except from the normal cargo output and stuff like warnings and errors.


We maintain that it is important for proc macros to be able to print legal notices.

I'm aware you want to be able to print during build for other reasons, so why not write up a general RFC to get an official answer on whether it will be supported?


are you really tho? there are so many helpful things to do here, from acknowledging the license terms to acknowledging the contributions of ppl from various communities.

this thread is still about acknowledging the license.

(somewhat related side-note: the fact that cargo doesn't really do anything with authorship/contributor information kinda defeats the purpose of having it. why not proudly display those when compiling?)

I'm not a lawyer™, but proc macros are compiled into dynamic library and linked to the compiler process to allow compiler to call it to compile other crates. And the rustc is not a GPL binary. Is it legal at all? You may need to use LGPL instead.

Not a lawyer either, but even if it is linked during compilation, it is the distribution of a resulting binary that triggers the GPL. If you are distributing source and people are running that compilation themselves, the GPL won't stand in your way.

1 Like

I would definitely not want to ever use a GPL'd proc macro from anyone who believes in the FSF's definition of derivative work.


For me it's a pretty simple principle: When I'm building, I only want to see build-related information.


As far as I can tell the FSF does not define "derivative work". They operate within the copyright law. Which is where "derivative work" gets its meaning from.

They do licence their code with whatever terms and conditions. We are all free to accept the licence conditions and use the code with those terms, or not. Same as any other distributor of copyrighted material, open source, proprietary, whatever.

Truth and accuracy are only tangentially related to whether someone takes you to court. If they believe in the FSF's definition, then they're likely to cause me expensive legal fees even if I win.

1 Like

It's true that anyone can take you to court for anything. Especially in the USA.

However I don't see that the FSF's definition of *derivative work" differs from what copyright law says. Has the FSF ever taken anyone to court on unfounded grounds?

What you say is true of using any licenced, copyrighted work from any vendor. So why single out the offerings of the FSF? Do you have an example of something bad happening due to the FSF's legal actions?

Because the FSF believes that linking a shared library creates a derivative work, rather than a collective work. Other proponents of reciprocal licenses do not generally have that belief, as far as I know.

(I've not seen any indication that this is a settled legal question, thus my use of "belief". If you have case law demonstrating otherwise, I'd be interested to see it.)