The GPL and cleanroom implementations

I was reading a debate online about whether to use a certain software package or whether it’s better to write something yourself. Generally, the consensus was that it’s better not to reinvent the wheel, but there are a variety of reasons not to use a particular package - it doesn’t do quite what you want it to, it’s so difficult to configure that it would be easier to write it from scratch, it includes a ton of stuff that you don’t need, whatever.

One of the reasons that was brought up was that the package might be released under a license that doesn’t work for whatever purpose you’re intended to use the code for. For example, using code under the GPL for a commercial product. A common answer to this is to write your own package under a ‘cleanroom’ implementation - that is, you give some programmers the requirements, forbid them from looking at the GPL code, and have them rewrite the package from scratch.

I was wondering if it’s still a violation of the GPL (or similar licenses, I don’t been for this to be exclusive of the GPL) to use the protected code to test the cleanroom implementation. For example, (and I know this isn’t a great example), if you found a GPL’d package that calculates prime numbers, and you wrote your own prime calculator, could you compare the output from your program to the GPL’d program to test with, and still be ok releasing without the GPL? You clearly made use of the GPL’d code in your in-house development (during the testing phase), but none of the code is in your product and your programmers never looked at the GPL code.

(Let’s leave aside HOW someone would find out you were doing this, and just assume a deus ex machina answer to that)

I see a slight difference between your first and second sentences. In the first, you refer to the “protected code”, and in the second, you refer to the “program”.

As I see it, if you use the “program”, that means installing the program as it was intended, and using it as intended, except that your purpose is not that you need prime numbers for your Pretty Picture Generator, but your purpose is to test your own Print Number Generator. In such a case, I can’t imagine that the GPL restricts the purpose that you’re using the program for.

However, suppose you extract the “protected code” and insert it into your own code. And you’re doing this so that you get only the random numbers that were generated, without having to deal with the format that they were usually display with. This case is different, because you’re not merely using the package, but you’re messing with it. (Please forgive the non-technical term.) Even though you’re not really looking at the code, or learning anything from it, this sort of thing could very well run afoul of the terms of the GPL, and you – or even better, your lawyer – had better read it very carefully. At the very least, it might constitute a smoking gun that you reverse-engineered it, even though you really didn’t.

As a programmer, there are many programs that don’t need any installation, and you can GPL a single function, which would be useless unless called from other code. I don’t think there’s really a difference here. I intentionally picked a very simple example to avoid those issues.

And this is not a real-life worry for me, just something I’m curious about.

GPL is a copyright license, and in most cases, the output of a GPL program is not covered by the GPL. Only downloading and running the GPL prime number generator would not be a problem. Because you are not distributing the prime number generating program or works derived from it there isn’t much of a way you can violate the GPL.

Complying with the GPL is pretty easy. If the covered software, or parts of it, are distributed in original or modified form, then the source code (including any modifications) must also be made available to those who receive the program, and possibly to any others. Many discussions of the GPL seem to be more along the lines of, “I’d like to distribute this software derived from GPLed source code, but avoid having to release my changes.” So edge cases, loopholes, and magic words are examined to try and find a weakness.

Also, GPL is about copyright, not patents, so a clean room implementation is not necessarily required. Your programers would not be poisoned by reading the GPLed code, but only by copying it into the new program. Everything would have to be reimplemented in new ways, not just search and replace variable names.

One very common situation is using gcc or another GPL compiler to compile proprietary code. As I understand it, under the license this is considered fundamentally different from putting part of the code of the compiler itself in your proprietary product, and is acceptable. This seems more analogous to me to using a GPL product for quality-control testing.

Correct. Here’s the clause in the license itself (section 2 Basic Permissions, my emphasis):

Sinc this isn’t about GLP/GMP cleanrooms, I got nothing.

Yeah, at first I misread the thread title as “JPL”, and assumed it be about the facilities where they build satellites.

Thanks guys, I knew someone on the dope would know the answer.