ned14 / pcpp

A C99 preprocessor written in pure Python
Other
220 stars 41 forks source link

License issues #18

Closed Sei-Lisa closed 5 years ago

Sei-Lisa commented 5 years ago

I'm interested in including the C preprocessor provided by pcpp as a native preprocessor for my LSL-PyOptimizer project, rather than invoking an external executable as it does now. However, the lack of any license statement in this repository currently makes that impossible.

The only mention of a license is in setup.py, which says

    license='MIT',

and also

        'License :: OSI Approved :: MIT License',

However, there's no formal statement anywhere as to what the license actually is or which files does it apply to. Also, MIT has used several licenses even for its open source software (usually "MIT" refers to either the Expat or the X11 license, but it's not clear which one). I'm not confident to make use of the software with just the mention that the license is "MIT" and without any formal license statement that I can reproduce, as will probably be required once the text is clear.

Even if I went on and assumed that the license was the Expat license, the license text as published in opensource.org requires reproducing "the above copyright notice", which can't be properly done without a valid copyright notice preceding it. I know this sounds like nitpicking, but the job of a lawyer is precisely to nitpick on anything :)

In addition to that problem, the file seems to include substantial portions of David M. Beazley's cpp.py, from the PLY package. PLY is licensed under a BSD 3-clause style license, which says among other things:

* Redistributions of source code must retain the above copyright notice,
  this list of conditions and the following disclaimer.

However, the copyright notice is the only thing retained, and the license text is completely omitted from this repository. A few days ago (5 according to GitHub as I write this) the whole license text was incorporated into the cpp.py file in the PLY repository (and the copyright notice changed to include the initial of his middle name), making it even more obvious that the license applies to that file as well.

This is only a minor problem for me, because I can always add the license text to an external LICENSE file specifying which files it applies to, but when each file contains its own license statement, it's clear also to anyone copying individual files (as should be obvious from this very issue).

Finally, while not an issue to me, the license of PLY also says:

* Neither the name of the David Beazley or Dabeaz LLC may be used to
  endorse or promote products derived from this software without
  specific prior written permission.

I'm not sure whether the mention in the README file counts as using his name to endorse or promote this product, or whether you have written permission, but I thought I'd give you a heads-up just in case.

ned14 commented 5 years ago

pcpp was broken off of ply back around https://github.com/dabeaz/ply/tree/d951379d84450bdaa996a7201f62fce294ae02d3 which is approx Jan 2017. Back at that time, his licence appeared to be MIT (see his Readme from back then), so I chose MIT for setup.py. I suspect that I forgot to git add the licence file in my original pcpp repo, as I find it very odd one isn't there. I will fix this when I return to Europe next week.

The more recent changes to ply you mention suggest that David has been having problems with people misrepresenting him or his work, and he has moved to clamp down on it. We all suffer from this problem if you spend enough years contributing to open source, and it's very annoying, so I'm going to loop him in via @dabeaz to this issue report and see if anything about pcpp's current mentioning of his copyright is problematic for him. If it is, I'll fix it however he chooses.

David is aware of pcpp. I raised the idea of merging it back into ply, but if I remember correctly he felt that his sample preprocessor would not be a good primer for ply programming if it became so complex as pcpp. So they've ended up as separate projects, and I am extremely grateful to David for all his work, without which pcpp would not exist. David should take particular satisfaction that pcpp scales to load as well as a commercial C99 preprocessor, with a constant scale performance differential of just 4x to 6x over a C99 preprocessor written in C++. That's very impressive. Thanks David!

Sei-Lisa commented 5 years ago

Thanks for looking into this. The only changes I noticed are actually the addition of the middle name's initial in the copyright text and the inclusion of the (same) license text directly into cpp.py. It even contains the same weird wording (typo?): "the David Beazley".

Thanks also for the reference of the repository revision. That's not a MIT license, it's a BSD one. In particular, a minor variation of the 3-clause BSD.

You can of course add a MIT license to your changes, which is what I thought you were trying to do. Now it seems more like a confusion of licenses. Can't blame you, no one likes to deal with legal issues and read these long boring texts :)

Looking forward to the changes!

ned14 commented 5 years ago

Thank you for raising these issues. A lot of the time what we think in our heads a codebase has does not match reality. I'll fix everything up when I return to Europe next week.

dabeaz commented 5 years ago

"the David Beazley." Hmmm. Interesting. I've fixed that ;-)

Regarding the recent inclusion of the full license in ply/cpp.py, I am no longer making package-installable releases of PLY. It will continue to be maintained, but if you intend to use it in a larger project, it means that you should copy/include the files into your own project. I thought it was important for each file to clearly identify the license and source of the code (a link to the PLY github repository was also added).

ned14 commented 5 years ago

@dabeaz Understood. Can I check if you think pcpp uses your name to endorse or promote a product, which I think the OP was worried about as it would be licence violation?

dabeaz commented 5 years ago

Honestly, I hadn't really thought about it that much. Non-promotion is a fairly standard license clause, but I think my main concern would be use of my name/business as a promotional device in selling any kind of commercial product (i.e., "you should buy this because it uses David Beazley's PLY"). I don't really have an issue with statements like "this uses PLY" or "is based on PLY" though.

ned14 commented 5 years ago

Cool thanks for the answer. I'll merge latest PLY, the new non-package edition, into pcpp and tidy up the licence demarcation. I'll probably also issue a release onto pypi, it's been a long time since the last release. Lack of free time, as always! Happy new year to everybody!

ned14 commented 5 years ago

Ok, latest PLY is now used directly via git submodule. Formal licence file has been added. Let me know if this doesn't mean your requirements. Thanks for reporting the issue.