oneclick / rubyinstaller2

MSYS2 based RubyInstaller for Windows
https://rubyinstaller.org
BSD 3-Clause "New" or "Revised" License
654 stars 249 forks source link

Question regarding software licence and commercial use #235

Closed senolfeldmann closed 2 years ago

senolfeldmann commented 3 years ago

How is me downloading rubyinstaller2, which is licensed under BSD, and ending up with a GPL-licensed library (without any notice) on my local machine not a GPL violation?

Why am I asking this question?: I searched the internet for HOURS AND HOURS to no avail, so please bear with me. I want to ship a commercial Windows application together with CRuby, so the end user does not have to install Ruby separately. It seems that this is not possible from a licence standpoint. While rubyinstaller2 itself has a BSD license and Ruby has the Ruby license, CRuby under Windows is dependant on two libraries which have GPL licensing: libgcc and libgdbm. While libgcc has a special GPL exception, this is not the case for libgdbm. So obviously I cannot ship libgdbm with my application.

Having a clarification for my question would certainly help me for my application, too. Does the GPL allow for automatic downloads of dynamically linked libraries during install? The GPL does not state this explicitly. I would certainly like to be able to to the same for my application (Ship a setup without GPL libraries -> download them during the setup)

larskanis commented 3 years ago

In contrast to most commercial licenses, GPL doesn't restrict any form of distribution. It restricts the usage within the same process context. So if you don't want to make the sources of your commercial application public, you have to avoid loading any GPL licensed code into your Ruby process. It doesn't matter if you download that GPL code or distribute it with your software bundle.

libgdbm is certainly no issue here, since no one uses it seriously. It has been dropped from ruby-3.1 because of that fact. So unless you have a require "gdbm" in your executed code, you can freely distribute that library in your software bundle. You're just not allowed to run it together with closed source code.

However you should check the other gems for their licenses. There are license checkers for bundler which can grep and list the licenses of all dependent gems.

senolfeldmann commented 3 years ago

Thank you for your elaborate answer! First of all, the fact that gdbm is code that has to be explicitly required/imported is a huge relief! I can now understand the licensing of rubyinstaller2 better, too. Let my rephrase: gdbm is not implicitly used by the ruby process, thus rubyinstaller2 can trigger a download of the gdbm library on the end user's pc without breaching GPL (the form of distribution itself is not restricted by GPL). Furthermore, gdbm is not used in the same process context as rubyinstaller2. I can imagine that in the case of the setup, the process context of the installed product/program is of relevance, in this case ruby itself. But as gdbm is, again, not implicitly loaded into the process, GPL is not breached. Did I get it right?

Further question: How could I, without your help, have found out that libgdbm is something that is not implicitly loaded, but explicitly via require 'gdbm'? Is there some kind of list of what each included built in library does and whether it is implicitly/explicitly loaded? (I am talking about the libraries of a minimal ruby installation in bin\ruby_builtin_dlls) Of course there are some obvious ones like the openssl ones, libyaml, libffi and zlib.

larskanis commented 3 years ago

Did I get it right?

Yes.

How could I, without your help, have found out that libgdbm is something that is not implicitly loaded, but explicitly via require 'gdbm'?

You can use the process explorer to show the loaded DLLs of the process ruby.exe, when the process is running. Double click on the executable and switch to the "Modules" tab.

On the Ruby level you can list the loaded .so or .rb files by $LOADED_FEATURES.

senolfeldmann commented 3 years ago

Again, thank you very much for your help. I am very sorry for kind of polluting the issue tracker of rubyinstaller2, but this was the best place to ask that cam to mind. For questions regarding ruby on Windows, where/who should I ask in the future?

larskanis commented 2 years ago

It's OK to ask here.