Skip to content

Fix conversion from PartialTargetTriple to TargetTriple #3467

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 107 additions & 15 deletions src/dist/triple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,46 +5,138 @@ use regex::Regex;
// the PartialTargetTriple.

static LIST_ARCHS: &[&str] = &[
"i386",
"i586",
"i686",
"x86_64",
"aarch64",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to check, where did you source these lists of current arches, OSes and envs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copied all the targets from the Platform Support section of the rustc book and created the lists manually. I'm not sure if these lists already exist somewhere, so I created them manually.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, maybe add a docstring linking to a section in the book for each of these constants?

"arm",
"armebv7r",
"armv5te",
"armv7",
"armv7a",
"armv7r",
"armv7s",
"aarch64",
"asmjs",
"avr",
"bpfeb",
"bpfel",
"hexagon",
"i386",
"i586",
"i686",
"loongarch64",
"mips",
"mipsel",
"mips64",
"mips64el",
"mipsel",
"mipsisa32r6",
"mipsisa32r6el",
"msp430",
"nvptx64",
"powerpc",
"powerpc64",
"powerpc64le",
"riscv32gc",
"riscv32i",
"riscv32im",
"riscv32imac",
"riscv32imc",
"riscv64gc",
"riscv64imac",
"s390x",
"loongarch64",
"sparc",
"sparc64",
"sparcv9",
"thumbv4t",
"thumbv5te",
"thumbv6m",
"thumbv7a",
"thumbv7em",
"thumbv7m",
"thumbv7neon",
"thumbv8m.base",
"thumbv8m.main",
"wasm32",
"wasm64",
"x86_64",
"x86_64h",
];
static LIST_OSES: &[&str] = &[
"pc-windows",
"unknown-linux",
"apple-darwin",
"unknown-netbsd",
"apple-ios",
"apple-tvos",
"apple-watchos",
"esp-espidf",
"fortanix-unknown",
"fuchsia",
"ibm-aix",
"kmc-solid_asp3",
"linux",
"nintendo-3ds",
"nintendo-switch",
"none",
"nvidia-cuda",
"openwrt-linux",
"pc-nto",
"pc-solaris",
"pc-windows",
"rumprun-netbsd",
"sony-psp",
"sony-psx",
"sony-vita",
"sun-solaris",
"unknown-dragonfly",
"unknown-emscripten",
"unknown-freebsd",
"unknown-fuchsia",
"unknown-gnu",
"unknown-haiku",
"unknown-hermit",
"unknown-illumos",
"unknown-l4re",
"unknown-linux",
"unknown-netbsd",
"unknown-none",
"unknown-nto",
"unknown-openbsd",
"unknown-redox",
"unknown-uefi",
"unknown-unknown",
"unknown-xous",
"uwp-windows",
"wasi",
"wrs-vxworks",
];
static LIST_ENVS: &[&str] = &[
"android",
"androideabi",
"atmega328",
"eabi",
"eabihf",
"elf",
"freestanding",
"gnu",
"gnux32",
"msvc",
"gnu_ilp32",
"gnuabi64",
"gnueabi",
"gnueabihf",
"gnuabi64",
"androideabi",
"android",
"gnullvm",
"gnuspe",
"gnux32",
"macabi",
"msvc",
"musl",
"muslabi64",
"musleabi",
"musleabihf",
"newlibeabihf",
"ohos",
"qnx700",
"qnx710",
"sgx",
"sim",
"softfloat",
"spe",
"uclibc",
"uclibceabi",
"uclibceabihf",
];

#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
Expand Down