Skip to content

[bug] fix CI error #262

@hsluoyz

Description

@hsluoyz

See: https://github.com/casbin/casbin-cpp/actions/runs/19102929383/job/54579163436 , log:

[build (macos-latest, 3.12)](https://github.com/casbin/casbin-cpp/actions/runs/19102929383/job/54579163436#logs)
failed 1 minute ago in 31s

Build and install

Run pip install --verbose .
  pip install --verbose .
  shell: /bin/bash -e {0}
  env:
    pythonLocation: /Users/runner/hostedtoolcache/Python/3.12.10/arm64
    PKG_CONFIG_PATH: /Users/runner/hostedtoolcache/Python/3.12.10/arm64/lib/pkgconfig
    Python_ROOT_DIR: /Users/runner/hostedtoolcache/Python/3.12.10/arm64
    Python2_ROOT_DIR: /Users/runner/hostedtoolcache/Python/3.12.10/arm64
    Python3_ROOT_DIR: /Users/runner/hostedtoolcache/Python/3.12.10/arm64
Using pip 25.2 from /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pip (python 3.12)
Processing /Users/runner/work/casbin-cpp/casbin-cpp
  Preparing metadata (setup.py): started
  Running command python setup.py egg_info
  /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated.
  !!

          ********************************************************************************
          Please consider removing the following classifiers in favor of a SPDX license expression:

  Preparing metadata (setup.py): finished with status 'done'
          License :: OSI Approved :: Apache Software License
Building wheels for collected packages: pycasbin

  Building wheel for pycasbin (setup.py): started
          See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
          ********************************************************************************

  !!
    self._finalize_license_expression()
  running egg_info
  creating /private/var/folders/xc/cl1fyykn2pj4ryhdw6r1mqtc0000gn/T/pip-pip-egg-info-nrh9v386/pycasbin.egg-info
  writing /private/var/folders/xc/cl1fyykn2pj4ryhdw6r1mqtc0000gn/T/pip-pip-egg-info-nrh9v386/pycasbin.egg-info/PKG-INFO
  writing dependency_links to /private/var/folders/xc/cl1fyykn2pj4ryhdw6r1mqtc0000gn/T/pip-pip-egg-info-nrh9v386/pycasbin.egg-info/dependency_links.txt
  writing top-level names to /private/var/folders/xc/cl1fyykn2pj4ryhdw6r1mqtc0000gn/T/pip-pip-egg-info-nrh9v386/pycasbin.egg-info/top_level.txt
  writing manifest file '/private/var/folders/xc/cl1fyykn2pj4ryhdw6r1mqtc0000gn/T/pip-pip-egg-info-nrh9v386/pycasbin.egg-info/SOURCES.txt'
  reading manifest file '/private/var/folders/xc/cl1fyykn2pj4ryhdw6r1mqtc0000gn/T/pip-pip-egg-info-nrh9v386/pycasbin.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  adding license file 'LICENSE'
  writing manifest file '/private/var/folders/xc/cl1fyykn2pj4ryhdw6r1mqtc0000gn/T/pip-pip-egg-info-nrh9v386/pycasbin.egg-info/SOURCES.txt'
  DEPRECATION: Building 'pycasbin' using the legacy setup.py bdist_wheel mechanism, which will be removed in a future version. pip 25.3 will enforce this behaviour change. A possible replacement is to use the standardized build interface by setting the `--use-pep517` option, (possibly combined with `--no-build-isolation`), or adding a `pyproject.toml` file to the source tree of 'pycasbin'. Discussion can be found at https://github.com/pypa/pip/issues/6334
  Running command python setup.py bdist_wheel
  /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated.
  !!

          ********************************************************************************
          Please consider removing the following classifiers in favor of a SPDX license expression:

          License :: OSI Approved :: Apache Software License

          See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
          ********************************************************************************

  !!
    self._finalize_license_expression()
  running bdist_wheel
  running build
  running build_ext
  -- The CXX compiler identification is AppleClang 17.0.0.17000013
  -- The C compiler identification is AppleClang 17.0.0.17000013
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Check for working CXX compiler: /usr/bin/c++ - skipped
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working C compiler: /usr/bin/cc - skipped
  -- Detecting C compile features
  -- Detecting C compile features - done
  CMake Error at build/temp.macosx-10.13-universal2-cpython-312/_deps/json-src/CMakeLists.txt:1 (cmake_minimum_required):
    Compatibility with CMake < 3.5 has been removed from CMake.

    Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
    to tell CMake that the project requires at least <min> but has been updated
    to work with policies introduced by <max> or earlier.
  Building wheel for pycasbin (setup.py): finished with status 'error'

  Running setup.py clean for pycasbin
    Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.


  -- Configuring incomplete, errors occurred!
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 35, in <module>
    File "/Users/runner/work/casbin-cpp/casbin-cpp/setup.py", line 123, in <module>
      setup(
    File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/__init__.py", line 115, in setup
      return distutils.core.setup(**attrs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 186, in setup
      return run_commands(dist)
             ^^^^^^^^^^^^^^^^^^
    File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 202, in run_commands
      dist.run_commands()
    File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 1002, in run_commands
      self.run_command(cmd)
    File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/dist.py", line 1102, in run_command
      super().run_command(command)
    File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 1021, in run_command
      cmd_obj.run()
    File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/command/bdist_wheel.py", line 370, in run
      self.run_command("build")
    File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 357, in run_command
      self.distribution.run_command(command)
    File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/dist.py", line 1102, in run_command
      super().run_command(command)
    File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 1021, in run_command
      cmd_obj.run()
    File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/_distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
    File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 357, in run_command
      self.distribution.run_command(command)
    File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/dist.py", line 1102, in run_command
      super().run_command(command)
    File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 1021, in run_command
      cmd_obj.run()
    File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/command/build_ext.py", line 96, in run
      _build_ext.run(self)
    File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/_distutils/command/build_ext.py", line 368, in run
      self.build_extensions()
    File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/_distutils/command/build_ext.py", line 484, in build_extensions
      self._build_extensions_serial()
    File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/_distutils/command/build_ext.py", line 510, in _build_extensions_serial
      self.build_extension(ext)
    File "/Users/runner/work/casbin-cpp/casbin-cpp/setup.py", line 109, in build_extension
      subprocess.check_call(
    File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/subprocess.py", line 413, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['cmake', '/Users/runner/work/casbin-cpp/casbin-cpp', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/Users/runner/work/casbin-cpp/casbin-cpp/build/lib.macosx-10.13-universal2-cpython-312/', '-DPYTHON_EXECUTABLE=/Library/Frameworks/Python.framework/Versions/3.12/bin/python', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1.
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: /Library/Frameworks/Python.framework/Versions/3.12/bin/python -u -c '
  exec(compile('"'"''"'"''"'"'
  # This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
  #
  # - It imports setuptools before invoking setup.py, to enable projects that directly
  #   import from `distutils.core` to work with newer packaging standards.
  # - It provides a clear error message when setuptools is not installed.
  # - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so
  #   setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning:
  #     manifest_maker: standard file '"'"'-c'"'"' not found".
  # - It generates a shim setup.py, for handling setup.cfg-only projects.
  import os, sys, tokenize, traceback
  
  try:
      import setuptools
  except ImportError:
      print(
          "ERROR: Can not execute `setup.py` since setuptools failed to import in "
          "the build environment with exception:",
          file=sys.stderr,
      )
      traceback.print_exc()
      sys.exit(1)
  
  __file__ = %r
  sys.argv[0] = __file__
  
  if os.path.exists(__file__):
      filename = __file__
      with tokenize.open(__file__) as f:
          setup_py_code = f.read()
  else:
      filename = "<auto-generated setuptools caller>"
      setup_py_code = "from setuptools import setup; setup()"
  
  exec(compile(setup_py_code, filename, "exec"))
  '"'"''"'"''"'"' % ('"'"'/Users/runner/work/casbin-cpp/casbin-cpp/setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' bdist_wheel -d /private/var/folders/xc/cl1fyykn2pj4ryhdw6r1mqtc0000gn/T/pip-wheel-y9107gkg
  cwd: /Users/runner/work/casbin-cpp/casbin-cpp/
  ERROR: Failed building wheel for pycasbin
  Running command python setup.py clean
  /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated.
  !!

          ********************************************************************************
          Please consider removing the following classifiers in favor of a SPDX license expression:

          License :: OSI Approved :: Apache Software License

          See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
          ********************************************************************************

  !!
    self._finalize_license_expression()
  running clean
  removing 'build/temp.macosx-10.13-universal2-cpython-312' (and everything under it)
  'build/lib.macosx-10.13-universal2-cpython-312' does not exist -- can't clean it
  'build/bdist.macosx-10.13-universal2' does not exist -- can't clean it
  'build/scripts-3.12' does not exist -- can't clean it
  removing 'build'
Failed to build pycasbin

Notice:  A new release of pip is available: 25.2 -> 25.3
Notice:  To update, run: python -m pip install --upgrade pip
error: failed-wheel-build-for-install

× Failed to build installable wheels for some pyproject.toml based projects
╰─> pycasbin
Error: Process completed with exit code 1.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions