You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
defegress_extension():
ifPLATFORM=='darwin':
lib_prefix, lib_suffix='lib', '.dylib'elifPLATFORM=='win32':
lib_prefix, lib_suffix='', '.dll'else:
lib_prefix, lib_suffix='lib', '.so'lib_name=f'{lib_prefix}questdb_egress{lib_suffix}'lib_dir=PROJ_ROOT/'target'/'release'lib_path=lib_dir/lib_nameextra_objects= [str(lib_dir/lib_name)]
returnExtension(
"questdb.egress",
sources=[], # <-- Is this an issue?include_dirs=[],
extra_objects=extra_objects) # Path to built lib passed in here.
My custom build_ext calls a function which invokes the Rust build system a bunch of times:
classquestdb_build_ext(build_ext):
""" Build the extension, but first compile the pre-requisite library by invoking `cargo build --release --features ffi`. """defrun(self):
cargo_build() # <-- generates `libquestdb_egress.dylib`, see above.super().run()
Current line of debugging
I've wrapped the setup() call with a try / except SystemError and I got the following traceback:
Traceback (most recent call last):
File "/Users/adam/.pyenv/versions/3.12.2/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 200, in run_commands
dist.run_commands()
File "/Users/adam/.pyenv/versions/3.12.2/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
self.run_command(cmd)
File "/Users/adam/.pyenv/versions/3.12.2/lib/python3.12/site-packages/setuptools/dist.py", line 967, in run_command
super().run_command(command)
File "/Users/adam/.pyenv/versions/3.12.2/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/Users/adam/questdb/repos/py-questdb-client/setup.py", line 169, in run
super().run()
File "/Users/adam/.pyenv/versions/3.12.2/lib/python3.12/site-packages/setuptools/command/build_ext.py", line 94, in run
self.copy_extensions_to_source()
File "/Users/adam/.pyenv/versions/3.12.2/lib/python3.12/site-packages/setuptools/command/build_ext.py", line 115, in copy_extensions_to_source
self.copy_file(regular_file, inplace_file, level=self.verbose)
File "/Users/adam/.pyenv/versions/3.12.2/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 348, in copy_file
return file_util.copy_file(
^^^^^^^^^^^^^^^^^^^^
File "/Users/adam/.pyenv/versions/3.12.2/lib/python3.12/site-packages/setuptools/_distutils/file_util.py", line 108, in copy_file
raise DistutilsFileError(
distutils.errors.DistutilsFileError: can't copy 'build/lib.macosx-14.3-arm64-cpython-312/questdb/egress.cpython-312-darwin.so': doesn't exist or not a regular file
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/adam/questdb/repos/py-questdb-client/setup.py", line 184, in <module>
setup(
File "/Users/adam/.pyenv/versions/3.12.2/lib/python3.12/site-packages/setuptools/__init__.py", line 104, in setup
return distutils.core.setup(**attrs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/adam/.pyenv/versions/3.12.2/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 184, in setup
return run_commands(dist)
^^^^^^^^^^^^^^^^^^
File "/Users/adam/.pyenv/versions/3.12.2/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 214, in run_commands
raise SystemExit("error: " + str(msg))
SystemExit: error: can't copy 'build/lib.macosx-14.3-arm64-cpython-312/questdb/egress.cpython-312-darwin.so': doesn't exist or not a regular file
error: can't copy 'build/lib.macosx-14.3-arm64-cpython-312/questdb/egress.cpython-312-darwin.so': doesn't exist or not a regular file
Looking for help
It looks like the extra object is not copied from the path where it's generated to the build/{pattern} directory.
I would appreciate any pointers to sanity-check my approach and things to try to fix the issue.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Problem
On Python 3.12 (not earlier versions) I encounter the following issue:
In earlier versions of Python this works:
In both cases, I'm running against the latest setuptools:
Context
I am building a Python extension in Rust and calling the rust build tooling explicitly.
https://github.com/questdb/py-questdb-client/compare/4ea8800..e8b39a7
My setup function defines a custom
build_ext
and defines a Cython and a pure Rust extension module.The Cython one works fine, so I'll focus on the other one.
These are my ext modules:
My custom
build_ext
calls a function which invokes the Rust build system a bunch of times:Current line of debugging
I've wrapped the
setup()
call with atry / except SystemError
and I got the following traceback:Looking for help
It looks like the extra object is not copied from the path where it's generated to the
build/{pattern}
directory.I would appreciate any pointers to sanity-check my approach and things to try to fix the issue.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions