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

Update licensing to MIT AND Apache-2.0 WITH LLVM-exception #717

Merged
merged 1 commit into from
Oct 26, 2024

Conversation

tgross35
Copy link
Contributor

@tgross35 tgross35 commented Oct 25, 2024

Currently, Cargo.toml specifies Apache-2.0 OR MIT, but LICENSE.txt describes MIT OR NCSA. compiler-builtins is derived from LLVM's compiler-rt. LICENSE.txt correctly reflects the state of compiler-rt prior to relicensing on 2019-01-19, during which time software was available for use under either MIT or the University of Illinois NCSA license. After relicensing, however, compiler-rt is available for use only under Apache-2.0 with the LLVM exception; this is not reflected anywhere in the repository.

Update the SPDX license identifier to MIT AND Apache-2.0 WITH LLVM-exception AND (MIT OR Apache-2.0). Each AND portion covers something specific:

  • Apache-2.0 WITH LLVM-exception: this covers work that is derived from the LLVM repository since after the LLVM relicensing.
  • MIT: This covers work that is derived from LLVM before the LLVM relicensing (under MIT OR NCSA), as well as the vendored libm components.
  • MIT AND Apache-2.0: This ensures that any contributions to this repository, in addition to meeting the above required licenses, is also released for use under the Rust-standard Apache-2.0 with no LLVM exception.

See also the parallel license update in rust-lang/libm [1].

Fixes: #307
Closes: #511
Link: https://rust-lang.zulipchat.com/#narrow/channel/335408-foundation/topic/Request.20for.20legal.20team.20input.20on.20crate.20licensing
Link: rust-lang/libm#317 [1]

@tgross35
Copy link
Contributor Author

One thing I am not certain about here; anyone who contributed to this repository between the 2019-01-19 LLVM relicense and now did so with no mention of Apache-2.0 WITH LLVM-exception being present in this repository. Do we need to get their acknowledgement to license this crate for use under Apache-2.0 WITH LLVM-exception AND MIT?

I think it could be sufficient that any work derived from an Apache-2.0 WITH LLVM-exception source is implicitly made available under that same license, even though there is no mention in this repository, but I am not sure of these technicalities.

@beetrees
Copy link
Contributor

beetrees commented Oct 25, 2024

I think it could be sufficient that any work derived from an Apache-2.0 WITH LLVM-exception source is implicitly made available under that same license, even though there is no mention in this repository, but I am not sure of these technicalities.

