New package: python3-pynitrokey-0.4.50 with a bunch of dependencies
Testing the changes
- I tested the changes in this PR: YES
Local build testing
- I built this PR locally for my native architecture: x86_64-glibc
About two problematic packages:
- libusbsio has been fixed with a simple sed command proposed by zlice.
- python3-cmsis-pack-manager: I've had no success building it for arches other than x86_64 and i686. Upstream documentation says "Cross-compilation may be an option but has not been sufficiently investigated.". I've tried to use:
build_helper=rust
(...)
rustup-init -y
source "/host/cargo/env"
rustup target add aarch64-unknown-linux-gnu
(...)
cargo build --release --target=aarch64-unknown-linux-gnu
Still it fails for aarch64 so the other archs are likely to be affected, too. For the record, I get:
error: toolchain 'stable-x86_64-unknown-linux-gnu' does not contain component 'rustc' for target 'aarch64-unknown-linux-gnu' If anybody can think of something to make it work, I'd appreciate a comment.
Native compilation is also bound to fail since "wheels are not available for non-x86 systems" That's why I'm keeping the archs line in the template and not setting the var broken for $CROSS_BUILD.
- Generally, we prefer using
$PYPI_SITEfor Python distfiles where possible. - Don't redefine
do_buildjust to add--skip-dependency-check; usemake_build_argsfor that purpose. - Are the packages that won't build for other architectures broken upstream, or is it just the case that you haven't been able to build them? The
libusbsiowheel, in particular, seems to ship a bunch of supporting libraries for 32- and 64-bit ARM.
Generally, we prefer using
$PYPI_SITEfor Python distfiles where possible.Don't redefine
do_buildjust to add--skip-dependency-check; usemake_build_argsfor that purpose.Are the packages that won't build for other architectures broken upstream, or is it just the case that you haven't been able to build them? The
libusbsiowheel, in particular, seems to ship a bunch of supporting libraries for 32- and 64-bit ARM.
- Where it was possible, I used $PYPI_SITE.
- Done. Thanks for the suggestion.
- re: libusbsio and python3-cmsis-pack-manager
- libusbsio seems to be broken for cross-compilation (I bet it compiles natively but I can't get it to work on arches other than x86_64 and i686). For instance, I get the following for aarch64:
gcc -o obj/release/lpcusbsio.o -fstack-clash-protection -D_FORTIFY_SOURCE=2 -O2 -pipe -march=armv8-a -I/usr/aarch64-linux-gnu/usr/include -ffile-prefix-map=/builddir/libusbsio-2.1.11=. -Iinclude -Isrc/hid_api/hidapi -fPIC -Wall -c -O3 -DNDEBUG src/lpcusbsio.c cc1: error: bad value 'armv8-a' for '-march=' switch cc1: note: valid arguments to '-march=' switch are: nocona core2 nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell skylake skylake-avx512 cannonlake icelake-client rocketlake icelake-server cascadelake tigerlake cooperlake sapphirerapids emeraldrapids alderlake raptorlake meteorlake graniterapids graniterapids-d bonnell atom silvermont slm goldmont goldmont-plus tremont sierraforest grandridge knl knm x86-64 x86-64-v2 x86-64-v3 x86-64-v4 eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 lujiazui k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 znver2 znver3 znver4 btver1 btver2 native make: *** [makefile:110: obj/release/lpcusbsio.o] Error 1 - for python3-cmsis-pack-manager
For a cross build for aarch64 I get this:
💥 maturin failed Caused by: Failed to build a native library through cargo Caused by: Cargo build finished with "exit status: 101":env -u CARGO "cargo" "rustc" "--message-format" "json-render-diagnostics" "--manifest-path" "/builddir/python3-cmsis-pack-manager-0.5.3/Cargo.toml" "--release" "--lib"Error: command ['maturin', 'pep517', 'build-wheel', '-i', '/usr/bin/python3', '--compatibility', 'off'] returned non-zero exit status 1I also found this: https://github.com/pyocd/pyOCD/issues/1023
@ahesford may I ask you to review? It seems to me that both of these packages cannot be cross-built. I may be wrong but having done some research it seems like this is the case.
saw you mention this in irc
try this in post extract for cross builds?
vsed -e "s/gcc/$CC/" -i ${wrksrc}/makefile
vsed -e "s/g++/$CXX/" -i ${wrksrc}/makefile
For Python things that build with rust, like python3-cmsis-pack-manager, you should be using the rust build helper.
saw you mention this in irc
try this in post extract for cross builds?
vsed -e "s/gcc/$CC/" -i ${wrksrc}/makefile vsed -e "s/g++/$CXX/" -i ${wrksrc}/makefile
Sorry, saw the comment after putting broken in libusbsio. Will test this for sure. Thanks for your input.
For Python things that build with rust, like
python3-cmsis-pack-manager, you should be using therustbuild helper.
Will try that for sure and report back.
For Python things that build with rust, like
python3-cmsis-pack-manager, you should be using therustbuild helper.
OK, added the appropriate line. I haven't been able to cross-compile it but managed to find upstream info on non-x86 archs for this package. The link is in my original comment.