---
# System prepended metadata

title: Add a new argument for cargo fetch --target-native

---

# Add a new argument for cargo fetch --target-native

## Problem

To use `cargo fetch` to fetch dependencies of a crate specifically for the native target, callers of cargo have to determine and pass the triple through `--target`. If this build script is a general purpose one which aims to fetch dependencies only targeting the native architecture and build off-line then, this scripts will become quite complicated and not portable. So, I wonder whether it is possible for a new argument for cargo fetch because the native architecture is known by cargo.

A real-world example is package script used by Arch Linux, if we have to determine the architecture in every script, it will definitely be a nightmare. 

## Prevous Discussions

`rustc -vV | awk '/^host:/ { print $2 }'`

rust-lang/cargo#6775

rust-lang/cargo#6777

felixonmars/archriscv-packages#670
