Skip to content

How to install a single target from source without building the whole compiler? #63553

Open
@marmistrz

Description

@marmistrz
Contributor

I'm using Arch Linux and my distribution provides a (usually) up-to-date version of rustc & cargo. In particular, I have a system-wide copy of the x86_64-unknown-linux-gnu, placed in /usr/lib/rustlib. Please note that rustup is not used here at all.

Sometimes I need to cross-compile to other targets, such as x86_64-pc-windows-gnu or wasm32-wasi. This has issues, for instance #49078. It also results in unnecessary duplication.

Currently it's possible to build a Rust cross compiler manually, such as the rust-mingw AUR package. Still, this requires building the whole LLVM, compiler, cargo, which takes a lot of time and this is basically emulation of rustup without rustup (there are separate copies of rustc, cargo, etc.)

Is it possible to only compile the required bits, so that one can just supplement the existing system-wide instance of Rust with new target? We can assume that their version will match.

For reference, the rustup steps for wasm32-wasi are:

rustup target add wasm32-wasi

for x86_64-pc-windows-gnu:

rustup install stable-x86_64-pc-windows-gnu
rustup target add x86_64-pc-windows-gnu

Activity

added
A-crossArea: Cross compilation
C-feature-requestCategory: A feature request, i.e: not implemented / a PR.
T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
on Sep 16, 2019
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-crossArea: Cross compilationC-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-compilerRelevant to the compiler team, 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

        Participants

        @marmistrz@joelpalmer

        Issue actions

          How to install a single target from source without building the whole compiler? · Issue #63553 · rust-lang/rust