mirror of
https://github.com/astral-sh/uv.git
synced 2025-11-03 13:14:41 +00:00
Add additional ARM targets to release (#2417)
Closes https://github.com/astral-sh/uv/issues/2415. Closes https://github.com/astral-sh/uv/issues/2416.
This commit is contained in:
parent
fbb8bc1f6f
commit
c296da34bf
4 changed files with 35 additions and 23 deletions
16
.github/workflows/build-binaries.yml
vendored
16
.github/workflows/build-binaries.yml
vendored
|
|
@ -272,6 +272,10 @@ jobs:
|
||||||
maturin_docker_options: -e JEMALLOC_SYS_WITH_LG_PAGE=16
|
maturin_docker_options: -e JEMALLOC_SYS_WITH_LG_PAGE=16
|
||||||
- target: armv7-unknown-linux-gnueabihf
|
- target: armv7-unknown-linux-gnueabihf
|
||||||
arch: armv7
|
arch: armv7
|
||||||
|
- target: armv7-unknown-linux-musleabihf
|
||||||
|
arch: armv7
|
||||||
|
- target: arm-unknown-linux-musleabihf
|
||||||
|
arch: arm
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
@ -284,15 +288,15 @@ jobs:
|
||||||
uses: PyO3/maturin-action@v1
|
uses: PyO3/maturin-action@v1
|
||||||
with:
|
with:
|
||||||
target: ${{ matrix.platform.target }}
|
target: ${{ matrix.platform.target }}
|
||||||
manylinux: 2_28
|
# On `aarch64`, use `manylinux: 2_28`; otherwise, use `manylinux: auto`.
|
||||||
|
manylinux: ${{ matrix.platform.arch == 'aarch64' && '2_28' || 'auto' }}
|
||||||
docker-options: ${{ matrix.platform.maturin_docker_options }}
|
docker-options: ${{ matrix.platform.maturin_docker_options }}
|
||||||
args: --release --locked --out dist
|
args: --release --locked --out dist
|
||||||
- uses: uraimo/run-on-arch-action@v2
|
- uses: uraimo/run-on-arch-action@v2
|
||||||
if: matrix.platform.arch != 'ppc64'
|
|
||||||
name: Test wheel
|
name: Test wheel
|
||||||
with:
|
with:
|
||||||
arch: ${{ matrix.platform.arch }}
|
arch: ${{ matrix.platform.arch == 'arm' && 'armv6' || matrix.platform.arch }}
|
||||||
distro: ubuntu20.04
|
distro: ${{ matrix.platform.arch == 'arm' && 'bullseye' || 'ubuntu20.04' }}
|
||||||
githubToken: ${{ github.token }}
|
githubToken: ${{ github.token }}
|
||||||
install: |
|
install: |
|
||||||
apt-get update
|
apt-get update
|
||||||
|
|
@ -302,6 +306,8 @@ jobs:
|
||||||
pip3 install ${{ env.PACKAGE_NAME }} --no-index --find-links dist/ --force-reinstall
|
pip3 install ${{ env.PACKAGE_NAME }} --no-index --find-links dist/ --force-reinstall
|
||||||
${{ env.MODULE_NAME }} --help
|
${{ env.MODULE_NAME }} --help
|
||||||
- name: "Upload wheels"
|
- name: "Upload wheels"
|
||||||
|
# Skip for `arm`, which is not supported by PyPI.
|
||||||
|
if: ${{ matrix.platform.arch != 'arm' }}
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: wheels-${{ matrix.platform.target }}
|
name: wheels-${{ matrix.platform.target }}
|
||||||
|
|
@ -534,8 +540,6 @@ jobs:
|
||||||
- target: aarch64-unknown-linux-musl
|
- target: aarch64-unknown-linux-musl
|
||||||
arch: aarch64
|
arch: aarch64
|
||||||
maturin_docker_options: -e JEMALLOC_SYS_WITH_LG_PAGE=16
|
maturin_docker_options: -e JEMALLOC_SYS_WITH_LG_PAGE=16
|
||||||
- target: armv7-unknown-linux-musleabihf
|
|
||||||
arch: armv7
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
|
||||||
|
|
@ -172,7 +172,7 @@ windows-archive = ".zip"
|
||||||
# The archive format to use for non-windows builds (defaults .tar.xz)
|
# The archive format to use for non-windows builds (defaults .tar.xz)
|
||||||
unix-archive = ".tar.gz"
|
unix-archive = ".tar.gz"
|
||||||
# Target platforms to build apps for (Rust target-triple syntax)
|
# Target platforms to build apps for (Rust target-triple syntax)
|
||||||
targets = ["aarch64-unknown-linux-gnu", "x86_64-unknown-linux-gnu", "i686-unknown-linux-gnu", "aarch64-apple-darwin", "x86_64-apple-darwin", "aarch64-unknown-linux-musl", "x86_64-unknown-linux-musl", "i686-unknown-linux-musl", "x86_64-pc-windows-msvc", "i686-pc-windows-msvc", "armv7-unknown-linux-gnueabihf", "powerpc64-unknown-linux-gnu", "powerpc64le-unknown-linux-gnu", "s390x-unknown-linux-gnu"]
|
targets = ["aarch64-unknown-linux-gnu", "x86_64-unknown-linux-gnu", "i686-unknown-linux-gnu", "aarch64-apple-darwin", "x86_64-apple-darwin", "aarch64-unknown-linux-musl", "x86_64-unknown-linux-musl", "i686-unknown-linux-musl", "x86_64-pc-windows-msvc", "i686-pc-windows-msvc", "armv7-unknown-linux-gnueabihf", "powerpc64-unknown-linux-gnu", "powerpc64le-unknown-linux-gnu", "s390x-unknown-linux-gnu", "armv7-unknown-linux-musleabihf", "arm-unknown-linux-musleabihf"]
|
||||||
# Whether to auto-include files like READMEs and CHANGELOGs (default true)
|
# Whether to auto-include files like READMEs and CHANGELOGs (default true)
|
||||||
auto-includes = false
|
auto-includes = false
|
||||||
# Whether cargo-dist should create a Github Release or use an existing draft
|
# Whether cargo-dist should create a Github Release or use an existing draft
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,7 @@ impl fmt::Display for Os {
|
||||||
pub enum Arch {
|
pub enum Arch {
|
||||||
#[serde(alias = "arm64")]
|
#[serde(alias = "arm64")]
|
||||||
Aarch64,
|
Aarch64,
|
||||||
|
Armv6L,
|
||||||
Armv7L,
|
Armv7L,
|
||||||
Powerpc64Le,
|
Powerpc64Le,
|
||||||
Powerpc64,
|
Powerpc64,
|
||||||
|
|
@ -89,6 +90,7 @@ impl fmt::Display for Arch {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
match *self {
|
match *self {
|
||||||
Self::Aarch64 => write!(f, "aarch64"),
|
Self::Aarch64 => write!(f, "aarch64"),
|
||||||
|
Self::Armv6L => write!(f, "armv6l"),
|
||||||
Self::Armv7L => write!(f, "armv7l"),
|
Self::Armv7L => write!(f, "armv7l"),
|
||||||
Self::Powerpc64Le => write!(f, "ppc64le"),
|
Self::Powerpc64Le => write!(f, "ppc64le"),
|
||||||
Self::Powerpc64 => write!(f, "ppc64"),
|
Self::Powerpc64 => write!(f, "ppc64"),
|
||||||
|
|
@ -100,13 +102,18 @@ impl fmt::Display for Arch {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Arch {
|
impl Arch {
|
||||||
/// Returns the oldest possible Manylinux tag for this architecture
|
/// Returns the oldest possible `manylinux` tag for this architecture, if it supports
|
||||||
pub fn get_minimum_manylinux_minor(&self) -> u16 {
|
/// `manylinux`.
|
||||||
|
pub fn get_minimum_manylinux_minor(&self) -> Option<u16> {
|
||||||
match self {
|
match self {
|
||||||
// manylinux 2014
|
// manylinux 2014
|
||||||
Self::Aarch64 | Self::Armv7L | Self::Powerpc64 | Self::Powerpc64Le | Self::S390X => 17,
|
Self::Aarch64 | Self::Armv7L | Self::Powerpc64 | Self::Powerpc64Le | Self::S390X => {
|
||||||
|
Some(17)
|
||||||
|
}
|
||||||
// manylinux 1
|
// manylinux 1
|
||||||
Self::X86 | Self::X86_64 => 5,
|
Self::X86 | Self::X86_64 => Some(5),
|
||||||
|
// unsupported
|
||||||
|
Self::Armv6L => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -336,18 +336,19 @@ fn compatible_tags(platform: &Platform) -> Result<Vec<String>, PlatformError> {
|
||||||
let platform_tags = match (&os, arch) {
|
let platform_tags = match (&os, arch) {
|
||||||
(Os::Manylinux { major, minor }, _) => {
|
(Os::Manylinux { major, minor }, _) => {
|
||||||
let mut platform_tags = vec![format!("linux_{}", arch)];
|
let mut platform_tags = vec![format!("linux_{}", arch)];
|
||||||
platform_tags.extend(
|
if let Some(min_minor) = arch.get_minimum_manylinux_minor() {
|
||||||
(arch.get_minimum_manylinux_minor()..=*minor)
|
platform_tags.extend(
|
||||||
.map(|minor| format!("manylinux_{major}_{minor}_{arch}")),
|
(min_minor..=*minor).map(|minor| format!("manylinux_{major}_{minor}_{arch}")),
|
||||||
);
|
);
|
||||||
if (arch.get_minimum_manylinux_minor()..=*minor).contains(&12) {
|
if (min_minor..=*minor).contains(&12) {
|
||||||
platform_tags.push(format!("manylinux2010_{arch}"));
|
platform_tags.push(format!("manylinux2010_{arch}"));
|
||||||
}
|
}
|
||||||
if (arch.get_minimum_manylinux_minor()..=*minor).contains(&17) {
|
if (min_minor..=*minor).contains(&17) {
|
||||||
platform_tags.push(format!("manylinux2014_{arch}"));
|
platform_tags.push(format!("manylinux2014_{arch}"));
|
||||||
}
|
}
|
||||||
if (arch.get_minimum_manylinux_minor()..=*minor).contains(&5) {
|
if (min_minor..=*minor).contains(&5) {
|
||||||
platform_tags.push(format!("manylinux1_{arch}"));
|
platform_tags.push(format!("manylinux1_{arch}"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
platform_tags
|
platform_tags
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue