symfony / symfony-docs

The Symfony documentation
https://symfony.com/doc
Other
2.17k stars 5.11k forks source link

clarify sample code licensing #6247

Closed mmucklo closed 8 years ago

mmucklo commented 8 years ago

According to your website, the documentation is licensed under Creative Commons Attribution-Share Alike 3.0 Unported license.

There is a tremendous amount of sample code on the website.

I think it's wonderful and one of the great selling points of the Symfony components and framework.

However the license terms of this code seem to be extremely restrictive in that by using the sample code you now have to distribute your code under a the same license as the documentation.

I may be mis-reading things here, and I'm no legal expert - could someone clarify?

javiereguiluz commented 8 years ago

I have no legal knowledge at all ... but the code examples are part of the documentation and we don't apply a different license to them, so it's safe to assume that they are published under the same "CC by-sa 3.0" license of the original doc.

mmucklo commented 8 years ago

First let me complement the team and say that symfony documentation is excellent and covers a great many topics and is incredibly useful.

However I think the problem I see is that you have an entire framework that's MIT licensed.

Then you have this excellent documentation containing awesome examples that are sneakily CC by-sa 3.0 licensed.

The problem you have is that it's not readily apparent to the user of the documentation that they should never ever use the sample code. For by using the sample code it will make their entire file or project even (or maybe just that section of code -- IANAL) CC by-sa 3.0 licensed (which is significantly different than what the MIT license does - again IANAL).

If the symfony team chooses to continue to license the sample code CC by-sa 3.0, might I suggest that they should should clearly indicate under each piece of sample code that this code is licensed CC by-sa 3.0 and what happens from using it?

E.g. that using this code puts that entire file or section of code (or entire codebase? - once again IANAL) CC by-sa 3.0, otherwise people are probably assuming the code is licensed MIT like the framework, or worse yet that it's Public Domain.

Most people will probably not look at the license, and those that might glance might think IANAL -- whatever, or maybe just ignore it, but CC by-sa 3.0 seemingly being a viral license, people should at least be made aware what it does by using code licensed by it, IMHO.

theofidry commented 8 years ago

I have no legal knowledge either, but there is one thing that I find weird. Takes the following snippet taken straight from The Serializer Component documentation (introduction):

use Symfony\Component\Serializer\Serializer;
use Symfony\Component\Serializer\Encoder\XmlEncoder;
use Symfony\Component\Serializer\Encoder\JsonEncoder;
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;

$encoders = array(new XmlEncoder(), new JsonEncoder());
$normalizers = array(new ObjectNormalizer());

$serializer = new Serializer($normalizers, $encoders);

According to what you're saying, as it's a code snippet in the doc, it is licensed CC by-sa 3.0.

But how come? This code has nothing special: it's plain PHP using a PHP library. There is no value in it if giving an example for documentation purposes. It's not a work of thought by itself, just a plain old piece of code.

My point is, I could create a doc under CC by-sa 3.0 license, having something as simple as declaring a dummy service and registering it in my container, this wouldn't affect any application copy/pasting this piece of code.

So although your concern is legit, I don't think there is any problem here. But again, I'm no expert...

xabbuh commented 8 years ago

From my vague knowledge of how legal rules apply here I tend to agree with @theofidry that nearly all code examples are too simple to count as a protectable work.

@javiereguiluz Is this something that was ever considered before at SensioLabs? Does it make sense to let someone look into the topic who is familiar with legal issues?

javiereguiluz commented 8 years ago

We won't display a message below every code sample, but we've updated the legal message displayed at the bottom of each doc page.

This is the current message:

before_license

And this is the message we'll see once it's deployed on production:

after_license

The entire work is published under CC BY-SA 3.0 and that includes the text, the images and the code samples.

theofidry commented 8 years ago

@javiereguiluz I find that confusing, especially as the last discussion comment was that the code samples were too simple to be licensable. Also what's the point of having a restrictive license for a documentation code samples?

javiereguiluz commented 8 years ago

Yes, some snippets are too generic, but we cannot differentiate them form the other code samples. It would be a nightmare.

But don't worry, if we ever prosecute you (zero chances of happening that!) you could easily demonstrate that during litigation. This is similar to the inventive step and non-obviousness requirement for patents.

theofidry commented 8 years ago

if we ever prosecute you (zero chances of happening that!)

I'm personally not too worried about that, but apparently it is for some people like @mmucklo and that's a legitimate concern for some companies and this message would only make them more wary.

