Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Engine.get_source_info() to help people comply with the MPL 2.0 #11064

Open
Jayman2000 opened this issue Nov 1, 2024 · 0 comments
Open

Comments

@Jayman2000
Copy link
Contributor

Jayman2000 commented Nov 1, 2024

Describe the project you are working on

A game about typing lyrics while listening to a song and a game about tying the titles of songs while listening to a medley

Describe the problem or limitation you are having in your project

Whenever you distribute a Godot game, you have to comply with the licenses for third-party components that are a part of Godot. The docs mention two different methods for how you can do this:

  1. Use Engine.get_license_info() and Engine.get_copyright_info().
  2. Include a copy of COPYRIGHT.txt.

I always use the first method because it’s automated. With the second method, you have to either remember to manually copy COPYRIGHT.txt into your game’s releases or create your own automation for it. This feature request applies to the first method. It doesn’t really affect the second method.


One of Godot’s third-party components is thirdparty/certs/ca-certificates.crt. ca-certificates.crt is available under the Mozilla Public License version 2.0. The MPL 2.0 says (emphasis added):

3.2. Distribution of Executable Form

If You distribute Covered Software in Executable Form then:

  1. such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and[…]

In other words, whenever anyone distributes a copy of Godot, they need to also need to tell users where they can find the source code for thirdparty/certs/ca-certificates.crt. Godot binaries don’t tell users where they can find the source code for ca-certificates.crt. Fortunately, the Godot source code does tell users where they can find the source code for ca-certificates.crt.


The easiest way to comply with the MPL 2.0 in this situation would be to tell users that they can get Godot’s source code from https://github.com/godotengine/godot. That way, users can open the link, find the tag for the specific version of Godot that they’re using, open thirdparty/README.md, find the repo URL and commit hash for ca-bundle, clone the ca-bundle repo and checkout the correct commit.

You could also link directly to the right commit in the ca-bundle repository, but that requires more maintenance and you’re more likely to accidentally link to the wrong version. Additionally, you might have to add additional links in the future if new versions of Godot add any additional MPL 2.0–licensed components.


Here’s the problem: developers likely don’t know that they should include a link to Godot’s source code in their game. There’s probably many developers who are accidentally violating the MPL 2.0 because they didn’t realize that this was a requirement when distributing Godot games.

Additionally, there’s also a good chance that people distributing the Godot editor are accidentally violating this requirement. For example, take a look at these official Godot Editor download pages:

  • Steam — There’s links to godotengine.org and docs.godotengine.org, but there isn’t anything that tells you how to get Godot’s source code.
  • Epic Games Store — There’s a link to godotengine.org but there isn’t anything that tells you how to get Godot’s source code.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

We already have Engine.get_license_info() and Engine.get_copyright_info(). Those functions give Godot projects access to data stored in COPYRIGHT.txt. I propose that we add a new function named Engine.get_source_info(). Engine.get_source_info() would return a String that contains the contents of COPYRIGHT.txt’s Source field. The description for that function could mention that it can be used to help ensure MPL 2.0 compliance.

Specifically, it should return the contents of COPYRIGHT.txt’s Source field in order to make things easier for downstream projects. That way if someone forks Godot, they’ll only need to edit COPYRIGHT.txt. Games that switch from using the upstream version of Godot to the fork will automatically start using the fork’s URL.

Technically, we could just update the documentation instead of adding a function, but adding a function will help spread awareness of this requirement. Specifically, it will spread awareness to developers who use or will use the Engine.get_license_info(), Engine.get_copyright_info() and Engine.get_license_text() functions. Also, functions are easier to notice than paragraphs explaining legal requirements.

After that function gets added, we could do the following:

  • Update this tip in the docs to mention Engine.get_source_info(). We could also update the rest of the page to explain why including a link to Godot’s source code is helpful for license compliance.
  • Update Godot’s about screen to include the return value of Engine.get_source_info() somehow. This way, anyone redistributing the Godot Editor will be automatically compliant with this aspect of the MPL 2.0.
  • If Add command line arguments to print licenses, authors and donors godot#51028 gets merged, then we could add a --about source command-line option that will print the output of Engine.get_source_info(). That way, more games will automatically be compliant with this aspect of the MPL 2.0.
  • If Add built-in GUI to display license notices (reverted) godot#79599 gets merged, then we can add the return value of Engine.get_source_info() to the third-party notices screen. That way, more games will automatically be compliant with this aspect of the MPL 2.0.

I’m willing to open a pull request that adds the Engine.get_source_info() function and open pull requests to make the above list of changes.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

# 🅭🄍1.0 This file is dedicated to the public domain using the CC0 1.0
# Universal Public Domain Dedication: <https://creativecommons.org/publicdomain/zero/1.0/>.
extends TextEdit


func _ready():
    editable = false
    text = ""

    # In order to use Engine.get_source_info(), you would add something
    # like this to your code:
    text += "You can get a copy of the Godot Engine’s source code at <%s>.\n\n" % [Engine.get_source_info()]

    # Then, you would call Engine.get_license_text(),
    # Engine.get_copyright_info() and Engine.get_license_info() just
    # like you normally would:
    text += "Godot Engine License\n"
    text += "====================\n"
    text += "\n"
    text += Engine.get_license_text()
    text += "\n\n"
    # […]

If this enhancement will not be used often, can it be worked around with a few lines of script?

I’m not sure whether or not this enhancement will be used often or not. Like I mentioned previously, there’s two different ways to make sure that you’re compliant with third-party licenses:

  1. Use Engine.get_license_info() and Engine.get_copyright_info().
  2. Include a copy of COPYRIGHT.txt.

If people rarely use the first method, then this feature will rarely be used. If people always use the first method, then this feature will be used very often.


It’s really easy to work around the lack of this feature:

    # Instead of doing this:
    text += "You can get a copy of the Godot Engine’s source code at <%s>.\n\n" % [Engine.get_source_info()]
    # Do this:
    text += "You can get a copy of the Godot Engine’s source code at <https://github.com/godotengine/godot>.\n\n"

That being said, the workaround is incomplete. That workaround could be added to the Godot Docs, but it wouldn’t do as good of a job at building awareness. Additionally, developers would have to remember to make that change manually if they switch to a fork of Godot.

Is there a reason why this should be core and not an add-on in the asset library?

Add-ons don’t have access to the COPYRIGHT.txt file that was used to compile the version of Godot that you’re currently using, so add-ons wouldn’t allow for automatic compliance if you started using a fork of Godot. Additionally, if this was implemented as an add-on, then it wouldn’t do as good of a job at building awareness of this requirement.

Jayman2000 added a commit to Jayman2000/jasons-web-site that referenced this issue Nov 2, 2024
I recently noticed a legal notice–related problem with my Godot games
[1]. This commit works around that problem.

[1]: <godotengine/godot-proposals#11064>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants