Skip to content

Commit

Permalink
rust-qoriq: Update to 1.82.0 rust toolchain (#6307)
Browse files Browse the repository at this point in the history
* rust-qoriq: update to 1.82.0-powerpc-unknown-linux-gnuspe
- use published rust 1.82.0 for qoriq
- add diyspk/pngquant (part of spk/imagemagick)

* python310: fix build for numpy wheel

---------

Co-authored-by: hgy59 <[email protected]>
  • Loading branch information
th0ma7 and hgy59 authored Nov 7, 2024
1 parent 3ddacb4 commit ac27e7a
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 17 deletions.
8 changes: 4 additions & 4 deletions cross/python310/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ CROSSENV_WHEELS = cffi==1.17.0
# It also breaks numpy at crossenv creation time using github-action
# https://numpy.org/devdocs/reference/distutils_status_migration.html
# Python 3.12 considerations: scikit-build-core, meson-python
CROSSENV_WHEELS += Cython==3.0.2
#CROSSENV_WHEELS += Cython==0.29.37
#CROSSENV_WHEELS += Cython==3.0.2
CROSSENV_WHEELS += Cython==0.29.37
CROSSENV_WHEELS += flit==3.9.0
CROSSENV_WHEELS += scikit-build==0.18.1
CROSSENV_WHEELS += setuptools-rust==1.10.2
Expand All @@ -169,8 +169,8 @@ python310_post_install: $(WORK_DIR)/python-cc.mk
. $(WORK_DIR)/crossenv/bin/activate && $(RUN) wget --no-verbose https://bootstrap.pypa.io/get-pip.py
. $(WORK_DIR)/crossenv/bin/activate && $(RUN) build-python get-pip.py "pip==24.2" --no-setuptools --no-wheel --disable-pip-version-check
. $(WORK_DIR)/crossenv/bin/activate && $(RUN) python get-pip.py "pip==24.2" --no-setuptools --no-wheel --disable-pip-version-check
. $(WORK_DIR)/crossenv/bin/activate && $(RUN) build-pip --disable-pip-version-check install "setuptools==75.1.0" "wheel==0.44.0" "pip-tools==7.4.1"
. $(WORK_DIR)/crossenv/bin/activate && $(RUN) pip --disable-pip-version-check install "setuptools==75.1.0" "wheel==0.44.0" "pip-tools==7.4.1"
. $(WORK_DIR)/crossenv/bin/activate && $(RUN) build-pip --disable-pip-version-check install "setuptools==68.1.2" "wheel==0.44.0" "pip-tools==7.4.1"
. $(WORK_DIR)/crossenv/bin/activate && $(RUN) pip --disable-pip-version-check install "setuptools==68.1.2" "wheel==0.44.0" "pip-tools==7.4.1"
. $(WORK_DIR)/crossenv/bin/activate && $(RUN) build-pip --disable-pip-version-check install $(CROSSENV_WHEELS)
. $(WORK_DIR)/crossenv/bin/activate && $(RUN) pip --disable-pip-version-check install $(CROSSENV_WHEELS)
ifneq ($(PYTHON_LIB_NATIVE),$(PYTHON_LIB_CROSS))
Expand Down
26 changes: 26 additions & 0 deletions diyspk/pngquant/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
SPK_NAME = pngquant
SPK_VERS = 3.0.3
SPK_REV = 1


MAINTAINER = SynoCommunity
DESCRIPTION = pngquant is a command-line utility and a library for lossy compression of PNG images.
DISPLAY_NAME = pngquant
STARTABLE = no

HOMEPAGE = https://pngquant.org/
LICENSE = GPL

include ../../mk/spksrc.archs.mk
ifeq ($(findstring $(ARCH),$(OLD_PPC_ARCHS) $(ARMv5_ARCHS)),$(ARCH))
# std=c11 not fully supported
DEPENDS = cross/pngquant2
SPK_VERS = 2.18.0
else
DEPENDS = cross/pngquant3
endif


SPK_COMMANDS = bin/pngquant

include ../../mk/spksrc.spk.mk
8 changes: 7 additions & 1 deletion mk/spksrc.cross-rust-env.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@ endif

# Set to 1 to force building from
# source Tier-3 toolchains (qoriq)
# ref: https://rustc-dev-guide.rust-lang.org/building/how-to-build-and-run.html
ifeq ($(RUST_BUILD_TOOLCHAIN),)
RUST_BUILD_TOOLCHAIN = 0
endif

# Versions available: https://releases.rs/docs/
ifeq ($(RUST_BUILD_VERSION),)
RUST_BUILD_VERSION = 1.82.0
endif

# Enforce using newer cmake when building Tier-3 toolchains
ifeq ($(RUST_BUILD_TOOLCHAIN),1)
DEPENDS += native/cmake
Expand Down Expand Up @@ -49,7 +55,7 @@ RUST_TARGET = aarch64-unknown-linux-gnu
endif
ifeq ($(findstring $(RUST_ARCH), $(PPC_ARCHS)),$(RUST_ARCH))
RUST_TARGET = powerpc-unknown-linux-gnuspe
TC_RUSTUP_TOOLCHAIN = stage$(RUSTUP_DEFAULT_TOOLCHAIN_STAGE)-$(RUST_TARGET)
TC_RUSTUP_TOOLCHAIN = $(RUST_BUILD_VERSION)-$(RUST_TARGET)
endif
ifeq ($(findstring $(RUST_ARCH), $(x64_ARCHS)),$(RUST_ARCH))
RUST_TARGET = x86_64-unknown-linux-gnu
Expand Down
7 changes: 7 additions & 0 deletions mk/spksrc.tc-rust.mk
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ endif
$(TC_LOCAL_VARS_RUST):
env $(MAKE) --no-print-directory rust_toml > $@ 2>/dev/null;

# https://github.com/rust-lang/rust/blob/master/config.example.toml
.PHONY: rust_toml
rust_toml:
@echo 'profile = "compiler"' ; \
Expand Down Expand Up @@ -112,7 +113,13 @@ else
ifeq ($(RUST_BUILD_TOOLCHAIN),1)
@$(MSG) "Build rust target $(RUST_TARGET) from sources"
@$(MSG) "Building Tier-3 rust target: $(RUST_TARGET)"
ifneq ($(RUST_BUILD_VERSION),)
@$(MSG) "Checkout rust tag $(RUST_BUILD_VERSION)"
@(cd $(WORK_DIR) && [ ! -d rust ] && git clone --depth 1 --branch $(RUST_BUILD_VERSION) https://github.com/rust-lang/rust.git || true)
else
@$(MSG) "Build latests release (current HEAD)"
@(cd $(WORK_DIR) && [ ! -d rust ] && git clone --depth 1 https://github.com/rust-lang/rust.git || true)
endif
@(cd $(WORK_DIR)/rust && rm -f config.toml && ./x setup compiler)
(cd $(WORK_DIR)/rust && \
CFLAGS_$(subst -,_,$(RUST_TARGET))="$(TC_EXTRA_CFLAGS)" \
Expand Down
6 changes: 5 additions & 1 deletion spk/python310/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ SPK_VERS_MAJOR_MINOR = $(word 1,$(subst ., ,$(SPK_VERS))).$(word 2,$(subst ., ,$
SPK_REV = 21
SPK_ICON = src/python3.png

DEPENDS = cross/$(SPK_NAME)
DEPENDS = cross/python310
DEPENDS += cross/pip

MAINTAINER = SynoCommunity
Expand Down Expand Up @@ -108,6 +108,10 @@ include ../../mk/spksrc.spk.mk
## WHEELS_TEST_ALL: Force testing all wheel building
ifeq ($(strip $(WHEELS_TEST_ALL)),1)

# let it find maturin in crossenv
ENV += PATH=$(WORK_DIR)/crossenv/build/bin:$(PATH)


# [greenlet]
ifeq ($(call version_ge, $(TC_GCC), 4.9),1)
WHEELS += src/requirements-crossenv-greenlet-v2.txt
Expand Down
4 changes: 3 additions & 1 deletion spk/python310/src/requirements-crossenv-numpy.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@
# [numpy]
# - Require Cython in cross/python310 crossenv
# - Numpy 1.25.x require c++17
numpy==1.25.2
#numpy==1.25.2
# - Temp. reverted to 1.24.x
numpy==1.24.4
2 changes: 1 addition & 1 deletion spk/python310/src/requirements-pure.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
pip==24.2

# Always match what's in cross/python310/Makefile
setuptools==75.1.0
setuptools==68.1.2
wheel==0.44.0

# Always use latest version available
Expand Down
15 changes: 9 additions & 6 deletions toolchain/syno-qoriq-6.2.4-rust/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
PKG_NAME = rust-qoriq
PKG_VERS = 1.77.0-nightly
PKG_ARCH = qoriq
PKG_NAME = rust-$(PKG_ARCH)
PKG_VERS = 1.82.0
PKG_EXT = txz
PKG_DIST_NAME = stage2_powerpc-unknown-linux-gnuspe.txz
PKG_DIST_SITE = https://github.com/SynoCommunity/spksrc/releases/download/toolchains%2Frust%2F1.77.0-nightly
PKG_DIST_TARGET = $(PKG_VERS)-powerpc-unknown-linux-gnuspe
PKG_DIST_NAME = $(PKG_DIST_TARGET).$(PKG_EXT)
PKG_DIST_SITE = https://github.com/SynoCommunity/spksrc/releases/download/rust/qoriq
EXTRACT_PATH = $(INSTALL_DIR)/$(INSTALL_PREFIX)

DEPENDS =
Expand All @@ -22,8 +24,9 @@ include ../../mk/spksrc.native-install.mk

.PHONY: rust-qoriq-postinstall
rust-qoriq-postinstall:
export PATH="$(CARGO_PATH):$${PATH}" ; \
@$(MSG) "Rustup $(PKG_DIST_TARGET)"
@export PATH="$(CARGO_PATH):$${PATH}" ; \
export RUSTUP_HOME="$(RUSTUP_HOME)" ; \
which rustup ; \
rustup toolchain link stage2-powerpc-unknown-linux-gnuspe $(abspath $(INSTALL_DIR)/$(INSTALL_PREFIX)) ; \
rustup toolchain link $(PKG_DIST_TARGET) $(abspath $(INSTALL_DIR)/$(INSTALL_PREFIX)) ; \
rustup show
6 changes: 3 additions & 3 deletions toolchain/syno-qoriq-6.2.4-rust/digests
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
stage2_powerpc-unknown-linux-gnuspe.txz SHA1 377911465d0364e13136fa50d19bfd0a3660a373
stage2_powerpc-unknown-linux-gnuspe.txz SHA256 e02030225a6e6e1f680f4bdc4e902506f8742a73ba02673a80640d9aaf336fea
stage2_powerpc-unknown-linux-gnuspe.txz MD5 1129e9a88ccfaa94217a18e26d8adc00
1.82.0-powerpc-unknown-linux-gnuspe.txz SHA1 2bb6a24ca736640e0cb1c7f6fa147fe93029beab
1.82.0-powerpc-unknown-linux-gnuspe.txz SHA256 52eff1c1e0615ea084a81afba1548d0e085170981f339f3cec77df3790bb5758
1.82.0-powerpc-unknown-linux-gnuspe.txz MD5 9b60c0a6bbf803290c388840b767989c

0 comments on commit ac27e7a

Please sign in to comment.