Closed matthewfeickert closed 9 months ago
The following is able to build fine (as the fastjet
CI jobs also confirm)
$ docker run --rm -ti python:3.11 /bin/bash
root@d2b96d44765d:/# python -m venv venv && . venv/bin/activate
(venv) root@d2b96d44765d:/# python -m pip --quiet install --upgrade pip setuptools wheel
(venv) root@d2b96d44765d:/# apt update && apt install -y libboost-dev libmpfr-dev libgmp-dev swig autoconf libtool
(venv) root@d2b96d44765d:/# python -m pip install --verbose --upgrade --no-binary fastjet fastjet
...
Successfully built fastjet
...
Successfully installed awkward-2.6.1 awkward-cpp-29 fastjet-3.4.1.3 fsspec-2024.2.0 importlib-metadata-7.0.1 numpy-1.26.4 packaging-23.2 vector-1.2.0 zipp-3.17.0
(venv) root@d2b96d44765d:/# python -m pip show fastjet
Name: fastjet
Version: 3.4.1.3
Summary: Official FastJet bindings to Python and Awkward Array.
Home-page: https://github.com/scikit-hep/fastjet
Author: Aryan Roy
Author-email: aryanroy5678@gmail.com
License: BSD-3-Clause
Location: /venv/lib/python3.11/site-packages
Requires: awkward, numpy, vector
Required-by:
(venv) root@d2b96d44765d:/#
so it is unclear to me what the conda environment is missing.
It looks like it cannot find patch
in $PATH
when trying to execute these lines:
https://github.com/scikit-hep/fastjet/blob/58403dbf431976011fc6bf2817cf8b30221c75ef/setup.py#L66-L69
? Or maybe I am misreading this.
It looks like it cannot find
patch
in$PATH
when trying to execute these lines:https://github.com/scikit-hep/fastjet/blob/58403dbf431976011fc6bf2817cf8b30221c75ef/setup.py#L66-L69
? Or maybe I am misreading this.
No, you're right @chrispap95, but that's what I get for reporting things late at night though and copy-pasting from the wrong section of my terminal. :(
The following is the reproducer and error I meant to share:
# docker run --rm -ti mambaorg/micromamba:1.4.9-bullseye-slim
$ micromamba env create --channel conda-forge --name fastjet-build-debug --yes python=3.11 && micromamba activate fastjet-build-debug
$ micromamba install --channel conda-forge --yes pybind11 mpfr cgal cgal-cpp libboost-devel libboost-python-devel git gmp make libtool automake autoconf swig patch
$ python -m pip install --verbose --upgrade --no-binary fastjet fastjet # build from sdist
...
Building wheels for collected packages: fastjet
Running command Building wheel for fastjet (pyproject.toml)
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-cpython-311
creating build/lib.linux-x86_64-cpython-311/fastjet
copying src/fastjet/_singleevent.py -> build/lib.linux-x86_64-cpython-311/fastjet
copying src/fastjet/_pyjet.py -> build/lib.linux-x86_64-cpython-311/fastjet
copying src/fastjet/_utils.py -> build/lib.linux-x86_64-cpython-311/fastjet
copying src/fastjet/_multievent.py -> build/lib.linux-x86_64-cpython-311/fastjet
copying src/fastjet/version.py -> build/lib.linux-x86_64-cpython-311/fastjet
copying src/fastjet/_generalevent.py -> build/lib.linux-x86_64-cpython-311/fastjet
copying src/fastjet/__init__.py -> build/lib.linux-x86_64-cpython-311/fastjet
running egg_info
writing src/fastjet.egg-info/PKG-INFO
writing dependency_links to src/fastjet.egg-info/dependency_links.txt
writing requirements to src/fastjet.egg-info/requires.txt
writing top-level names to src/fastjet.egg-info/top_level.txt
ERROR setuptools_scm._file_finders.git listing git files failed - pretending there aren't any
reading manifest file 'src/fastjet.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '.git' found anywhere in distribution
warning: no previously-included files matching '.gitmodules' found anywhere in distribution
warning: no files found matching 'patch_fastjet_i.txt'
warning: no previously-included files found matching '.cirrus.yml'
adding license file 'LICENSE'
writing manifest file 'src/fastjet.egg-info/SOURCES.txt'
running build_ext
patching file src/ClusterSequence.cc
Hunk #1 succeeded at 1024 with fuzz 1 (offset 7 lines).
Hunk #2 succeeded at 1035 (offset 7 lines).
**Error**: You must have `libtool' installed.
Get ftp://ftp.gnu.org/pub/gnu/libtool-1.2d.tar.gz
(or a newer version if it is available)
cat: config.log: No such file or directory
Traceback (most recent call last):
File "<string>", line 91, in build_extensions
File "/opt/conda/envs/fastjet-build-debug/lib/python3.11/subprocess.py", line 571, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['./autogen.sh', '--prefix=/tmp/pip-install-1p6u92gq/fastjet_e3a3fa53463c4e3da149320ed4ad47a9/src/fastjet/_fastjet_core', '--enable-thread-safety', '--disable-auto-ptr', '--enable-allcxxplugins', '--enable-cgal-header-only', '--enable-cgal', '--with-cgaldir=/tmp/pip-install-1p6u92gq/fastjet_e3a3fa53463c4e3da149320ed4ad47a9/CGAL-5.5.1', '--enable-swig', '--enable-pyext', 'LDFLAGS=-Wl,-rpath,$$ORIGIN/_fastjet_core/lib:$$ORIGIN']' returned non-zero exit status 1.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/conda/envs/fastjet-build-debug/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
main()
File "/opt/conda/envs/fastjet-build-debug/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/fastjet-build-debug/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
return _build_backend().build_wheel(wheel_directory, config_settings,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/pip-build-env-dncwyy1x/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 404, in build_wheel
return self._build_with_temp_dir(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/pip-build-env-dncwyy1x/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 389, in _build_with_temp_dir
self.run_setup()
File "/tmp/pip-build-env-dncwyy1x/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 311, in run_setup
exec(code, locals())
File "<string>", line 191, in <module>
File "/tmp/pip-build-env-dncwyy1x/overlay/lib/python3.11/site-packages/setuptools/__init__.py", line 103, in setup
return distutils.core.setup(**attrs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/pip-build-env-dncwyy1x/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 185, in setup
return run_commands(dist)
^^^^^^^^^^^^^^^^^^
File "/tmp/pip-build-env-dncwyy1x/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
dist.run_commands()
File "/tmp/pip-build-env-dncwyy1x/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
self.run_command(cmd)
File "/tmp/pip-build-env-dncwyy1x/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 963, in run_command
super().run_command(command)
File "/tmp/pip-build-env-dncwyy1x/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/tmp/pip-build-env-dncwyy1x/normal/lib/python3.11/site-packages/wheel/bdist_wheel.py", line 368, in run
self.run_command("build")
File "/tmp/pip-build-env-dncwyy1x/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "/tmp/pip-build-env-dncwyy1x/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 963, in run_command
super().run_command(command)
File "/tmp/pip-build-env-dncwyy1x/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/tmp/pip-build-env-dncwyy1x/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/build.py", line 131, in run
self.run_command(cmd_name)
File "/tmp/pip-build-env-dncwyy1x/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "/tmp/pip-build-env-dncwyy1x/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 963, in run_command
super().run_command(command)
File "/tmp/pip-build-env-dncwyy1x/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/tmp/pip-build-env-dncwyy1x/overlay/lib/python3.11/site-packages/setuptools/command/build_ext.py", line 89, in run
_build_ext.run(self)
File "/tmp/pip-build-env-dncwyy1x/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 345, in run
self.build_extensions()
File "<string>", line 98, in build_extensions
File "/opt/conda/envs/fastjet-build-debug/lib/python3.11/subprocess.py", line 571, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['cat', 'config.log']' returned non-zero exit status 1.
error: subprocess-exited-with-error
× Building wheel for fastjet (pyproject.toml) 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: /opt/conda/envs/fastjet-build-debug/bin/python /opt/conda/envs/fastjet-build-debug/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py build_wheel /tmp/tmpa2wy027k
cwd: /tmp/pip-install-1p6u92gq/fastjet_e3a3fa53463c4e3da149320ed4ad47a9
Building wheel for fastjet (pyproject.toml) ... error
ERROR: Failed building wheel for fastjet
Failed to build fastjet
ERROR: Could not build wheels for fastjet, which is required to install pyproject.toml-based projects
So it is failing on the try
in
https://github.com/scikit-hep/fastjet/blob/58403dbf431976011fc6bf2817cf8b30221c75ef/setup.py#L90-L99
even though libtool
is installed
(fastjet-build-debug) mambauser@f67b95c23b3c:/tmp$ micromamba list | grep libtool
libtool 2.4.7 h27087fc_0 conda-forge
(fastjet-build-debug) mambauser@f67b95c23b3c:/tmp$ command -v libtool
/opt/conda/envs/fastjet-build-debug/bin/libtool
and then fails on the except
as there seems to be no config.log
(I guess as autogen
didn't even get to run).
Maybe I'm missing the obvious though.
Some of this seems similar in install hunting to PR https://github.com/scikit-hep/fastjet/pull/4, so not sure if @jpivarski or @henryiii (Henry, not expecting that you'll see this as I know you're out-of-office) have any pointers.
Ah this seems to be issues with what is available on the system in the mambaorg/micromamba:1.4.9-bullseye-slim
Docker container as if I run these same commands outside of the container on my Ubuntu machine the build
$ python -m pip install --verbose --no-cache-dir --no-binary fastjet fastjet
passes.
So this seems to again be realted to the packaging and build system in that it requires OS level pieces to be there that aren't specified, but this is good to know for making progress on the host
requirements in https://github.com/conda-forge/staged-recipes/pull/21052.
As part of work towards debugging https://github.com/conda-forge/staged-recipes/pull/21052, I've noticed that trying to build from an
sdist
in aconda
environment in a Docker container seems to failThe same problem arises if I try to build from the Git source repository in a conda environment
Obviously using the
apt-get
instructions workshttps://github.com/scikit-hep/fastjet/blob/58403dbf431976011fc6bf2817cf8b30221c75ef/README.md?plain=1#L67-L70
though it is unclear to me what are the missing conda-forge requirements to be able to build from source in a conda environment.