mmecina / CCS

The UVIE Space Central Checkout System (CCS) and Test Specification Tool (TST)
Mozilla Public License 2.0
1 stars 0 forks source link

CCS Installation #12

Open hajanjes opened 3 months ago

hajanjes commented 3 months ago

I am struggling with the installation of CCS as the installation steps in the README file are not very detailed and don't work as expected. Here are my findings so far (tested on several Ubuntu/Debian flavors):

  1. sudo systemctl enable --now mariadb doesn't work

System has not booted with systemd ...

Solution: Add init=/lib/systemd/systemd to menu entry in GRUB bootloader.

  1. make python-requirements fails during installation of mysqlclient

_Collecting mysqlclient Using cached mysqlclient-2.2.4.tar.gz (90 kB) Installing build dependencies ... done Getting requirements to build wheel ... error error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [30 lines of output] /bin/sh: 1: pkg-config: not found /bin/sh: 1: pkg-config: not found /bin/sh: 1: pkg-config: not found Trying pkg-config --exists mysqlclient Command 'pkg-config --exists mysqlclient' returned non-zero exit status 127. Trying pkg-config --exists mariadb Command 'pkg-config --exists mariadb' returned non-zero exit status 127. Trying pkg-config --exists libmariadb Command 'pkg-config --exists libmariadb' returned non-zero exit status 127. Traceback (most recent call last): File "/home/hajes/CCS/venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in main() File "/home/hajes/CCS/venv/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 "/home/hajes/CCS/venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel return hook(config_settings) ^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-egdjk0im/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel return self._get_build_requires(config_settings, requirements=['wheel']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-egdjk0im/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires self.run_setup() File "/tmp/pip-build-env-egdjk0im/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 311, in run_setup exec(code, locals()) File "", line 155, in File "", line 49, in get_config_posix File "", line 28, in find_package_name Exception: Can not find valid pkg-config name. Specify MYSQLCLIENT_CFLAGS and MYSQLCLIENT_LDFLAGS env vars manually [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error

× Getting requirements to build wheel 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._

Installing MySQL env vars (export MYSQLCLIENT_CFLAGS=-I/usr/include/mysql and export MYSQLCLIENT_LDFLAGS=-L/usr/lib/x86_64-linux-gnu) results in the following error:

_Building wheels for collected packages: mysqlclient Building wheel for mysqlclient (pyproject.toml) ... error error: subprocess-exited-with-error

× Building wheel for mysqlclient (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [44 lines of output]

Options for building extension module:

    extra_compile_args: ['-I/usr/include/mysql', '-std=c99']
    extra_link_args: ['-L/usr/lib/x86_64-linux-gnu']
    define_macros: [('version_info', (2, 2, 4, 'final', 0)), ('__version__', '2.2.4')]
  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/MySQLdb
  copying src/MySQLdb/connections.py -> build/lib.linux-x86_64-cpython-311/MySQLdb
  copying src/MySQLdb/cursors.py -> build/lib.linux-x86_64-cpython-311/MySQLdb
  copying src/MySQLdb/times.py -> build/lib.linux-x86_64-cpython-311/MySQLdb
  copying src/MySQLdb/__init__.py -> build/lib.linux-x86_64-cpython-311/MySQLdb
  copying src/MySQLdb/_exceptions.py -> build/lib.linux-x86_64-cpython-311/MySQLdb
  copying src/MySQLdb/release.py -> build/lib.linux-x86_64-cpython-311/MySQLdb
  copying src/MySQLdb/converters.py -> build/lib.linux-x86_64-cpython-311/MySQLdb
  creating build/lib.linux-x86_64-cpython-311/MySQLdb/constants
  copying src/MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-cpython-311/MySQLdb/constants
  copying src/MySQLdb/constants/CR.py -> build/lib.linux-x86_64-cpython-311/MySQLdb/constants
  copying src/MySQLdb/constants/ER.py -> build/lib.linux-x86_64-cpython-311/MySQLdb/constants
  copying src/MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-cpython-311/MySQLdb/constants
  copying src/MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-cpython-311/MySQLdb/constants
  copying src/MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-cpython-311/MySQLdb/constants
  running egg_info
  writing src/mysqlclient.egg-info/PKG-INFO
  writing dependency_links to src/mysqlclient.egg-info/dependency_links.txt
  writing top-level names to src/mysqlclient.egg-info/top_level.txt
  reading manifest file 'src/mysqlclient.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  adding license file 'LICENSE'
  writing manifest file 'src/mysqlclient.egg-info/SOURCES.txt'
  copying src/MySQLdb/_mysql.c -> build/lib.linux-x86_64-cpython-311/MySQLdb
  running build_ext
  building 'MySQLdb._mysql' extension
  creating build/temp.linux-x86_64-cpython-311
  creating build/temp.linux-x86_64-cpython-311/src
  creating build/temp.linux-x86_64-cpython-311/src/MySQLdb
  x86_64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC "-Dversion_info=(2, 2, 4, 'final', 0)" -D__version__=2.2.4 -I/home/hajes/CCS/venv/include -I/usr/include/python3.11 -c src/MySQLdb/_mysql.c -o build/temp.linux-x86_64-cpython-311/src/MySQLdb/_mysql.o -I/usr/include/mysql -std=c99
  src/MySQLdb/_mysql.c:29:10: fatal error: mysql.h: Datei oder Verzeichnis nicht gefunden
     29 | #include "mysql.h"
        |          ^~~~~~~~~
  compilation terminated.
  error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for mysqlclient Failed to build mysqlclient ERROR: Could not build wheels for mysqlclient, which is required to install pyproject.toml-based projects_

Any help would be highly appreciated.

mmecina commented 3 months ago

Which version of Ubuntu are you using? It is unusual that systemd has to be manually enabled since it should be initialised by default on any recent Ubuntu installation.

Concerning the second issue, from what I can see you could try installing pkg-config first, avoiding the manual definition of the CFLAGS/LDFLAGS. Still, some mysql header files appear to be missing afterwards. I don't have tested an install on a Debian-based distro recently, so I can't tell from the top of my head which packages need to be installed in addition.

In any case, maybe the README in the CoCa branch is helpful, which describes in more detail the required steps to get the CCS running on an Ubuntu machine: https://github.com/mmecina/CCS/blob/63f3a4067e230f40a2f958fb4b74c1a5f591985a/README_CoCa.md