[Solved] Flatpak-pip-generator: cmake 3.28.4 wants skbuild

Skbuild is not a pypi package. I thought that by focusing on wheels I didn’t have to build all the way down to the leaves. This is extraordinarily tedious! Not sure how to get past this at the moment:

========================================================================
Building module python3-cmake in /home/jreynolds/btbits/x64_btbits/tools/flatpak/ct_flatpak_py3-08/.flatpak-builder/build/python3-cmake-1
========================================================================
Running: pip3 install --verbose --exists-action=i --no-index --find-links="file://${PWD}" --prefix=${FLATPAK_DEST} "cmake==3.28.4" --no-build-isolation
FB: Running: flatpak build --die-with-parent --env=FLATPAK_BUILDER_BUILDDIR=/run/build/python3-cmake --nofilesystem=host:reset --filesystem=/home/jreynolds/btbits/x64_btbits/tools/flatpak/ct_flatpak_py3-08/.flatpak-builder/build/python3-cmake-1 --bind-mount=/run/build/python3-cmake=/home/jreynolds/btbits/x64_btbits/tools/flatpak/ct_flatpak_py3-08/.flatpak-builder/build/python3-cmake-1 --build-dir=/run/build/python3-cmake --bind-mount=/run/ccache=/home/jreynolds/btbits/x64_btbits/tools/flatpak/ct_flatpak_py3-08/.flatpak-builder/ccache --env=SOURCE_DATE_EPOCH=1717528803 '--env=CFLAGS=-O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer ' '--env=CXXFLAGS=-O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer ' '--env=LDFLAGS=-L/app/lib -Wl,-z,relro,-z,now -Wl,--as-needed ' --env=CCACHE_DIR=/run/ccache/disabled --env=PATH=/app/bin:/usr/bin --env=LD_LIBRARY_PATH=/app/lib --env=PKG_CONFIG_PATH=/app/lib/pkgconfig:/app/share/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig --env=FLATPAK_BUILDER_N_JOBS=24 /home/jreynolds/btbits/x64_btbits/tools/flatpak/ct_flatpak_py3-08/.flatpak-builder/rofiles/rofiles-RzRksV /bin/sh -c 'pip3 install --verbose --exists-action=i --no-index --find-links="file://${PWD}" --prefix=${FLATPAK_DEST} "cmake==3.28.4" --no-build-isolation'
Using pip 23.0.1 from /app/lib/python3.8/site-packages/pip (python 3.8)
Looking in links: file:///run/build/python3-cmake
Processing ./cmake-3.28.4.tar.gz
  Running command Preparing metadata (pyproject.toml)
  Traceback (most recent call last):
    File "/app/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
      main()
    File "/app/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/app/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 149, in prepare_metadata_for_build_wheel
      return hook(metadata_directory, config_settings)
    File "/app/lib/python3.8/site-packages/setuptools/build_meta.py", line 166, in prepare_metadata_for_build_wheel
      self.run_setup()
    File "/app/lib/python3.8/site-packages/setuptools/build_meta.py", line 150, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 8, in <module>
      from skbuild import setup
  ModuleNotFoundError: No module named 'skbuild'
  error: subprocess-exited-with-error

  × Preparing metadata (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: /app/bin/python3.8 /app/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpi_ky8ojd
  cwd: /tmp/pip-install-25htqlt6/cmake_f45285a7a6b746748fe53712a57820d5
  Preparing metadata (pyproject.toml) ... error
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

Here is the segment of my json requirements manifest:

        {
            "name": "python3-cmake",
            "buildsystem": "simple",
            "build-commands": [
                "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"cmake==3.28.4\" --no-build-isolation"
            ],
            "sources": [
                {
                    "type": "file",
                    "url": "https://files.pythonhosted.org/packages/e7/90/39fc3e549f434ae8e9e9a8af96337de6556c82447321b4bc0e39bc68b55d/cmake-3.28.4.tar.gz",
                    "sha256": "b9dd1010ebe951e1acce054c295d5f891a8ae12b295d158b66020c955ae861b4"
                }
            ]
        },
        {
            "name": "python3-skbuild-conan",
            "buildsystem": "simple",
            "build-commands": [
                "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"skbuild-conan==1.2.0\" --no-build-isolation"
            ],
            "sources": [
                {
                    "type": "file",
                    "url": "https://files.pythonhosted.org/packages/18/01/ac55f9823d48aeadb04dadb85fcd82ad2bd85e8645669012d7c4ff9d9962/skbuild_conan-1.2.0-py3-none-any.whl",
                    "sha256": "cc8262727a7835750eb710f2c88e2f12903b0ebee6842ae65a2264d62e051247"
                }
            ]
        },

Any suggestions?

Why does it run /app/bin/python3.8 ?

Python 3.8? Because it’s more recent than F24’s py 3.5. I started with python 3.10 but at the start I couldn’t tell the difference between what kind of errors I was getting. Now that I’ve got some practice, Py 3.10 is still probably going to be 48 hours of work untangling what the pip packages want and not what pipdeptree says they require.

Because the pip build requirements a different than the runtime requirements. This one fact explains a lot about why pip3 install -r requirements.txt does not solve the build dependency problems.

I took a guess and figured skbuild is some alias for scikit-build, and then I built new manifest:

       {
            "name": "python3-skbuild-conan",
            "buildsystem": "simple",
            "build-commands": [
                "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"skbuild-conan==1.2.0\" --no-build-isolation"
            ],
            "sources": [
                {
                    "type": "file",
                    "url": "https://files.pythonhosted.org/packages/18/01/ac55f9823d48aeadb04dadb85fcd82ad2bd85e8645669012d7c4ff9d9962/skbuild_conan-1.2.0-py3-none-any.whl",
                    "sha256": "cc8262727a7835750eb710f2c88e2f12903b0ebee6842ae65a2264d62e051247"
                },
                {
                    "type":"file",
                    "url":"https://files.pythonhosted.org/packages/fa/af/b3ef8fe0bb96bf7308e1f9d196fc069f0c75d9c74cfaad851e418cc704f4/scikit_build-0.17.6-py3-none-any.whl",
                    "sha256":"18bd55e81841106eec93f30a297df4f301003791c41be46ef6428d58bd42d6b3"
                },
                {
                    "type":"file",
                    "//url":"https://files.pythonhosted.org/packages/37/2c/d717d13a413d6f7579cdaa1e28e6e2c98de95461549b08d311c8a5bf4c51/ninja-1.11.1.1.tar.gz",
                    "//sha256":"9d793b08dd857e38d0b6ffe9e6b7145d7c485a42dcfea04905ca0cdb6017cc3c",
                    "url":"https://files.pythonhosted.org/packages/6d/92/8d7aebd4430ab5ff65df2bfee6d5745f95c004284db2d8ca76dcbfd9de47/ninja-1.11.1.1-py2.py3-none-manylinux1_x86_64
.manylinux_2_5_x86_64.whl",
                    "sha256": "84502ec98f02a037a169c4b0d5d86075eaf6afc55e1879003d6cab51ced2ea4b"
                },
                {
                    "type": "file",
                    "//url": "https://files.pythonhosted.org/packages/e7/90/39fc3e549f434ae8e9e9a8af96337de6556c82447321b4bc0e39bc68b55d/cmake-3.28.4.tar.gz",
                    "//sha256": "b9dd1010ebe951e1acce054c295d5f891a8ae12b295d158b66020c955ae861b4",
                    "url": "https://files.pythonhosted.org/packages/2f/a1/aed90f63609db7af7bbd9a6ad8bcc28b710ed58db3ebf0e7c92ce1d04f26/cmake-3.28.4-py2.py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl",
                    "sha256": "bc06b483cb2bcaf78184e66ac7fd0f3bbe4ed9a690369b1e4897b19568d566dd"
                }
            ]
        },
        {
            "name": "python3-cmake",
            "buildsystem": "simple",
            "build-commands": [
                "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"cmake==3.28.4\" --no-build-isolation"
            ],
            "sources": [
                {
                    "type": "file",
                    "url": "https://files.pythonhosted.org/packages/e7/90/39fc3e549f434ae8e9e9a8af96337de6556c82447321b4bc0e39bc68b55d/cmake-3.28.4.tar.gz",
                    "sha256": "b9dd1010ebe951e1acce054c295d5f891a8ae12b295d158b66020c955ae861b4"
                }
            ]
        },

The runtime has 3.11. And you don’t need build your own.

Runtime 21.08.
Trying flatpak list --app --app-runtime org.freedesktop.Platform//21.08
I do not see anything helpful, no output.

What would I have been missing to have had to go through all the extra trouble?

 $ flatpak list --runtime
Name                                                            Application ID                                 Version             Branch     
Freedesktop.org Application Platform version 1.6                org.freedesktop.Platform                       1.6                 1.6        
Freedesktop Platform                                            org.freedesktop.Platform                       21.08.22            21.08      
Freedesktop Platform                                            org.freedesktop.Platform                       22.08.24            22.08      
Freedesktop Platform                                            org.freedesktop.Platform                       23.08.17            23.08      
Mesa                                                            org.freedesktop.Platform.GL.default            21.3.9              21.08      
Mesa                                                            org.freedesktop.Platform.GL.default            24.0.4              22.08      
Mesa (Extra)                                                    org.freedesktop.Platform.GL.default            24.0.4              22.08-extra
Mesa                                                            org.freedesktop.Platform.GL.default            24.0.6              23.08      
Mesa (Extra)                                                    org.freedesktop.Platform.GL.default            24.0.6              23.08-extra
FFmpeg extension                                                org.freedesktop.Platform.ffmpeg                                    1.6        
openh264                                                        org.freedesktop.Platform.openh264              2.1.0               2.0        
openh264                                                        org.freedesktop.Platform.openh264              2.1.0               2.2.0      
Freedesktop.org Software Development Kit version 1.6            org.freedesktop.Sdk                            1.6                 1.6        
Freedesktop SDK                                                 org.freedesktop.Sdk                            21.08.22            21.08      
Freedesktop SDK                                                 org.freedesktop.Sdk                            22.08.24            22.08      
Freedesktop SDK                                                 org.freedesktop.Sdk                            23.08.17            23.08      

21.08 has been EOL for almost a year.
23.08 is the current.