Skip to content

Support multiple targets #3913

Closed
Closed

Description

@mcandre

Allow users to specify multiple targets, such as both x86_64-unknown-linux-gnu and x86_64-unknown-linux-musl, so that cargo build produces both artifacts.

By the way, how will the filename paths differentiate between multiple targets? Gox allows the target metadata to appear in the destination filepath, for example.

Activity

  1. alexcrichton commented on Apr 10, 2017

    @alexcrichton
    Member

    Sounds like a reasonable feature to implement to me! I think the backend of Cargo isn't quite read to do this kind of operation, but with a small amount of refactoring it should be able to, namely parameterizing Kind to have more than one kind of Target.

  2. added
    A-cross-compilingArea: using --target flag for other platforms
    C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
    on Oct 2, 2017
  3. steveklabnik commented on Nov 30, 2017

    @steveklabnik
    Contributor

    I'm hitting this today; I am writing a client and server both in wasm. Client crate needs to be compiled with one target, the server with another.

  4. michaeleiselsc commented on Mar 20, 2018

    @michaeleiselsc

    if we did this, would it be possible to generate the IR only once but build for multiple backends?

  5. sfackler commented on Mar 20, 2018

    @sfackler
    Member
  6. dwijnand commented on Nov 26, 2018

    @dwijnand
    Contributor

    What does cargo::ops::cargo_rustc::Kind denote?

  7. ehuss commented on Nov 26, 2018

    @ehuss
    Contributor

    What does cargo::ops::cargo_rustc::Kind denote?

    Kind was moved here. Host is used for proc-macros, plugins, and build scripts which must be compiled for the host architecture. Target is used when the user specifies --target.

  8. ehuss commented on Apr 29, 2020

    @ehuss
    Contributor

    Closing in favor of tracking issue #8176.

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-cross-compilingArea: using --target flag for other platformsC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions