Determine platform target without Rust?
⚓ Rust 📅 2026-05-27 👤 surdeus 👁️ 1I want to download a compiled rust-based program file onto a system. The program download page has compiled binary programs for different target platforms. e.g. files like
s4_aarch64-unknown-linux-gnu_v0.8.80s4_armv7-unknown-linux-gnueabihf_v0.8.80s4_riscv64gc-unknown-linux-gnu_v0.8.80- etc.
(where the file name is composed of the program name s4, then the platform triple, and then the version)
As a casual program user, I don't know the target for my platform so I don't know which file to download.
Typically I would 1. install Rust, 2. install default-target and 3. run default-target (the program default-target just prints the current platform target).
However, this is a resource-constrained system and/or I have minimal privileges; I cannot install Rust.
How can I determine the current system's Rust platform string without installing Rust?
I'm looking for a programmatic solution that could used within a Unix shell script.
2 posts - 2 participants
🏷️ Rust_feed