IANAL, but I don't think it works like that. Even with copyleft licenses, any modifications aren't automatically licensed under the same license (with copyleft, not licensing the modifications compatibly just means that you're violating the original license, not that your modifications are automatically correctly licensed).

That said, there's no requirement for changes to Apache-2.0 WITH LLVM-exception code to be licensed identically, so AFAICT any modifications to the LLVM Apache-2.0 WITH LLVM-exception code would be licensed the same as any other original contribution to compiler-builtins.

@tgross35
Copy link
Contributor Author

IANAL, but I don't think it works like that. Even with copyleft licenses, any modifications aren't automatically licensed under the same license (with copyleft, not licensing the modifications compatibly just means that you're violating the original license, not that your modifications are automatically correctly licensed).

Yeah, I think you are right. I am hoping for some sort of sound way to correct the licensing without needing to get an okay from all contributors since LLVM's relicense (~150) but I'm not sure if that is feasible.

There is some more discussion on the Zulip link asked in the top post if you want to drop in, but this is one question I haven't yet heard back about.

That said, there's no requirement for changes to Apache-2.0 WITH LLVM-exception code to be licensed identically, so AFAICT any modifications to the LLVM Apache-2.0 WITH LLVM-exception code would be licensed the same as any other original contribution to compiler-builtins.

I don't think I follow here - what is the Apache-2.0 WITH LLVM-exception code? AIUI there is none in this repository since it was never part of the license here, even though it should all be under that license.

@joshtriplett
Copy link
Member

@tgross35 The license updates look correct to me. We also need to make sure we preserve any relevant copyright notices here.

@tgross35
Copy link
Contributor Author

I don't know of any copyrights that are relevant here. Searching for "copyright" in the LLVM directory only comes up with a few results we don't use https://github.com/search?q=repo%3Allvm%2Fllvm-project+path%3A%2F%5Ecompiler-rt%5C%2F%2F+copyright&type=code and the current license literally says "Copyright [yyyy] [name of copyright owner]"

LICENSE.txt Outdated
Comment on lines 254 to 261
* compiler-builtins is derived from LLVM's compiler-rt (https://llvm.org/).
Work derived form compiler-rt prior to 2019-01-19 is usable under the MIT
license, with the following copyright:

Copyright (c) 2009-2016 by the contributors listed in CREDITS.TXT

The relevant CREDITS.TXT is located at
https://github.com/llvm/llvm-project/blob/main/compiler-rt/CREDITS.TXT.
Copy link
Contributor Author

@tgross35 tgross35 Oct 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joshtriplett but I did include this to cover the copyright in the old license

(just fixed the form/from typo I noticed here)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I don't think we have a legal requirement to, we might want to consider reproducing CREDITS.TXT (inlined into LICENSE.txt). It's short.

The one caveat there being that if we start including it, we should update our included version if the upstream version changes and we copy any new code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did consider this but it didn't seem like it was ever really used on LLVM's side. The latest update is from two years before compiler-builtins existed, and it had only ever been updated twice before that.

Cargo.toml Outdated
@@ -2,7 +2,7 @@
authors = ["Jorge Aparicio <japaricious@gmail.com>"]
name = "compiler_builtins"
version = "0.1.135"
license = "MIT/Apache-2.0"
license = "Apache-2.0 WITH LLVM-exception AND MIT AND (MIT OR Apache-2.0)"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
license = "Apache-2.0 WITH LLVM-exception AND MIT AND (MIT OR Apache-2.0)"
license = "MIT AND Apache-2.0 WITH LLVM-exception AND (MIT OR Apache-2.0)"

(Minor consistency/readability nit, not a blocker.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, made this change

LICENSE.txt Outdated
Comment on lines 1 to 3
compiler-builtins as a whole is available for use under both the MIT license
and the Apache-2.0 license with the LLVM exception (Apache-2.0 WITH
LLVM-exception AND MIT).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
compiler-builtins as a whole is available for use under both the MIT license
and the Apache-2.0 license with the LLVM exception (Apache-2.0 WITH
LLVM-exception AND MIT).
compiler-builtins as a whole is available for use under both the MIT license
and the Apache-2.0 license with the LLVM exception (`MIT AND Apache-2.0 WITH
LLVM-exception`).

Minor consistency and readability nit. Not a blocker.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

Copy link
Member

@joshtriplett joshtriplett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Posted a couple of minor nits, but they're not blockers.

Currently, Cargo.toml specifies Apache-2.0 OR MIT, but LICENSE.txt
describes MIT OR NCSA. compiler-builtins is derived from LLVM's
compiler-rt. LICENSE.txt correctly reflects the state of compiler-rt
prior to relicensing on 2019-01-19, during which time software was
available for use under either MIT or the University of Illinois NCSA
license. After relicensing, however, compiler-rt is available for use
only under Apache-2.0 with the LLVM exception; this is not reflected
anywhere in the repository.

Update the SPDX license identifier to `MIT AND Apache-2.0 WITH
LLVM-exception AND (MIT OR Apache-2.0)`. Each AND portion covers
something specific:

* Apache-2.0 WITH LLVM-exception: this covers work that is derived from
  the LLVM repository since after the LLVM relicensing.
* MIT: This covers work that is derived from LLVM before the LLVM
  relicensing (under MIT OR NCSA), as well as the vendored `libm`
  components.
* MIT AND Apache-2.0: This ensures that any contributions to this
  repository, in addition to meeting the above required licenses, is
  also released for use under the Rust-standard Apache-2.0 with no LLVM
  exception.

See also the parallel license update in rust-lang/libm [1].

Fixes: rust-lang#307
Closes: rust-lang#511
Link: https://rust-lang.zulipchat.com/#narrow/channel/335408-foundation/topic/Request.20for.20legal.20team.20input.20on.20crate.20licensing
Link: rust-lang/libm#317 [1]
@tgross35 tgross35 changed the title Update licensing to Apache-2.0 WITH LLVM-exception AND MIT Update licensing to MIT AND Apache-2.0 WITH LLVM-exception Oct 26, 2024
@tgross35 tgross35 merged commit 300c34c into rust-lang:master Oct 26, 2024
25 checks passed
@tgross35 tgross35 deleted the update-licensing branch October 26, 2024 22:43
tgross35 added a commit to tgross35/rust that referenced this pull request Oct 26, 2024
This includes:

* The license change
  rust-lang/compiler-builtins#717
* The `libm` submodule update, which also has a license change
  rust-lang/libm#317
* Re-enabling `math` on i686 UEFI
  rust-lang/compiler-builtins#715
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 31, 2024
Update compiler-builtins to 0.1.136

This includes:

* The license change rust-lang/compiler-builtins#717
* The `libm` submodule update, which also has a license change rust-lang/libm#317
* Re-enabling `math` on i686 UEFI rust-lang/compiler-builtins#715

Fixes: rust-lang#128533
tgross35 added a commit to tgross35/rust that referenced this pull request Nov 1, 2024
This includes:

* The license change
  rust-lang/compiler-builtins#717
* The `libm` submodule update, which also has a license change
  rust-lang/libm#317
* Re-enabling `math` on i686 UEFI
  rust-lang/compiler-builtins#715
lnicola pushed a commit to lnicola/rust-analyzer that referenced this pull request Nov 1, 2024
Update compiler-builtins to 0.1.136

This includes:

* The license change rust-lang/compiler-builtins#717
* The `libm` submodule update, which also has a license change rust-lang/libm#317
* Re-enabling `math` on i686 UEFI rust-lang/compiler-builtins#715

Fixes: rust-lang/rust#128533
RalfJung pushed a commit to RalfJung/miri that referenced this pull request Nov 2, 2024
Update compiler-builtins to 0.1.136

This includes:

* The license change rust-lang/compiler-builtins#717
* The `libm` submodule update, which also has a license change rust-lang/libm#317
* Re-enabling `math` on i686 UEFI rust-lang/compiler-builtins#715

Fixes: rust-lang/rust#128533
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crate declares incorrect Apache/MIT license
3 participants