Skip to content

Add --target HOST alias?  #6775

Closed
Closed
@phil-opp

Description

@phil-opp

Would it be possible to make --target HOST an alias that builds for the target triple of the host system? On Linux x86_64, it would be equivalent to --target x86_64-unknown-linux-gnu and on Windows it would be equivalent to the Windows triple.

This would be useful for crates that override the default target in a .cargo/config file, but still want to run some commands on the host sometimes. The advantage over specifying the target explicitly is that --target HOST is portable across systems and can thus be used in scripts or cargo subcommand aliases.

An example are embedded crates that are compiled for an ARM board most of the time and thus override the default target for convenience. But for unit tests, the crates want to execute cargo test on the host system.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions