Skip to content

python ld flags not detected... #4068

@flynn1973

Description

@flynn1973

os: AIX
rust: rustc 1.76.0-dev (fcce8cab4 2023-12-26) (IBM SDK for Rust on AIX)
maturin: 1.5.1

python ldflags are not detected, build fails...

root@nimvie: /tmp/rpds_py-0.18.0 # PYO3_PRINT_CONFIG=1 cargo build
   Compiling target-lexicon v0.12.9
   Compiling autocfg v1.1.0
   Compiling once_cell v1.18.0
   Compiling proc-macro2 v1.0.66
   Compiling libc v0.2.147
   Compiling unicode-ident v1.0.11
   Compiling parking_lot_core v0.9.8
   Compiling heck v0.4.1
   Compiling cfg-if v1.0.0
   Compiling smallvec v1.11.0
   Compiling scopeguard v1.1.0
   Compiling static_assertions v1.1.0
   Compiling triomphe v0.1.9
   Compiling unindent v0.2.3
   Compiling indoc v2.0.4
   Compiling archery v1.1.0
   Compiling lock_api v0.4.10
   Compiling memoffset v0.9.0
   Compiling rpds v1.1.0
   Compiling quote v1.0.31
   Compiling pyo3-build-config v0.20.2
   Compiling syn v2.0.32
   Compiling parking_lot v0.12.1
   Compiling pyo3-ffi v0.20.2
   Compiling pyo3 v0.20.2
error: failed to run custom build command for `pyo3-ffi v0.20.2`

Caused by:
  process didn't exit successfully: `/tmp/rpds_py-0.18.0/target/debug/build/pyo3-ffi-406d3d4a023e3c99/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=PYO3_CROSS
  cargo:rerun-if-env-changed=PYO3_CROSS_LIB_DIR
  cargo:rerun-if-env-changed=PYO3_CROSS_PYTHON_VERSION
  cargo:rerun-if-env-changed=PYO3_CROSS_PYTHON_IMPLEMENTATION
  cargo:rerun-if-env-changed=PYO3_PRINT_CONFIG

  -- PYO3_PRINT_CONFIG=1 is set, printing configuration and halting compile --
  implementation=CPython
  version=3.9
  shared=true
  abi3=false
  lib_name=python3.9
  lib_dir=/usr/opt/python3/lib
  executable=/usr/bin/python3
  pointer_width=64
  build_flags=
  suppress_build_script_link_lines=false

  note: unset the PYO3_PRINT_CONFIG environment variable and retry to compile with the above config
warning: build failed, waiting for other jobs to finish...

after adding it to rustflags build succeeds...

root@nimvie: /tmp/rpds_py-0.18.0 # python3.9-config --ldflags
-L/usr/opt/python3/lib -lpython3.9 -lintl -ldl -lm -lm

root@nimvie: /tmp/rpds_py-0.18.0 # maturin build
📦 Including license file "/tmp/rpds_py-0.18.0/LICENSE"
🔗 Found pyo3 bindings
🐍 Found CPython 3.9 at /usr/bin/python3
📡 Using build options features from pyproject.toml
   Compiling target-lexicon v0.12.9
   Compiling autocfg v1.1.0
   Compiling proc-macro2 v1.0.66
   Compiling once_cell v1.18.0
   Compiling unicode-ident v1.0.11
   Compiling libc v0.2.147
   Compiling parking_lot_core v0.9.8
   Compiling smallvec v1.11.0
   Compiling scopeguard v1.1.0
   Compiling cfg-if v1.0.0
   Compiling heck v0.4.1
   Compiling triomphe v0.1.9
   Compiling static_assertions v1.1.0
   Compiling indoc v2.0.4
   Compiling unindent v0.2.3
   Compiling archery v1.1.0
   Compiling rpds v1.1.0
   Compiling lock_api v0.4.10
   Compiling memoffset v0.9.0
   Compiling quote v1.0.31
   Compiling pyo3-build-config v0.20.2
   Compiling syn v2.0.32
   Compiling parking_lot v0.12.1
   Compiling pyo3-ffi v0.20.2
   Compiling pyo3 v0.20.2
   Compiling pyo3-macros-backend v0.20.2
   Compiling pyo3-macros v0.20.2
   Compiling rpds-py v0.18.0 (/tmp/rpds_py-0.18.0)
    Finished dev [unoptimized + debuginfo] target(s) in 56.71s
📖 Found type stub file at rpds.pyi
📦 Built wheel for CPython 3.9 to /tmp/rpds_py-0.18.0/target/wheels/rpds_py-0.18.0-cp39-cp39-aix_3_00CA8B904B00.whl

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions