Page MenuHomeSoftware Heritage
Paste P1408

cd swh-graphql ; ./docker/build.sh fails...
ActivePublic

Authored by ardumont on Jul 20 2022, 11:49 AM.
Collecting grpcio-tools (from swh.graph)
Downloading https://files.pythonhosted.org/packages/44/79/3a5e1290fce95fcd61d0f380e542e372e91f6ef159ae71e746530116c90d/grpcio-tools-1.47.0.tar.gz (2.2MB)
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-mpqls2jr/grpcio-tools/setup.py", line 180, in <module>
if check_linker_need_libatomic():
File "/tmp/pip-install-mpqls2jr/grpcio-tools/setup.py", line 94, in check_linker_need_libatomic
stderr=PIPE)
File "/usr/lib/python3.7/subprocess.py", line 775, in __init__
restore_signals, start_new_session)
File "/usr/lib/python3.7/subprocess.py", line 1522, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'c++': 'c++'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-mpqls2jr/grpcio-tools/
The command '/bin/sh -c apt-get update && apt-get install --no-install-recommends --yes curl zstd gcc icecc pkg-config libsystemd-dev python3-dev python3-pip python3-setuptools python3-wheel && rm -rf /var/lib/apt/lists/* && pip3 install swh.graph' returned a non-zero code: 1

Event Timeline

Add missing dependencies so far...
failing at the swh.graph deps install...

After adding the following, issues shrink:
g++ pkg-config postgresql-common

But the last one is about swh.perfecthash install...

  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
    Complete output from command python setup.py egg_info:
      Failed building wheel for cffi
    ERROR: Failed to build one or more wheels
    /tmp/pip-build-env-q3vj031r/lib/python3.7/site-packages/setuptools/installer.py:30: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
      SetuptoolsDeprecationWarning,
    Traceback (most recent call last):
      File "/tmp/pip-build-env-q3vj031r/lib/python3.7/site-packages/setuptools/installer.py", line 82, in fetch_build_egg
        subprocess.check_call(cmd)
      File "/usr/lib/python3.7/subprocess.py", line 347, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmpeyx8yphs', '--quiet', 'cffi']' returned non-zero exit status 1.

    The above exception was the direct cause of the following exception:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-2mypbf08/swh.perfecthash/setup.py", line 66, in <module>
        "Documentation": "https://docs.softwareheritage.org/devel/swh-perfecthash/",
      File "/tmp/pip-build-env-q3vj031r/lib/python3.7/site-packages/setuptools/__init__.py", line 86, in setup
        _install_setup_requires(attrs)
      File "/tmp/pip-build-env-q3vj031r/lib/python3.7/site-packages/setuptools/__init__.py", line 80, in _install_setup_requires
        dist.fetch_build_eggs(dist.setup_requires)
      File "/tmp/pip-build-env-q3vj031r/lib/python3.7/site-packages/setuptools/dist.py", line 878, in fetch_build_eggs
        replace_conflicting=True,
      File "/tmp/pip-build-env-q3vj031r/lib/python3.7/site-packages/pkg_resources/__init__.py", line 791, in resolve
        replace_conflicting=replace_conflicting
      File "/tmp/pip-build-env-q3vj031r/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1075, in best_match
        return self.obtain(req, installer)
      File "/tmp/pip-build-env-q3vj031r/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1087, in obtain
        return installer(requirement)
      File "/tmp/pip-build-env-q3vj031r/lib/python3.7/site-packages/setuptools/dist.py", line 945, in fetch_build_egg
        return fetch_build_egg(self, req)
      File "/tmp/pip-build-env-q3vj031r/lib/python3.7/site-packages/setuptools/installer.py", line 84, in fetch_build_egg
        raise DistutilsError(str(e)) from e
    distutils.errors.DistutilsError: Command '['/usr/bin/python3', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmpeyx8yphs', '--quiet', 'cffi']' returned non-zero exit status 1.

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-2mypbf08/swh.perfecthash/
The command '/bin/sh -c pip3 install swh.perfecthash' returned a non-zero code: 1

... that's actually swh-graph ¯\_(ツ)_/¯

Current dockerfile which build now though (well without using it though), that needs
rework to condense 'run' command though:

FROM openjdk:11-slim-buster

RUN useradd -ms /bin/bash graphql

# Install swh.graph (both Python and Java parts)
RUN apt-get update && \
    apt-get install --no-install-recommends --yes \
        curl zstd \
        gcc g++ pkg-config libsystemd-dev postgresql-common libpq-dev libcmph-dev \
        python3-dev python3-pip python3-wheel && \
    rm -rf /var/lib/apt/lists/*

USER graphql

RUN pip3 install pip --upgrade
RUN pip install swh.perfecthash
RUN pip install swh.graph

# Default dir
WORKDIR /srv/softwareheritage/graph

``