Packaging python3Packages.cppyy

Hello,

I am currently attempting to package the python3Packages.cppyy package.

As described here, the following dependencies need to be packaged, too.

Instructions on how to build the entire package from source can be found here.

I believe I have successfully built cppyy-cling.

However, with the next package (cppyy-backend), I encounter the following error message, which I am unable to resolve:

ERROR Backend subprocess exited when trying to invoke build_wheel
error: builder for '/nix/store/w29lca6zlpwapxvl054drpma4rlxqdbp-python3.11-cppyy-backend-1.15.2.drv' failed with exit code 1;
       last 10 log lines:
       >   File "<string>", line 73, in build_extension
       >   File "<string>", line 58, in get_include_path
       >   File "/nix/store/glfr70gi7hfaj50mwj2431p8bg60fhqw-python3-3.11.9/lib/python3.11/subprocess.py", line 466, in check_output
       >     return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
       >            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       >   File "/nix/store/glfr70gi7hfaj50mwj2431p8bg60fhqw-python3-3.11.9/lib/python3.11/subprocess.py", line 571, in run
       >     raise CalledProcessError(retcode, process.args,
       > subprocess.CalledProcessError: Command '['/nix/store/glfr70gi7hfaj50mwj2431p8bg60fhqw-python3-3.11.9/bin/python3.11', '-m', 'cppyy_backend._cling_config', '--incdir']' returned non-zero exit status 1.
       >
       > ERROR Backend subprocess exited when trying to invoke build_wheel
       For full logs, run 'nix-store -l /nix/store/w29lca6zlpwapxvl054drpma4rlxqdbp-python3.11-cppyy-backend-1.15.2.drv'.
error: build of '/nix/store/7bvki51g2nbah0l2wfbliv5llr0w29hg-python3.11-cppyy-3.1.2.drv', '/nix/store/ikxrrrj97wanx3c9cbby10w5k2vf8qqr-python3.11-CPyCppyy-1.12.16.drv', '/nix/store/w29lca6zlpwapxvl054drpma4rlxqdbp-python3.11-cppyy-backend-1.15.2.drv' failed

I would greatly appreciate any assistance.

The current version of my code can be found here:

cppyy_backend._cling_config

This name and the package name sounds like to possibly has a native extension. And when it executes python -m cppy_backend._cling_config it fails to find that.

The likely reason is, that the import happens from the source directory, and not from the build result. This is because your current working directories has the module name and Python will always prefer that over other names in the PYTHONPATH.

It would be good to know during which phase this happens, but if it happens during checkPhase it would be fine to rename or yank the source directory.

It would be good to know during which phase this happens, but if it happens during checkPhase it would be fine to rename or yank the source directory.

It looks like it happend during the buildPhase:
https://paste.fo/raw/eea277301b98

Here is the complete log from the first package (cppyy-cling):
https://paste.fo/raw/53c44ab2d94d

Unfortunately the log isn’t clear why executing that process fails. Might as well be a missing dependency, that it fails to call.

At this point I would recheck the required dependencies and potentially the upstream build process.

It looks like it happend during the buildPhase:
https://paste.fo/raw/eea277301b98

I have just looked in the logs again and now I think I have found the right line:

FileNotFoundError: [Errno 2] No such file or directory: ‘/nix/store/l11xlrlb4xav25slvn83zvi3wf9kwysv-python3.11-cppyy-cling-6.30.0/lib/python3.11/site-packages/cppyy_backend/bin/root-config’

For debugging I added the exact path to the beginning of PYTHONPATH, LD_LIBRARY_PATH and PATH inside the preBuild stage but still getting the same error.
https://paste.fo/raw/c11f0ea6a37d

That path will not exist yet during buildPhase, it only gets created by unpacking the wheel in installPhase.