Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
16 changes: 15 additions & 1 deletion crates/rattler_conda_types/src/platform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pub enum Platform {
LinuxAarch64,
LinuxArmV6l,
LinuxArmV7l,
LinuxLoong64,
LinuxPpc64le,
LinuxPpc64,
LinuxPpc,
Expand Down Expand Up @@ -63,6 +64,7 @@ pub enum Arch {
Arm64,
ArmV6l,
ArmV7l,
Loong64,
Ppc64le,
Ppc64,
Ppc,
Expand Down Expand Up @@ -96,6 +98,9 @@ impl Platform {
return Platform::LinuxArmV6l;
}

#[cfg(target_arch = "loongarch64")]
return Platform::LinuxLoong64;

#[cfg(all(target_arch = "powerpc64", target_endian = "little"))]
return Platform::LinuxPpc64le;

Expand Down Expand Up @@ -123,7 +128,8 @@ impl Platform {
target_arch = "arm",
target_arch = "powerpc64",
target_arch = "powerpc",
target_arch = "s390x"
target_arch = "s390x",
target_arch = "loongarch64"
)))]
compile_error!("unsupported linux architecture");
}
Expand Down Expand Up @@ -203,6 +209,7 @@ impl Platform {
| Platform::LinuxAarch64
| Platform::LinuxArmV6l
| Platform::LinuxArmV7l
| Platform::LinuxLoong64
| Platform::LinuxPpc64le
| Platform::LinuxPpc64
| Platform::LinuxPpc
Expand All @@ -226,6 +233,7 @@ impl Platform {
| Platform::LinuxAarch64
| Platform::LinuxArmV6l
| Platform::LinuxArmV7l
| Platform::LinuxLoong64
| Platform::LinuxPpc64le
| Platform::LinuxPpc64
| Platform::LinuxPpc
Expand Down Expand Up @@ -270,6 +278,7 @@ impl FromStr for Platform {
"linux-aarch64" => Platform::LinuxAarch64,
"linux-armv6l" => Platform::LinuxArmV6l,
"linux-armv7l" => Platform::LinuxArmV7l,
"linux-loong64" => Platform::LinuxLoong64,
"linux-ppc64le" => Platform::LinuxPpc64le,
"linux-ppc64" => Platform::LinuxPpc64,
"linux-ppc" => Platform::LinuxPpc,
Expand Down Expand Up @@ -302,6 +311,7 @@ impl From<Platform> for &'static str {
Platform::LinuxAarch64 => "linux-aarch64",
Platform::LinuxArmV6l => "linux-armv6l",
Platform::LinuxArmV7l => "linux-armv7l",
Platform::LinuxLoong64 => "linux-loong64",
Platform::LinuxPpc64le => "linux-ppc64le",
Platform::LinuxPpc64 => "linux-ppc64",
Platform::LinuxPpc => "linux-ppc",
Expand Down Expand Up @@ -330,6 +340,7 @@ impl Platform {
Platform::Unknown | Platform::NoArch => None,
Platform::LinuxArmV6l => Some(Arch::ArmV6l),
Platform::LinuxArmV7l => Some(Arch::ArmV7l),
Platform::LinuxLoong64 => Some(Arch::Loong64),
Platform::LinuxPpc64le => Some(Arch::Ppc64le),
Platform::LinuxPpc64 => Some(Arch::Ppc64),
Platform::LinuxPpc => Some(Arch::Ppc),
Expand Down Expand Up @@ -404,6 +415,7 @@ impl FromStr for Arch {
"arm64" => Arch::Arm64,
"armv6l" => Arch::ArmV6l,
"armv7l" => Arch::ArmV7l,
"loong64" => Arch::Loong64,
"ppc64le" => Arch::Ppc64le,
"ppc64" => Arch::Ppc64,
"ppc" => Arch::Ppc,
Expand All @@ -430,6 +442,7 @@ impl From<Arch> for &'static str {
Arch::Aarch64 => "aarch64",
Arch::ArmV6l => "armv6l",
Arch::ArmV7l => "armv7l",
Arch::Loong64 => "loong64",
Arch::Ppc64le => "ppc64le",
Arch::Ppc64 => "ppc64",
Arch::Ppc => "ppc",
Expand Down Expand Up @@ -518,6 +531,7 @@ mod tests {
assert_eq!(Platform::LinuxAarch64.arch(), Some(Arch::Aarch64));
assert_eq!(Platform::LinuxArmV6l.arch(), Some(Arch::ArmV6l));
assert_eq!(Platform::LinuxArmV7l.arch(), Some(Arch::ArmV7l));
assert_eq!(Platform::LinuxLoong64.arch(), Some(Arch::Loong64));
assert_eq!(Platform::LinuxPpc64le.arch(), Some(Arch::Ppc64le));
assert_eq!(Platform::LinuxPpc64.arch(), Some(Arch::Ppc64));
assert_eq!(Platform::LinuxPpc.arch(), Some(Arch::Ppc));
Expand Down
1 change: 1 addition & 0 deletions crates/rattler_virtual_packages/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,7 @@ impl Archspec {
Platform::Win32 | Platform::Linux32 => "x86",
Platform::Win64 | Platform::Osx64 | Platform::Linux64 => "x86_64",
Platform::LinuxAarch64 | Platform::LinuxArmV6l | Platform::LinuxArmV7l => "aarch64",
Platform::LinuxLoong64 => "loong64",
Platform::LinuxPpc64le => "ppc64le",
Platform::LinuxPpc64 => "ppc64",
Platform::LinuxPpc => "ppc",
Expand Down
Loading