Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
4 changes: 2 additions & 2 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
- uses: actions/checkout@v4
- name: Install cibuildwheel
# Nb. keep cibuildwheel version pin consistent with job below
run: pipx install cibuildwheel==2.21.3
run: pipx install cibuildwheel==3.1.4
- id: set-matrix
# Once we have the windows build figured out, it can be added here
# by updating the matrix to include windows builds as well.
Expand Down Expand Up @@ -126,7 +126,7 @@ jobs:
platforms: all

- name: Build wheels
uses: pypa/cibuildwheel@v2.21.3
uses: pypa/cibuildwheel@v3.1.4
with:
only: ${{ matrix.only }}
env:
Expand Down
2 changes: 1 addition & 1 deletion doc/source/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
lxml>=3.8
lxml==6.0.2
importlib_metadata;python_version < '3.8'
packaging
Sphinx>=3
Expand Down
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4", "pkgconfig>=1.5.1", "lxml>=3.8, !=4.7.0"]
requires = ["setuptools==80.9.0", "wheel", "setuptools_scm[toml]>=3.4", "pkgconfig>=1.5.1", "lxml==6.0.2"]

[tool.mypy]
files = ['src']
Expand Down Expand Up @@ -100,6 +100,7 @@ build-verbosity = 1
build-frontend = "build"
skip = [
"pp*", # Skips PyPy builds (pp38-*, pp39-*, etc.)
"*musllinux_riscv64"
Comment thread
ffgan marked this conversation as resolved.
Outdated
]
test-command = "pytest -v --color=yes {package}/tests"
before-test = "pip install -r requirements-test.txt"
Expand All @@ -109,14 +110,16 @@ test-skip = "*-macosx_arm64"
PYXMLSEC_STATIC_DEPS = "true"

[tool.cibuildwheel.linux]
archs = ["x86_64", "aarch64"]
archs = ["x86_64", "aarch64", "riscv64"]
environment-pass = [
"PYXMLSEC_LIBXML2_VERSION",
"PYXMLSEC_LIBXSLT_VERSION",
"PYXMLSEC_STATIC_DEPS",
"GH_TOKEN"
]

[tool.setuptools_scm]
Comment thread
ffgan marked this conversation as resolved.
Outdated

[tool.cibuildwheel.macos]
archs = ["x86_64", "arm64"]
before-all = "brew install perl"
Expand Down
2 changes: 1 addition & 1 deletion requirements-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

pytest==8.4.1
lxml-stubs==0.5.1
ruff[format]==0.12.3
ruff[format]==0.13.0
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lxml==6.0.0
lxml==6.0.2
22 changes: 20 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,9 +404,9 @@ def prepare_static_build(self, build_platform):
ldflags.append(env['LDFLAGS'])

cross_compiling = False
if build_platform == 'darwin':
import platform
import platform
Comment thread
ffgan marked this conversation as resolved.
Outdated

if build_platform == 'darwin':
arch = self.plat_name.rsplit('-', 1)[1]
if arch != platform.machine() and arch in ('x86_64', 'arm64'):
self.info(f'Cross-compiling for {arch}')
Expand All @@ -423,6 +423,24 @@ def prepare_static_build(self, build_platform):
self.info('Building OpenSSL')
openssl_dir = next(self.build_libs_dir.glob('openssl-*'))
openssl_config_cmd = [prefix_arg, 'no-shared', '-fPIC', '--libdir=lib']
if platform.machine() == 'riscv64':
# add `no-asm` flag for openssl while build for riscv64
Comment thread
mxamin marked this conversation as resolved.

# on openssl 3.5.2, When building for riscv64, ASM code is used by default.
# However, this version of the assembly code will report during the build:

# relocation truncated to fit: \
# R_RISCV_JAL against symbol `AES_set_encrypt_key' defined in .text section \
# in /project/build/tmp/prefix/lib/libcrypto.a(libcrypto-lib-aes-riscv64.o)

# This [line] \
Comment thread
mxamin marked this conversation as resolved.
Outdated
# (https://github.com/openssl/openssl/blob/0893a62353583343eb712adef6debdfbe597c227/crypto/aes/asm/aes-riscv64.pl#L1069)
# of code cannot be completed normally \
# because the jump address of the static link library used by xmlsec is too large.
# may be we can consider filing a related issue with OpenSSL later.
# However, for now, for convenience, we can simply disable ASM for riscv64.
# This will result in some performance degradation, but this is acceptable.
openssl_config_cmd.append('no-asm')
if cross_compiling:
openssl_config_cmd.insert(0, './Configure')
openssl_config_cmd.append(cross_compiling.triplet)
Expand Down
Loading