4 ms·
Why the heck do all the platforms have 'unknown' in them? It seems stupid. > mips-unknown-linux-gnu > wasm32-unknown-emscripten > arm-unknown-linux-musleabi W
by andrewchambers 10y ago
Why the heck do all the platforms have 'unknown' in them? It seems stupid.
> mips-unknown-linux-gnu
> wasm32-unknown-emscripten
> arm-unknown-linux-musleabi
What value does that garbage add to it?
- steveklabnik 10y agoHistorically, that part of a target triple is used to indicate a specific "vendor," so you have "mips-unknown-linux-gnu" vs "mips-debian-linux-gnu", where the former is for all linuxes, but the latter is specific to Debian. See here: http://clang.llvm.org/docs/CrossCompilation.html#target-triple http://clang.llvm.org/docs/CrossCompilation.html#target-trip...
- andrewchambers 10y agoSo a target triple is really a target quad (makes perfect sense). Tbh, leaving it out would or using the word "generic" would be far better than unknown.
- steveklabnik 10y agoLeaving it out means that it's harder to parse, which isn't the worst thing in the world, but the explicitness is helpful, IMO. "generic" would work too, but this is a long-standing convention, so that ship has probably sailed.
- glandium 10y agoHarder to parse is one thing, but if it could match the output of config.guess, and/or allow to skip the "unknown" part so that the triples match what's used for GCC prefixes and clang's --target, that would be way nicer. https://github.com/rust-lang/rust/issues/33147 https://github.com/rust-lang/rust/issues/33147
- Manishearth 10y agoYou already leave out the ABI for some kernels (e.g. x86_64-apple-darwin), so it would be ambiguous otherwise.
- Manishearth 10y agoThat's how target triples work. http://wiki.osdev.org/Target_Triplet http://wiki.osdev.org/Target_Triplet The "unknown" is the vendor field. Most linux OSes don't have a "vendor". Target triples are of the form arch-vendor-kernel, and the -kernel is sometimes in the form -kernel-abi) So you can have x86_64-pc-windows-gnu or x86_64-pc-windows-msvc or x86_64-apple-darwin with the vendor field set. Most of the OSes with non-unknown vendors already have Rust binaries, so most new platforms will be unknown.
- stymaar 10y agoThank you ! Maybe this could be documented somewhere on the rustup doc so new users like me aren't puzzled by this strange “unknown” everywhere. Or maybe it is, and I just didn't find it because I was too lazy to look explicitly for it …