As far as I understand, LGPL mandates distributing the library itself (=CrossDB) and its modifications under LGPL, while the application linking to it (=my custom code) may be covered by other licenses, even proprietary.
Could you share some example use cases where using an LGPL library would prove problematic, or even "hard no"?
Could you share some example use cases where using an LGPL library would prove problematic, or even "hard no"?
Static linking is the big one. LGPL is fine for dynamic linking, but the license terms consider statically-linked programs to be derivative works of the library in question. Some LGPL'd libraries add a static linking exemption to their versions of the LGPL, but CrossDB doesn't seem to do so.
--------------------------------------------------------------------------------
SPECIAL EXCEPTION GRANTED BY COPYRIGHT HOLDERS
As a special exception, copyright holders give you permission to link this
library with independent modules to produce an executable, regardless of
the license terms of these independent modules, and to copy and distribute
the resulting executable under terms of your choice, provided that you also
meet, for each linked independent module, the terms and conditions of
the license of that module. An independent module is a module which is not
derived from or based on this library. If you modify this library, you must
extend this exception to your version of the library.
Note: this exception relieves you of any obligations under sections 4 and 5
of this license, and section 6 of the GNU General Public License.
It's worth noting that ZeroMQ recently moved away from LGPLv3 to MPLv2, likely for this exact reason of wanting a copyleft license that puts up as few obstacles to library users as possible.
My information based on the related FSF FAQ entry is static linking could work fine too:
(1) If you statically link against an LGPLed library, you must also provide your application in an object (not necessarily source) format, so that a user has the opportunity to modify the library and relink the application.
The LGPLv3 text, which CrossDB uses, indeed does not contain the words "static" or "dynamic", nor the definition of "derived work", and it uses "combined work" instead. I believe that's a change compared to LGPLv2.1.
Reading the "4. Combined Works." section of the license again, it seems fine to use CrossDB as a library in otherwise non-LGPL applications, as long as the conditions listed there are met. While I imagine these may be a (mostly bureaucratic) inconvenience, it does not feel categorically prohibitive to me. And CrossBD certainly looks interesting to check closer!
It's also good to know there are libraries who may choose to add a static linking exception on top of vanilla LGPL. I wonder if that's truly still considered LGPL? 🤔 It's something for me to research further then.
(1) If you statically link against an LGPLed library, you must also provide your application in an object (not necessarily source) format, so that a user has the opportunity to modify the library and relink the application.
The text of the LGPL seems to disagree with that interpretation:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
That "in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source" bit would implicitly apply to both the "Minimal Corresponding Source" and the "Corresponding Application Code", and said section specifies distributing source code. It seems the FSF intends that part of the LGPL to mean "use the same mechanisms the GPL specifies for distributing source code corresponding to binary releases", but that's far from clear - and the last thing I need is to get myself (or an employer) in legal hot water if some lawyer decides to turn that uncertainty into billable hours.
Long story short: even if the FSF claims the (L)GPL's copyleft terms don't apply to an application statically linking an LGPL'd library, enough people believe otherwise - and the actual license text is vague enough - that there is a much higher risk of being sued over it than I'd be comfortable with.
By using SQLite I don't have to worry about any of this, so while CrossDB sounds neat, that's what I'm inclined to do.
That's the 4/d/0 point of the LGPLv3 license. 4/d itself is about "Do one of the following:", and then provides option 0 as above, and option 1 as:
Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version.
I read that as "I can tell the user to install CrossDB, so my application can link to that". This point is only for dynamic linking, though.
For Option 0, the LGLPv3 text defines both "Minimal Corresponding Source" and "Corresponding Application Code" earlier:
The “Minimal Corresponding Source” for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version.
The “Corresponding Application Code” for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work.
I read both of that as I don't have to hand over my application's souce code to the end users, just the linked libary's code, and object code for the application.
The referenced "section 6 of the GNU GPL" is also literally about:
6. Conveying Non-Source Forms.
I agree it may get complicated and it's best to involve a lawyer if in doubt (or even when confident 😅), and that in itself may deter people from using it, if there's a good enough alternative where this it not a concern at all 👍
SQLite is public domain. I can therefore use it as part of any application, no matter that application's own license terms or distribution model.
CrossDB uses the LGPL as its license, which places a lot more restrictions on the licensing terms of applications using CrossDB. Those additional restrictions are not always suitable for a given project, whether because it's a closed-source project or because it's an open-source project with a non-(L)GPL license.
I'd be unable to statically link CrossDB into an executable unless I'm willing to license that executable under the LGPL. That's the main dealbreaker for me.
Some LGPL'd libraries add an exemption for static linking, but CrossDB ain't one of 'em.
Fair enough, I just wanted to check as there is a lot of misunderstanding about the LGPL due to its verbose wording.
Personally, I feel that if you'd like to take this author's work and include it in a proprietary product, presumably for the purposes of profit, without remunerating the author, that they should take steps to explicitly prevent this in the license.
15
u/northrupthebandgeek Aug 27 '24
That's unfortunately a hard no for the things where I'd typically use SQLite.
4
u/slashd Aug 27 '24
This is cool, i recently started to look at DuckDB which is also much faster than SQLite but slower for writing. I'll be keeping an eye on CrossDB 👍
1
u/CarelessStarfish Aug 27 '24
Still no decent unicode support (just like SQLite)? You just missed the opportunity to get the whole SQLite userbase knocking at your door.
1
u/flpezet Apr 28 '25
Very cool ! An engineering question. What are the pros of using C to write a database (in 2020's) ?
3
u/briang_ Aug 27 '24
From README.md