void-packages icon indicating copy to clipboard operation
void-packages copied to clipboard

New package: python3-pynitrokey-0.4.50 with a bunch of dependencies

Open slymattz opened this issue 1 year ago • 7 comments

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:

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.

slymattz avatar Aug 26 '24 18:08 slymattz

  1. Generally, we prefer using $PYPI_SITE for Python distfiles where possible.
  2. Don't redefine do_build just to add --skip-dependency-check; use make_build_args for that purpose.
  3. 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 libusbsio wheel, in particular, seems to ship a bunch of supporting libraries for 32- and 64-bit ARM.

ahesford avatar Aug 27 '24 18:08 ahesford

  1. Generally, we prefer using $PYPI_SITE for Python distfiles where possible.

  2. Don't redefine do_build just to add --skip-dependency-check; use make_build_args for that purpose.

  3. 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 libusbsio wheel, in particular, seems to ship a bunch of supporting libraries for 32- and 64-bit ARM.

  1. Where it was possible, I used $PYPI_SITE.
  2. Done. Thanks for the suggestion.
  3. 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 1 I 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.

slymattz avatar Aug 28 '24 12:08 slymattz

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

zlice avatar Aug 29 '24 14:08 zlice

For Python things that build with rust, like python3-cmsis-pack-manager, you should be using the rust build helper.

ahesford avatar Aug 29 '24 14:08 ahesford

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.

slymattz avatar Aug 29 '24 16:08 slymattz

For Python things that build with rust, like python3-cmsis-pack-manager, you should be using the rust build helper.

Will try that for sure and report back.

slymattz avatar Aug 29 '24 16:08 slymattz

For Python things that build with rust, like python3-cmsis-pack-manager, you should be using the rust build 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.

slymattz avatar Aug 29 '24 18:08 slymattz