github not recognizing lgpl

The way the LGPL works is that it modifies the GPL. Therefore a program “released under the LGPL” in fact is a program whose license consists of the GPL and the LGPL. Conventionally this is represented by two files named COPYING and COPYING.LESSER, respectively. Including both licenses is not a source of ambiguity; the licenses are written such that the LGPL takes precedence when both are present. Indeed, advises against shipping the LGPL without including a copy of the GPL. (source)

TL;DR, according to, “LGPL program” = program + GPL + LGPL.

Now, GitHub’s license-managing software, it doesn’t think like that. It thinks something like this:

function autoDetectLicense(repository, licenses)
for file in repository {
    if !file.isDirectory() {
for license in licenses {
            if similarEnough(file.getContentsAsText(), license.text) return
return "licensenotdetected"

(Assume “licenses” is an array that starts with “gpl, lgpl” and contains all the licenses GitHub recognizes.)

This isn’t an especially unreasonable way of doing things, but it fails pretty badly on the LGPL. It could be patched by changing the order of the array to put the LGPL before the GPL (assuming it’s an array and not, say, a hash table), but “the seemingly arbitrary order of this array is actually important to functioning in a way that not only could or will but has come up” is no way to do programming.

I see several potential patches that don’t do that:

  1. Collect all license files with recognizable contents from the repository’s top-level folder. Then, if there’s exactly one, auto-detect that one. If there’s more than one, let the user decide which one to display.

  2. Like 1, but allow simultaneous publication under multiple licenses.

  3. Like the current behavior, but treat the GPL, specifically, as a potentially incomplete license, and keep looking until either the LGPL is found or the LGPL is definitely not in the top-level directory. If the former, LGPL; if the latter; GPL.

  4. Like the current behavior, but somewhere in the settings, allow the user to manually point the auto-detector at a particular license file (instead of having it always detect the first one in its sorting order).

For the record, I like 2 best, but 1 or 4 would probably be easier to implement.

Example of the issue in action:

Is this a known issue? Anybody have a workaround? I don’t want people to scroll past my code because they have the wrong idea about its license, but I also really don’t want to use the LGPL in a way that its publishers specifically say not to do.

GitHub uses the licensee project to do its license detection. It appears they already have an issue open for LGPL detection. You may want to follow along there.

I hope that helps!

1 Like

…huh. How’d this get marked as a solution before I saw it?

Anyway, brb, off to rename my license files and see if that fixes it.

As soon as I renamed COPYING.LESSER.txt to COPYING.LESSER, it recognized the LGPL. Shouldn’t have tried to get fancy, I guess. Thanks for the info; the discussion was interesting to read and I’m glad this is getting fixed soon.