Skip to content

python3-cryptography: Compilation error (re Issue #28196) #29150

@grosjo

Description

@grosjo

Package Name

python-cryptography

Maintainer

@commodo

OpenWrt Version

SNAPSHOT

OpenWrt Target/Subtarget

ath79/generic

Steps to Reproduce

Compile python-cryptographic on latest git

Actual Behaviour

Compilation error:

cd "/data/openwrt/wr650/build_dir/target-mips_24kc_musl/pypi/cryptography-46.0.7" && CC="mips-openwrt-linux-musl-gcc" CCSHARED="mips-openwrt-linux-musl-gcc -DPIC -fpic" CXX="mips-openwrt-linux-musl-g++" LD="mips-openwrt-linux-musl-gcc" LDSHARED="mips-openwrt-linux-musl-gcc -shared" CFLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -msoft-float -fmacro-prefix-map=/data/openwrt/wr650/build_dir/target-mips_24kc_musl/pypi/cryptography-46.0.7=cryptography-46.0.7 -mips16 -minterlink-mips16 -Wl,-z,max-page-size=4096 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro" CPPFLAGS="-I/data/openwrt/wr650/staging_dir/toolchain-mips_24kc_gcc-14.3.0_musl/usr/include -I/data/openwrt/wr650/staging_dir/toolchain-mips_24kc_gcc-14.3.0_musl/include -I/data/openwrt/wr650/staging_dir/toolchain-mips_24kc_gcc-14.3.0_musl/include/fortify -I/data/openwrt/wr650/staging_dir/target-mips_24kc_musl/usr/include/python3.14" LDFLAGS="-L/data/openwrt/wr650/staging_dir/toolchain-mips_24kc_gcc-14.3.0_musl/usr/lib -L/data/openwrt/wr650/staging_dir/toolchain-mips_24kc_gcc-14.3.0_musl/lib -fuse-ld=bfd -zmax-page-size=4096 -znow -zrelro -lpython3.14" _PYTHON_HOST_PLATFORM="linux-mips" _PYTHON_SYSCONFIGDATA_NAME="_sysconfigdata__linux_mips-linux-muslsf" PYTHONPATH="/data/openwrt/wr650/staging_dir/target-mips_24kc_musl/usr/lib/python3.14:/data/openwrt/wr650/staging_dir/target-mips_24kc_musl//usr/lib/python3.14/site-packages:/data/openwrt/wr650/build_dir/target-mips_24kc_musl/pypi/cryptography-46.0.7/ipkg-install//usr/lib/python3.14/site-packages" PYTHONDONTWRITEBYTECODE=1 _python_sysroot="/data/openwrt/wr650/staging_dir/target-mips_24kc_musl" _python_prefix="/usr" _python_exec_prefix="/usr"  CARGO_BUILD_TARGET=mips-unknown-linux-musl CARGO_HOME=/data/openwrt/wr650/dl/cargo CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1 CARGO_PROFILE_RELEASE_DEBUG=false CARGO_PROFILE_RELEASE_DEBUG_ASSERTIONS=false CARGO_PROFILE_RELEASE_LTO=true CARGO_PROFILE_RELEASE_OPT_LEVEL=z CARGO_PROFILE_RELEASE_OVERFLOW_CHECKS=true CARGO_PROFILE_RELEASE_PANIC=unwind CARGO_PROFILE_RELEASE_RPATH=false CARGO_TARGET_MIPS_UNKNOWN_LINUX_MUSL_LINKER=mips-openwrt-linux-musl-gcc RUSTFLAGS="-Ctarget-feature=-crt-static -lssp_nonshared -Clink-arg=-fuse-ld=bfd" TARGET_CC=mips-openwrt-linux-musl-gcc TARGET_CFLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -msoft-float -fmacro-prefix-map=/data/openwrt/wr650/build_dir/target-mips_24kc_musl/pypi/cryptography-46.0.7=cryptography-46.0.7 -mips16 -minterlink-mips16 -Wl,-z,max-page-size=4096 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro " PYO3_CROSS_LIB_DIR="/data/openwrt/wr650/staging_dir/target-mips_24kc_musl/usr/lib/python3.14" SETUPTOOLS_RUST_CARGO_PROFILE="release"    /data/openwrt/wr650/staging_dir/hostpkg/bin/python3.14  -m build --no-isolation --outdir "/data/openwrt/wr650/build_dir/target-mips_24kc_musl/pypi/cryptography-46.0.7/"/openwrt-build --wheel   "/data/openwrt/wr650/build_dir/target-mips_24kc_musl/pypi/cryptography-46.0.7/" 
* Getting build dependencies for wheel...
* Building wheel...
Running `maturin pep517 build-wheel -i /data/openwrt/wr650/staging_dir/hostpkg/bin/python3.14 --compatibility off`
🍹 Building a mixed python/rust project
🔗 Found pyo3 bindings with abi3 support
🐍 Using build-details.json for cross-compiling preparation
🐍 Found CPython 3.14
📡 Using build options locked from pyproject.toml
   Compiling openssl-macros v0.1.1
   Compiling asn1_derive v0.22.0
   Compiling pyo3-macros-backend v0.26.0
   Compiling cryptography-cffi v0.1.0 (/data/openwrt/wr650/build_dir/target-mips_24kc_musl/pypi/cryptography-46.0.7/src/rust/cryptography-cffi)
   Compiling openssl v0.10.74
   Compiling asn1 v0.22.0
   Compiling cryptography-x509 v0.1.0 (/data/openwrt/wr650/build_dir/target-mips_24kc_musl/pypi/cryptography-46.0.7/src/rust/cryptography-x509)
warning: cryptography-cffi@0.1.0: cc1: note: someone does not honour COPTS correctly, passed 2 times
warning: cryptography-cffi@0.1.0: In file included from /usr/include/python3.14/Python.h:72,
warning: cryptography-cffi@0.1.0:                  from /data/openwrt/wr650/build_dir/target-mips_24kc_musl/pypi/cryptography-46.0.7/target/mips-unknown-linux-musl/release/build/cryptography-cffi-1180c7147b63c790/out/_openssl.c:57:
warning: cryptography-cffi@0.1.0: /usr/include/python3.14/pyport.h:429:2: error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
warning: cryptography-cffi@0.1.0:   429 | #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
warning: cryptography-cffi@0.1.0:       |  ^~~~~
error: failed to run custom build command for `cryptography-cffi v0.1.0 (/data/openwrt/wr650/build_dir/target-mips_24kc_musl/pypi/cryptography-46.0.7/src/rust/cryptography-cffi)`

Caused by:
  process didn't exit successfully: `/data/openwrt/wr650/build_dir/target-mips_24kc_musl/pypi/cryptography-46.0.7/target/release/build/cryptography-cffi-50ff1a87831ecb8a/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-env-changed=PYO3_PYTHON
  cargo:rerun-if-changed=../../_cffi_src/
  cargo:rerun-if-changed=../../cryptography/__about__.py
  cargo:rustc-cfg=python_implementation="CPython"
  OUT_DIR = Some(/data/openwrt/wr650/build_dir/target-mips_24kc_musl/pypi/cryptography-46.0.7/target/mips-unknown-linux-musl/release/build/cryptography-cffi-1180c7147b63c790/out)
  OPT_LEVEL = Some(z)
  TARGET = Some(mips-unknown-linux-musl)
  HOST = Some(x86_64-unknown-linux-gnu)
  cargo:rerun-if-env-changed=CC_mips-unknown-linux-musl
  CC_mips-unknown-linux-musl = None
  cargo:rerun-if-env-changed=CC_mips_unknown_linux_musl
  CC_mips_unknown_linux_musl = None
  cargo:rerun-if-env-changed=TARGET_CC
  TARGET_CC = Some(mips-openwrt-linux-musl-gcc)
  cargo:rerun-if-env-changed=CC_KNOWN_WRAPPER_CUSTOM
  CC_KNOWN_WRAPPER_CUSTOM = None
  RUSTC_WRAPPER = None
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some(false)
  CARGO_CFG_TARGET_FEATURE = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = Some(-Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -msoft-float -fmacro-prefix-map=/data/openwrt/wr650/build_dir/target-mips_24kc_musl/pypi/cryptography-46.0.7=cryptography-46.0.7 -mips16 -minterlink-mips16 -Wl,-z,max-page-size=4096 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro)
  cargo:rerun-if-env-changed=CC_SHELL_ESCAPED_FLAGS
  CC_SHELL_ESCAPED_FLAGS = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = Some(-Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -msoft-float -fmacro-prefix-map=/data/openwrt/wr650/build_dir/target-mips_24kc_musl/pypi/cryptography-46.0.7=cryptography-46.0.7 -mips16 -minterlink-mips16 -Wl,-z,max-page-size=4096 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro )
  cargo:rerun-if-env-changed=CFLAGS_mips_unknown_linux_musl
  CFLAGS_mips_unknown_linux_musl = None
  cargo:rerun-if-env-changed=CFLAGS_mips-unknown-linux-musl
  CFLAGS_mips-unknown-linux-musl = None
  CARGO_ENCODED_RUSTFLAGS = Some(-Ctarget-feature=-crt-static-lssp_nonshared-Clink-arg=-fuse-ld=bfd-Ctarget-feature=-crt-static)
  OUT_DIR = Some(/data/openwrt/wr650/build_dir/target-mips_24kc_musl/pypi/cryptography-46.0.7/target/mips-unknown-linux-musl/release/build/cryptography-cffi-1180c7147b63c790/out)
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  TARGET = Some(mips-unknown-linux-musl)
  CARGO_CFG_TARGET_FEATURE = None
  HOST = Some(x86_64-unknown-linux-gnu)
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = Some(-Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -msoft-float -fmacro-prefix-map=/data/openwrt/wr650/build_dir/target-mips_24kc_musl/pypi/cryptography-46.0.7=cryptography-46.0.7 -mips16 -minterlink-mips16 -Wl,-z,max-page-size=4096 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro)
  cargo:rerun-if-env-changed=CC_SHELL_ESCAPED_FLAGS
  CC_SHELL_ESCAPED_FLAGS = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = Some(-Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -msoft-float -fmacro-prefix-map=/data/openwrt/wr650/build_dir/target-mips_24kc_musl/pypi/cryptography-46.0.7=cryptography-46.0.7 -mips16 -minterlink-mips16 -Wl,-z,max-page-size=4096 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro )
  cargo:rerun-if-env-changed=CFLAGS_mips_unknown_linux_musl
  CFLAGS_mips_unknown_linux_musl = None
  cargo:rerun-if-env-changed=CFLAGS_mips-unknown-linux-musl
  CFLAGS_mips-unknown-linux-musl = None
  OUT_DIR = Some(/data/openwrt/wr650/build_dir/target-mips_24kc_musl/pypi/cryptography-46.0.7/target/mips-unknown-linux-musl/release/build/cryptography-cffi-1180c7147b63c790/out)
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  TARGET = Some(mips-unknown-linux-musl)
  CARGO_CFG_TARGET_FEATURE = None
  HOST = Some(x86_64-unknown-linux-gnu)
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = Some(-Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -msoft-float -fmacro-prefix-map=/data/openwrt/wr650/build_dir/target-mips_24kc_musl/pypi/cryptography-46.0.7=cryptography-46.0.7 -mips16 -minterlink-mips16 -Wl,-z,max-page-size=4096 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro)
  cargo:rerun-if-env-changed=CC_SHELL_ESCAPED_FLAGS
  CC_SHELL_ESCAPED_FLAGS = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = Some(-Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -msoft-float -fmacro-prefix-map=/data/openwrt/wr650/build_dir/target-mips_24kc_musl/pypi/cryptography-46.0.7=cryptography-46.0.7 -mips16 -minterlink-mips16 -Wl,-z,max-page-size=4096 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro )
  cargo:rerun-if-env-changed=CFLAGS_mips_unknown_linux_musl
  CFLAGS_mips_unknown_linux_musl = None
  cargo:rerun-if-env-changed=CFLAGS_mips-unknown-linux-musl
  CFLAGS_mips-unknown-linux-musl = None
  OUT_DIR = Some(/data/openwrt/wr650/build_dir/target-mips_24kc_musl/pypi/cryptography-46.0.7/target/mips-unknown-linux-musl/release/build/cryptography-cffi-1180c7147b63c790/out)
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  TARGET = Some(mips-unknown-linux-musl)
  CARGO_CFG_TARGET_FEATURE = None
  HOST = Some(x86_64-unknown-linux-gnu)
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = Some(-Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -msoft-float -fmacro-prefix-map=/data/openwrt/wr650/build_dir/target-mips_24kc_musl/pypi/cryptography-46.0.7=cryptography-46.0.7 -mips16 -minterlink-mips16 -Wl,-z,max-page-size=4096 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro)
  cargo:rerun-if-env-changed=CC_SHELL_ESCAPED_FLAGS
  CC_SHELL_ESCAPED_FLAGS = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = Some(-Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -msoft-float -fmacro-prefix-map=/data/openwrt/wr650/build_dir/target-mips_24kc_musl/pypi/cryptography-46.0.7=cryptography-46.0.7 -mips16 -minterlink-mips16 -Wl,-z,max-page-size=4096 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro )
  cargo:rerun-if-env-changed=CFLAGS_mips_unknown_linux_musl
  CFLAGS_mips_unknown_linux_musl = None
  cargo:rerun-if-env-changed=CFLAGS_mips-unknown-linux-musl
  CFLAGS_mips-unknown-linux-musl = None
  OUT_DIR = Some(/data/openwrt/wr650/build_dir/target-mips_24kc_musl/pypi/cryptography-46.0.7/target/mips-unknown-linux-musl/release/build/cryptography-cffi-1180c7147b63c790/out)
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  TARGET = Some(mips-unknown-linux-musl)
  CARGO_CFG_TARGET_FEATURE = None
  HOST = Some(x86_64-unknown-linux-gnu)
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = Some(-Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -msoft-float -fmacro-prefix-map=/data/openwrt/wr650/build_dir/target-mips_24kc_musl/pypi/cryptography-46.0.7=cryptography-46.0.7 -mips16 -minterlink-mips16 -Wl,-z,max-page-size=4096 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro)
  cargo:rerun-if-env-changed=CC_SHELL_ESCAPED_FLAGS
  CC_SHELL_ESCAPED_FLAGS = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = Some(-Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -msoft-float -fmacro-prefix-map=/data/openwrt/wr650/build_dir/target-mips_24kc_musl/pypi/cryptography-46.0.7=cryptography-46.0.7 -mips16 -minterlink-mips16 -Wl,-z,max-page-size=4096 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro )
  cargo:rerun-if-env-changed=CFLAGS_mips_unknown_linux_musl
  CFLAGS_mips_unknown_linux_musl = None
  cargo:rerun-if-env-changed=CFLAGS_mips-unknown-linux-musl
  CFLAGS_mips-unknown-linux-musl = None
  cargo:warning=cc1: note: someone does not honour COPTS correctly, passed 2 times
  cargo:warning=In file included from /usr/include/python3.14/Python.h:72,
  cargo:warning=                 from /data/openwrt/wr650/build_dir/target-mips_24kc_musl/pypi/cryptography-46.0.7/target/mips-unknown-linux-musl/release/build/cryptography-cffi-1180c7147b63c790/out/_openssl.c:57:
  cargo:warning=/usr/include/python3.14/pyport.h:429:2: error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
  cargo:warning=  429 | #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
  cargo:warning=      |  ^~~~~

  --- stderr


  error occurred in cc-rs: command did not execute successfully (status code exit status: 1): LC_ALL="C" "mips-openwrt-linux-musl-gcc" "-Os" "-ffunction-sections" "-fdata-sections" "-fPIC" "-I" "/data/openwrt/wr650/staging_dir/target-mips_24kc_musl/usr/include" "-I" "/usr/include/python3.14" "-DPy_LIMITED_API=0x030800f0" "-Os" "-pipe" "-mno-branch-likely" "-mips32r2" "-mtune=24kc" "-fno-caller-saves" "-fno-plt" "-fhonour-copts" "-msoft-float" "-fmacro-prefix-map=/data/openwrt/wr650/build_dir/target-mips_24kc_musl/pypi/cryptography-46.0.7=cryptography-46.0.7" "-mips16" "-minterlink-mips16" "-Wl,-z,max-page-size=4096" "-Wformat" "-Werror=format-security" "-fstack-protector" "-D_FORTIFY_SOURCE=1" "-Wl,-z,now" "-Wl,-z,relro" "-Os" "-pipe" "-mno-branch-likely" "-mips32r2" "-mtune=24kc" "-fno-caller-saves" "-fno-plt" "-fhonour-copts" "-msoft-float" "-fmacro-prefix-map=/data/openwrt/wr650/build_dir/target-mips_24kc_musl/pypi/cryptography-46.0.7=cryptography-46.0.7" "-mips16" "-minterlink-mips16" "-Wl,-z,max-page-size=4096" "-Wformat" "-Werror=format-security" "-fstack-protector" "-D_FORTIFY_SOURCE=1" "-Wl,-z,now" "-Wl,-z,relro" "-o" "/data/openwrt/wr650/build_dir/target-mips_24kc_musl/pypi/cryptography-46.0.7/target/mips-unknown-linux-musl/release/build/cryptography-cffi-1180c7147b63c790/out/dc24e3253a964b9f-_openssl.o" "-c" "/data/openwrt/wr650/build_dir/target-mips_24kc_musl/pypi/cryptography-46.0.7/target/mips-unknown-linux-musl/release/build/cryptography-cffi-1180c7147b63c790/out/_openssl.c"


warning: build failed, waiting for other jobs to finish...
💥 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_ENCODED_RUSTFLAGS="-Ctarget-feature=-crt-static\u{1f}-lssp_nonshared\u{1f}-Clink-arg=-fuse-ld=bfd\u{1f}-C\u{1f}target-feature=-crt-static" PYO3_BUILD_EXTENSION_MODULE="1" PYO3_CONFIG_FILE="/data/openwrt/wr650/build_dir/target-mips_24kc_musl/pypi/cryptography-46.0.7/target/maturin/pyo3-config-mips-unknown-linux-musl-3.14.txt" "cargo" "rustc" "--profile" "release" "--target" "mips-unknown-linux-musl" "--message-format" "json-render-diagnostics" "--locked" "--manifest-path" "/data/openwrt/wr650/build_dir/target-mips_24kc_musl/pypi/cryptography-46.0.7/src/rust/Cargo.toml" "--lib"`
Error: command ['maturin', 'pep517', 'build-wheel', '-i', '/data/openwrt/wr650/staging_dir/hostpkg/bin/python3.14', '--compatibility', 'off'] returned non-zero exit status 1

ERROR Backend subprocess exited when trying to invoke build_wheel
make[3]: *** [Makefile:54: /data/openwrt/wr650/build_dir/target-mips_24kc_musl/pypi/cryptography-46.0.7/.built] Error 1

Confirmation Checklist

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions