New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ENH] normalize build path #5949
Comments
Clarification: it doesn't pass the path but creates a temporary directory, copies the project there and does chdir before invoking Cython. |
@bmwiedemann could you update |
I think it's a little subtler than that; somewhere in the |
A little more on this. Looking at the results of compiling RapidFuzz, I see the following:
static const char __pyx_k_home_jdg_debian_spyder_packages[] = "/home/jdg/debian/spyder-packages/rapidfuzz/build-area/rapidfuzz-3.6.2+ds/src/rapidfuzz/fuzz_cpp.pyx";
PyObject *__pyx_kp_s_home_jdg_debian_spyder_packages;
Py_CLEAR(clear_module_state->__pyx_kp_s_home_jdg_debian_spyder_packages);
Py_VISIT(traverse_module_state->__pyx_kp_s_home_jdg_debian_spyder_packages);
#define __pyx_kp_s_home_jdg_debian_spyder_packages __pyx_mstate_global->__pyx_kp_s_home_jdg_debian_spyder_packages
... and several more.
So there are two places where the path is embedded in the resulting C++ files: it is in the variable names, and it is in the value of the constant string |
@juliangilbey is your suggestion that the Cython users should have a way of passing such a path or Cython itself? |
Hi @webknjaz, |
I think parts of this are used for tracing (which is how coverage can be measured, for example). But I don't know what prevents Cython from using relative paths for that.. |
Is your feature request related to a problem? Please describe.
While working on reproducible builds for openSUSE, I found that
our
python-frozenlist
andpython-yarl
packages vary in every build, becausehttps://github.com/aio-libs/yarl/blob/8ba2714/packaging/pep517_backend/_backend.py#L199
passes a random tmp path to Cython-3.0.8
and Cython embeds that in the produced
.so
files.Describe the solution you'd like.
Cython could use gcc's
-ffile-prefix-map=
option (where available) to normalize these path-names.Describe alternatives you've considered.
Cython could omit path names from output objects altogether, but debuginfo might still be affected from random path names.
Additional context
No response
The text was updated successfully, but these errors were encountered: