-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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
[bootstrap] Add gcc to dist generation #125419
base: master
Are you sure you want to change the base?
Conversation
|
This PR changes how LLVM is built. Consider updating src/bootstrap/download-ci-llvm-stamp. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
5f791d3
to
6736333
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
From what I can see, it's not possible to tell |
@davidtwco Any suggestions on what to do about the GPL-2.0 license of GCC? |
Will get back to you about this |
@wesleywiser and I discussed this and we're not sure about how to get REUSE to play ball (@pietroalbini might know), but we've forwarded this on to t-compiler's council rep to double-check that adding gcc like this is okay, license-wise. |
Note that REUSE doesn't mark the GPL 2.0 license as deprecated. What is deprecated is referring to it as Also, the warning doesn't come from REUSE itself, but from the SPDX License List (you'll find |
We discussed this at the Council meeting today and we don't have any concerns with this change. However, we would like to confirm with the Foundation. @abibroom - do you know of any concerns from the Foundation side (feel free to ping me on Zulip or reach out via email if you'd rather not discuss this publicly. From my understanding, this change would add libgccjit as an optional component to the Rust distribution. This library is licensed under GPLv2 and currently we do not have any other components under that license so it would be a new license, and one that is generally more restrictive than the other licenses we use. |
@bors try Just to see what happens on Linux dist. |
@@ -2365,6 +2366,10 @@ impl Step for RustDev { | |||
// just broadly useful to be able to link against the bundled LLVM. | |||
tarball.add_dir(builder.llvm_out(target).join("include"), "include"); | |||
|
|||
tarball.add_dir(builder.gcc_out(target).join("install/lib/libgccjit.so"), "libgccjit.so"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What will this do on Windows? 🤔 Does the gcc build also work on non-Linux OSes, in general?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it doesn't, good catch!
[bootstrap] Add gcc to dist generation As `@eholk` summarized below: > From my understanding, this change would add libgccjit as an optional component to the Rust distribution. This library is licensed under GPLv2 and currently we do not have any other components under that license so it would be a new license, and one that is generally more restrictive than the other licenses we use. It'll greatly improve the experience for anyone wanting to work on the GCC backend from the compiler. Should help with rust-lang#124172. Will unblock rust-lang#124353. r? `@Kobzol`
Can this be done without adding gcc as a submodule? |
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
I'd like to be able to say this is all fine, but want to run it past Foundation legal counsel first just to make sure. Please bear with me whilst that happens! |
We should be good to go with this. Legal raised two points, neither of which I believe to be blocking concerns:
|
@abibroom - just to make sure, if someone wanted to make a downstream binary distribution without releasing source code (which strikes me as rather unlikely), they could still do so if they chose not to include the libgccjit component? I want to make sure this change doesn't effectively mean we have to relicense Rust as GPL2. |
Assuming that cg_gcc does the same for distribution as cg_clif, all GCC components and the GCC backend itself will end up in a rustc-codegen-gcc-preview component which would need to be separately installed (using eg |
f302cfd
to
b3fa1c2
Compare
This comment has been minimized.
This comment has been minimized.
b3fa1c2
to
ca33917
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
As you can see @pietroalbini, REUSE wants |
Based on #125419 (comment) it looks like the deprecated license originates in three files
would it be possible to patch these to specify All three currently contain: /* Adapted from code in the Linux kernel, which has this: */
/* SPDX-License-Identifier: GPL-2.0 */ |
I'll simply remove them... EDIT: Ah since it's our fork, I suppose it's ok to change the license there. |
Based on https://github.com/torvalds/linux/blob/master/LICENSES/preferred/GPL-2.0
and the comment mentioning that the license is chosen based on them being derived from Linux kernel files with |
Note that the libgccjit library is licensed under GPLv3, not GPLv2 (I'm the author/maintainer of libgccjit, but it's mostly just a thin wrapper around GCC's own code hence GPLv3). Are you basing the GPLv2 thing on those SPDX identifiers from the three files in the testsuite? Those are taken/adapted from the Linux kernel and thus GPLv2 only, AIUI. |
That's what I inferred as well: rust-lang/gcc#61 |
I think I fixed all issues here. Is there anything else that remains to be done? |
0a58112
to
fa6eb5b
Compare
fa6eb5b
to
7319664
Compare
I'd like to repeat this question:
Does distributing libgcc require gcc to be an actual submodule in the rust repo? Does this make gcc part of the rustc-src tarballs? |
I originally went for a commit hash stored in a file but I was asked (at least that's what I remember but maybe I'm wrong) to use a git submodule instead to make things simpler.
Normally no but we'll need someone from infra to answer this question. |
Yes, because the submodule is under the As of the current shape of this PR, there is Edit: you can try this locally using |
Thanks for clarifying @Kobzol ! So what remains to be discussed here? |
As @eholk summarized below:
It'll greatly improve the experience for anyone wanting to work on the GCC backend from the compiler.
Should help with #124172.
Will unblock #124353.
r? @Kobzol