Skip to content

rustc-1.83 tarball contains a GCC checkout #135606

Description

@maurer

While I understand the motivation for putting a GCC in dev environments / CI (it's good to keep the GCC backend tested), I think it might be overkill to ship it in the source tarball. This has a number of downsides:

  1. It puts GPL source code into the rustc release tarball.
  2. It's a significant increase in the size of the tarball (part of the reason we noticed was that one of the ingestion systems was unhappy with the file count).
  3. To the best of my knowledge, the GCC backend is not stable - providing the ability to build it out of the stable tarball without an additional library doesn't seem necessary.
  4. I suspect that most people who want the GCC backend (e.g. distros, specialized environments) will want to provide their own GCC.

Activity

  1. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Jan 17, 2025
  2. jieyouxu commented on Jan 17, 2025

    @jieyouxu
    Member

    cc @rust-lang/wg-gcc-backend

  3. added
    T-releaseRelevant to the release subteam, which will review and decide on the PR/issue.
    C-discussionCategory: Discussion or questions that doesn't represent real issues.
    A-gccThings relevant to the [future] GCC backend
    and removed
    C-bugCategory: This is a bug.
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Jan 17, 2025
  4. GuillaumeGomez commented on Jan 17, 2025

    @GuillaumeGomez
    Member

    As far as I know, this is not supposed to happen.

    cc @Kobzol

  5. Kobzol commented on Jan 17, 2025

    @Kobzol
    Member

    Well, it's true that right now it's probably not necessary. But my assumption was that once we integrate the GCC backend into bootstrap more, we will in fact also include GCC's source code in this tarball, same as we do for LLVM. The source tarball includes pretty much all the source code from our repo, including submodules and vendored crates.

  6. GuillaumeGomez commented on Jan 17, 2025

    @GuillaumeGomez
    Member

    Ah I thought we were planning to do it only once GCC support in bootstrap was done. My bad.

  7. Kobzol commented on Jan 17, 2025

    @Kobzol
    Member

    I mean, I cannot say that the inclusion was fully intentional, I'm not sure where/how it started happening (probably just by us adding GCC as a submodule or something?). I just wanted to say that eventually, it would happen anyway.

  8. GuillaumeGomez commented on Jan 17, 2025

    @GuillaumeGomez
    Member

    This is fate, no trying to fight against GCC future. 😛

  9. maurer commented on Jan 17, 2025

    @maurer
    ContributorAuthor

    LLVM is offered under an Apache license like the Rust compiler - GCC is not. I think it is a potential accident waiting to happen for people to download the source for something that is supposedly Apache-2.0/MIT licensed and accidentally download something GPL'd.

    I would think that #63232 would lead to more caution when introducing a component with a license like this that is potentially dangerous to users.

    If this is the long term intention of upstream, we're going to have to build a filter on our end to find and delete any potentially GPL'd files during tarball import, and I suspect we won't be the only ones required to do this.

  10. Kobzol commented on Jan 17, 2025

    @Kobzol
    Member

    We don't currently actually use the GPL code in our binary artifacts, we just put GPL source code into the tarball archive (same as we have it in our git repository). But IANAL, and this situation is indeed quite complicated and unclear.

    CC @ehuss - Do you know if this is something that has been cleared by the Foundation's lawyers already?

  11. ehuss commented on Jan 17, 2025

    @ehuss
    Contributor

    I don't have any specific legal insight beyond what was already discussed in #125419. My understanding is that it should be fine (from a legal standpoint) for us to include the GPL parts in the source tarball. We already include code from a very wide range of licenses in there. With #133461 we now have a slightly better communication of those licenses. (Unfortunately we don't have good communication of the relationship between those licenses versus when they are used.)

    But it does seem like a reasonable concern of being considerate to the people who use the source tarball to consider excluding it and making it separate. Looking at the diff from 1.82 to 1.83, the source tarball increased from 210M to 337M (+60%?) which is massive.

    I'm not familiar enough with the requirements for exactly which version of gcc is needed, or if it would be possible to not include that in the source tarball (and have bootstrap fetch it from somewhere, or have the user provide their own copy). However, I think it would be nice to consider doing that.

  12. bjorn3 commented on Jan 17, 2025

    @bjorn3
    Member

    I'm not familiar enough with the requirements for exactly which version of gcc is needed

    A rather recent one I believe + a bunch of patches: gcc-mirror/gcc@master...rust-lang:gcc:master

  13. Kobzol commented on Jan 17, 2025

    @Kobzol
    Member

    I don't have any specific legal insight beyond what was already discussed in #125419. My understanding is that it should be fine (from a legal standpoint) for us to include the GPL parts in the source tarball. We already include code from a very wide range of licenses in there. With #133461 we now have a slightly better communication of those licenses. (Unfortunately we don't have good communication of the relationship between those licenses versus when they are used.)

    But it does seem like a reasonable concern of being considerate to the people who use the source tarball to consider excluding it and making it separate. Looking at the diff from 1.82 to 1.83, the source tarball increased from 210M to 337M (+60%?) which is massive.

    I'm not familiar enough with the requirements for exactly which version of gcc is needed, or if it would be possible to not include that in the source tarball (and have bootstrap fetch it from somewhere, or have the user provide their own copy). However, I think it would be nice to consider doing that.

    Fair enough. Sent #135658 to remove GCC sources from the tarball.

  14. added a commit that references this issue on Jan 20, 2025
  15. added a commit that references this issue on Jan 20, 2025
  16. added
    T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
    on Jan 21, 2025
  17. jieyouxu commented on Jan 21, 2025

    @jieyouxu
    Member

    Reopening to track potential stable/beta backports, nominated in #135658 (comment).

  18. linked a pull request that will close this issue[beta] backports #136650on Feb 6, 2025
  19. cuviper commented on Feb 7, 2025

    @cuviper
    Member

    #136650 backported the removal to beta.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-gccThings relevant to the [future] GCC backendC-discussionCategory: Discussion or questions that doesn't represent real issues.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)T-releaseRelevant to the release subteam, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions