From 98851d2cb3314943fcdd3ccb08e33e4c1ebb18a2 Mon Sep 17 00:00:00 2001 From: Wesley Wiser Date: Tue, 22 Aug 2023 10:25:09 -0400 Subject: [PATCH 1/2] Add additional licensing concerns to docs Content included from https://github.com/rust-lang/compiler-team/issues/220. --- src/licenses.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/licenses.md b/src/licenses.md index 06cd8ae6b..f414b05be 100644 --- a/src/licenses.md +++ b/src/licenses.md @@ -3,3 +3,36 @@ The `rustc` compiler source and standard library are dual licensed under the [Apache License v2.0](https://github.com/rust-lang/rust/blob/master/LICENSE-APACHE) and the [MIT License](https://github.com/rust-lang/rust/blob/master/LICENSE-MIT) unless otherwise specified. Detailed licensing information is available in the [COPYRIGHT document](https://github.com/rust-lang/rust/blob/master/COPYRIGHT) of the `rust-lang/rust` repository. + +## Guidelines for reviewers + +In general, reviewers need to be looking not only for the code quality of contributions but also that they are properly licensed. +We have some tips below for things to look out for when reviewing, but if you ever feel uncertain as to whether some code might be properly licensed, err on the safe side — reach out to the Council or Compiler Team Leads for feedback! + +Things to watch out for: + +- The PR author states that they copied, ported, or adapted the code from some other source. +- There is a comment in the code pointing to a webpage or describing where the algorithm was taken from. +- The algorithm or code pattern seems like it was likely copied from somewhere else. +- When adding new dependencies, double check the dependency's license. + +In all of these cases, we will want to check that source to make sure it it is licensed in a way that is compatible with Rust’s license. + +Examples + +- Porting C code from a GPL project, like GNU binutils, is not allowed. That would require rust itself to be licensed under the GPL. +- Copying code from an algorithms text book may be allowed, but some algorithms are patented. + +## Porting + +Contributions to rustc, especially around platform and compiler intrinsics, often include porting over work from other projects, mainly LLVM and GCC. + +Some general rules apply: + +- Copying work needs to adhere to the original license + - This applies to direct copy & paste + - This also applies to code you looked at and ported + +In general, taking inspiration from other codebases is fine, but please exercise caution when porting code. + +Ports of full libraries (e.g. C libraries shipped with LLVM) must keep the license of the original library. From 124b083248f7de24915bf3a51ade90d4a136bfa2 Mon Sep 17 00:00:00 2001 From: Wesley Wiser Date: Tue, 22 Aug 2023 10:30:26 -0400 Subject: [PATCH 2/2] Fix long lines --- src/licenses.md | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/licenses.md b/src/licenses.md index f414b05be..aa8286714 100644 --- a/src/licenses.md +++ b/src/licenses.md @@ -6,26 +6,33 @@ Detailed licensing information is available in the [COPYRIGHT document](https:// ## Guidelines for reviewers -In general, reviewers need to be looking not only for the code quality of contributions but also that they are properly licensed. -We have some tips below for things to look out for when reviewing, but if you ever feel uncertain as to whether some code might be properly licensed, err on the safe side — reach out to the Council or Compiler Team Leads for feedback! +In general, reviewers need to be looking not only for the code quality of contributions but also +that they are properly licensed. +We have some tips below for things to look out for when reviewing, but if you ever feel uncertain +as to whether some code might be properly licensed, err on the safe side — reach out to the Council +or Compiler Team Leads for feedback! Things to watch out for: - The PR author states that they copied, ported, or adapted the code from some other source. -- There is a comment in the code pointing to a webpage or describing where the algorithm was taken from. +- There is a comment in the code pointing to a webpage or describing where the algorithm was taken +from. - The algorithm or code pattern seems like it was likely copied from somewhere else. - When adding new dependencies, double check the dependency's license. -In all of these cases, we will want to check that source to make sure it it is licensed in a way that is compatible with Rust’s license. +In all of these cases, we will want to check that source to make sure it it is licensed in a way +that is compatible with Rust’s license. Examples -- Porting C code from a GPL project, like GNU binutils, is not allowed. That would require rust itself to be licensed under the GPL. +- Porting C code from a GPL project, like GNU binutils, is not allowed. That would require Rust +itself to be licensed under the GPL. - Copying code from an algorithms text book may be allowed, but some algorithms are patented. ## Porting -Contributions to rustc, especially around platform and compiler intrinsics, often include porting over work from other projects, mainly LLVM and GCC. +Contributions to rustc, especially around platform and compiler intrinsics, often include porting +over work from other projects, mainly LLVM and GCC. Some general rules apply: @@ -33,6 +40,8 @@ Some general rules apply: - This applies to direct copy & paste - This also applies to code you looked at and ported -In general, taking inspiration from other codebases is fine, but please exercise caution when porting code. +In general, taking inspiration from other codebases is fine, but please exercise caution when +porting code. -Ports of full libraries (e.g. C libraries shipped with LLVM) must keep the license of the original library. +Ports of full libraries (e.g. C libraries shipped with LLVM) must keep the license of the original +library.