matthew-brett / delocate

Find and copy needed dynamic libraries into python wheels
BSD 2-Clause "Simplified" License
262 stars 59 forks source link

Building error: Already planning to copy library with same basename as: libstdc++.6.dylib #165

Open MartinPdeS opened 1 year ago

MartinPdeS commented 1 year ago

Hello, I would like to report this problem I am having. I am trying to build my code (python api wrapping c++ and fortran core) and I am facing this error message (at the end of message) that doesn't help me at all. I have been reading through a lot of documentation and forums but couldn't find anything to help. My workflow file is pretty simple:

================================================================ MacOS: runs-on: macos-latest strategy:
fail-fast: false matrix: cibw_python: ["cp38-macosx_x86_64", "cp39-macosx_x86_64", "cp310-macosx_x86_64"]

steps:
  - name: Checkout repository
    uses: actions/checkout@v3
    with: 
      submodules: 'true'

  - name: Provide gfortran and gcc (macOS)
    run: |
      # https://github.com/actions/virtual-environments/issues/2524
      # https://github.com/cbg-ethz/dce/blob/master/.github/workflows/pkgdown.yaml
      brew install gcc
      sudo ln -s /usr/local/bin/gfortran-11 /usr/local/bin/gfortran
      sudo mkdir /usr/local/gfortran
      sudo ln -s /usr/local/Cellar/gcc@11/*/lib/gcc/11 /usr/local/gfortran/lib

  - name: Build wheels
    uses: pypa/cibuildwheel@v2.11.2
    env:
      CIBW_BEFORE_BUILD: cmake . -DCMAKE_CXX_COMPILER=/usr/local/Cellar/gcc/12.2.0/bin/g++-12 && sudo make install
      CIBW_BEFORE_ALL: CC=gcc CXX=g++
      CIBW_ARCHS_MACOS: x86_64 arm64
      CIBW_BUILD: cp38-* cp39-* cp310-*

  - name: Publish a Python distribution to PyPI
    uses: pypa/gh-action-pypi-publish@v1.5.0
    with:
      user: __token__
      password: ${{ secrets.PYPI_API_TOKEN }}

================================================================

While it may not be a bug but an error from my side, I think the error message is not clear.

I am new at using delocate, so I don't really know what is the expected behavior, but with auditwheel i would expect delocate to produce my repaired wheel file.

Here is the link for the github workflow https://github.com/MartinPdeS/PyMieSim/actions/runs/3348332811/jobs/5547283200

Many thanks

+ delocate-wheel --require-archs x86_64 -w /private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/cibw-run-q96w162q/cp38-macosx_x86_64/repaired_wheel -v /private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/cibw-run-q96w162q/cp38-macosx_x86_64/built_wheel/PyMieSim-0.6.29-cp38-cp38-macosx_10_9_x86_64.whl
  Fixing: /private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/cibw-run-q96w162q/cp38-macosx_x86_64/built_wheel/PyMieSim-0.6.29-cp38-cp38-macosx_10_9_x86_64.whl
  Traceback (most recent call last):
    File "/private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/cibw-run-q96w162q/cp38-macosx_x86_64/build/venv/bin/delocate-wheel", line 8, in <module>
      sys.exit(main())
    File "/private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/cibw-run-q96w162q/cp38-macosx_x86_64/build/venv/lib/python3.8/site-packages/delocate/cmd/delocate_wheel.py", line 128, in main
      copied = delocate_wheel(
    File "/private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/cibw-run-q96w162q/cp38-macosx_x86_64/build/venv/lib/python3.8/site-packages/delocate/delocating.py", line 643, in delocate_wheel
      copied_libs = delocate_path(
    File "/private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/cibw-run-q96w162q/cp38-macosx_x86_64/build/venv/lib/python3.8/site-packages/delocate/delocating.py", line 473, in delocate_path
      return delocate_tree_libs(lib_dict, lib_path, tree_path)
    File "/private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/cibw-run-q96w162q/cp38-macosx_x86_64/build/venv/lib/python3.8/site-packages/delocate/delocating.py", line 104, in delocate_tree_libs
      libraries_to_copy, libraries_to_delocate = _analyze_tree_libs(
    File "/private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/cibw-run-q96w162q/cp38-macosx_x86_64/build/venv/lib/python3.8/site-packages/delocate/delocating.py", line 145, in _analyze_tree_libs
      raise DelocationError(
  delocate.delocating.DelocationError: Already planning to copy library with same basename as: libstdc++.6.dylib
                                                             ✕ 47.05s
Error: Command delocate-wheel --require-archs x86_64 -w /private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/cibw-run-q96w162q/cp38-macosx_x86_64/repaired_wheel -v /private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/cibw-run-q96w162q/cp38-macosx_x86_64/built_wheel/PyMieSim-0.6.29-cp38-cp38-macosx_10_9_x86_64.whl failed with code 1. None

Error: Process completed with exit code 1.