Besides if you mention code samples, what about images? :p

javiereguiluz commented 8 years ago

@theofidry images, as well as code and any other element, are contained within the expression "This work" We added the "including code samples" expression to clarify things a bit because our readers are developers.

In any case, we consider this issue as "fixed" because we've clarified the licensing of the code samples, which is what @mmucklo originally asked for. Thanks!

xabbuh commented 8 years ago

Closing here as I agree that the clarification added to the docs should be enough.

Anyway, if anyone of you has still some doubts, please do not hesitate to leave more comments.

mmucklo commented 8 years ago

I personally feel that this does not go far enough.

So in case you were wondering whether small snippets of code have any legal consequences, there are all sorts of comments here about Stack Overflow's attempt to switch from copy-left CC-By-SA 3.0 to a more permissive MIT (with attribution):

http://meta.stackexchange.com/questions/271080/the-mit-license-clarity-on-using-code-on-stack-overflow-and-stack-exchange

http://meta.stackexchange.com/questions/272956/a-new-code-license-the-mit-this-time-with-attribution-required?cb=1

Given that these small sample code snippets that are part of this documentation are sometimes even larger than stack overflow postings, there's a real cause for future concern.

I don't think that one developer or even an entire team of developers promising that "don't worry we're not going to sue you" is enough.

In the example of patents - I'm sure you're not ignorant of the actions of Patent Trolls buying up patents and then suing others. What's to prevent someone in the future from buying up Sensio Labs and then some troll then suing others to CC-By-SA their code bases?

If there are trolls out there that will scan AWS instances and lock out and/or wipe certain data stores that aren't protected (see the accepted answer here: http://stackoverflow.com/questions/34115213/redis-raise-error-noauth-authentication-required-but-there-is-no-password-setti), what's to prevent Copyright trolls from doing such things in the future as code search engines and code matching algorithms become more and more sophisticated?

theofidry commented 8 years ago

My 2 cents: unlike StackOverflow, we are talking of documentation here. Code snippets can be reused without problem. Creating a book out of it and trying to sell it would, copy/pasting it your code is not. Using it to share it on social platform no one cares.

That being said, it's a legit concern, but it doesn't look like there is any easy answer so unless an expert is asked to look into it, it will be hard to solve IMO.

mmucklo commented 8 years ago

I'm not sure I follow - how can code snippets that are copy-left be used without a problem?

Can a code base be MIT licensed as a whole when portions of it are copy-left due to copy-and-pasting of copy-left code snippets? IANAL, so maybe someone could advise?

javiereguiluz commented 8 years ago

Answering to this comment from @mmucklo:

What's to prevent someone in the future from buying up Sensio Labs and then some troll then suing others to CC-By-SA their code bases?

SensioLabs doesn't own the Symfony code or docs. This is property of their authors (thousands of people!) and ultimately the Symfony Project.

SensioLabs just owns the logo and the website design, as explained here: http://symfony.com/license

Answering to this comment from @theofidry:

Creating a book out of it and trying to sell it would, copy/pasting it your code is not.

That's incorrect. We allow commercial use of the code samples (and the rest of the docs). You just need to comply with the CC BY-SA 3.0 license.

wouterj commented 8 years ago

Can a code base be MIT licensed as a whole when portions of it are copy-left due to copy-and-pasting of copy-left code snippets? IANAL, so maybe someone could advise?

If I remember correctly, MIT specifies that it should be released under a license at least as strict as MIT. CC BY-SA 3.0 seems to include all terms of the MIT license with some extra ones.

mmucklo commented 8 years ago

IIRC, if you take MIT code and include it in a GPL library you can therefore still release the library under GPL. But the vice-versa is not true (as the GPL is copy-left).

You can't take MIT code, sprinkle in some GPL code, and still release the whole project under MIT.

Likewise, CC-By-SA (also being copy-left) should be the same -

You can take MIT code and put it into a CC-By-SA project and release it under CC-By-SA.

But, if you take MIT code and sprinkle in some CC-By-SA code, therein you have a problem (akin to the GPL problem above).

Am I correct (once again IANAL)...?

mmucklo commented 8 years ago

BTW, Creative commons recommends against using their license for source code:

See the section "Can I apply a Creative Commons license to software?" here: https://creativecommons.org/faq/#Can_I_use_a_Creative_Commons_license_for_software.3F