Skip to content
Open
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
3 changes: 3 additions & 0 deletions libmamba/include/mamba/specs/platform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ namespace mamba::specs
linux_s390x,
linux_riscv32,
linux_riscv64,
linux_loongarch64,
osx_64,
osx_arm64,
win_32,
Expand Down Expand Up @@ -190,6 +191,8 @@ namespace mamba::specs
return "linux-riscv32";
case KnownPlatform::linux_riscv64:
return "linux-riscv64";
case KnownPlatform::linux_loongarch64:
return "linux-loongarch64";
case KnownPlatform::osx_64:
return "osx-64";
case KnownPlatform::osx_arm64:
Expand Down
5 changes: 4 additions & 1 deletion libmamba/src/specs/platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ namespace mamba::specs
|| (plat == KnownPlatform::linux_ppc64) //
|| (plat == KnownPlatform::linux_s390x) //
|| (plat == KnownPlatform::linux_riscv32) //
|| (plat == KnownPlatform::linux_riscv64);
|| (plat == KnownPlatform::linux_riscv64) //
|| (plat == KnownPlatform::linux_loongarch64);
}

auto platform_is_linux(DynamicPlatform plat) -> bool
Expand Down Expand Up @@ -119,6 +120,8 @@ namespace mamba::specs
return KnownPlatform::linux_riscv32;
#elif defined(__riscv) && defined(__riscv_xlen) && (__riscv_xlen == 64)
return KnownPlatform::linux_riscv64;
#elif defined(__loongarch64)
return KnownPlatform::linux_loongarch64;
#else
#error "Unknown Linux platform"
#endif
Expand Down
11 changes: 7 additions & 4 deletions libmamba/tests/src/specs/test_platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ namespace
SECTION("name")
{
REQUIRE(platform_name(KnownPlatform::linux_riscv32) == "linux-riscv32");
REQUIRE(platform_name(KnownPlatform::linux_loongarch64) == "linux-loongarch64");
REQUIRE(platform_name(KnownPlatform::osx_arm64) == "osx-arm64");
REQUIRE(platform_name(KnownPlatform::win_64) == "win-64");
}

SECTION("parse")
{
REQUIRE(platform_parse("linux-armv6l") == KnownPlatform::linux_armv6l);
REQUIRE(platform_parse("linux-loongarch64") == KnownPlatform::linux_loongarch64);
REQUIRE(platform_parse(" win-32 ") == KnownPlatform::win_32);
REQUIRE(platform_parse(" OSX-64") == KnownPlatform::osx_64);
REQUIRE(platform_parse("linus-46") == std::nullopt);
Expand All @@ -32,10 +34,11 @@ namespace
SECTION("known_platform")
{
static constexpr decltype(known_platform_names()) expected{
"noarch", "linux-32", "linux-64", "linux-armv6l", "linux-armv7l",
"linux-aarch64", "linux-ppc64le", "linux-ppc64", "linux-s390x", "linux-riscv32",
"linux-riscv64", "osx-64", "osx-arm64", "win-32", "win-64",
"win-arm64", "zos-z",
"noarch", "linux-32", "linux-64", "linux-armv6l",
"linux-armv7l", "linux-aarch64", "linux-ppc64le", "linux-ppc64",
"linux-s390x", "linux-riscv32", "linux-riscv64", "linux-loongarch64",
"osx-64", "osx-arm64", "win-32", "win-64",
"win-arm64", "zos-z",

};
REQUIRE(expected == known_platform_names());
Expand Down
1 change: 1 addition & 0 deletions libmambapy/bindings/specs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ namespace mambapy
std::pair{ "linux_s390x", KnownPlatform::linux_s390x },
std::pair{ "linux_riscv32", KnownPlatform::linux_riscv32 },
std::pair{ "linux_riscv64", KnownPlatform::linux_riscv64 },
std::pair{ "linux_loongarch64", KnownPlatform::linux_loongarch64 },
std::pair{ "osx_64", KnownPlatform::osx_64 },
std::pair{ "osx_arm64", KnownPlatform::osx_arm64 },
std::pair{ "win_32", KnownPlatform::win_32 },
Expand Down
1 change: 1 addition & 0 deletions libmambapy/tests/test_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def test_KnownPlatform():
assert KnownPlatform.linux_s390x.name == "linux_s390x"
assert KnownPlatform.linux_riscv32.name == "linux_riscv32"
assert KnownPlatform.linux_riscv64.name == "linux_riscv64"
assert KnownPlatform.linux_loongarch64.name == "linux_loongarch64"
assert KnownPlatform.osx_64.name == "osx_64"
assert KnownPlatform.osx_arm64.name == "osx_arm64"
assert KnownPlatform.win_32.name == "win_32"
Expand Down
Loading