#36 Provide error message on depchase failure
Merged by otaylor. Opened by yselkowitz.
yselkowitz/flatpak-module-tools depchase  into  main

Download 36.patch

This assertion was triggered after F39 final freeze lifted, and one of the many updates included the splitting out of a -libs subpackage from a runtime dependency. At least in that case, the solution is to update the runtime, but without a message it is difficult to debug.

rebased onto e520dccd130e6b7b8ba8460a3b7ddc8c177e9be3

"{package.name} dependency cannot be resolved" is not an accurate representation here. The package was resolved - the problem is that we can't figure out why it was resolved.

What I suggested on IRC:

"{package} unexpectedly found when resolving dependencies. Maybe the runtime needs to be rebuilt to match the contents of {tagname}?" - I would probably do that with a raise rather than an assert.

I'd also stick to asking for a raise not an assert. Including the tag name will require passing cli_data to collate_packages().

rebased onto 240e51634c056a463d429ea9397e25d3323dd070

Switched it to a raise, needs testing.

Well, this got tested sooner than I had anticipated. https://pagure.io/fedora-kde/SIG/issue/530 has broken the KDE5 runtime, resulting in:

 Finding dependencies of cantor not in runtimeTraceback (most recent call last):
  File "/usr/local/bin/flatpak-module-depchase", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/usr/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yselkowi/.local/lib/python3.12/site-packages/flatpak_module_tools/depchase/cli.py", line 287, in resolve_packages
    packages = collate_packages(
               ^^^^^^^^^^^^^^^^^
  File "/home/yselkowi/.local/lib/python3.12/site-packages/flatpak_module_tools/depchase/cli.py", line 209, in collate_packages
    raise RuntimeError(
RuntimeError: qt6-qtbase dependency cannot be resolved, may be missing from runtime
 Finding dependencies of cantor not in runtime ... 
Traceback (most recent call last):
  File "/home/yselkowi/.local/bin/flatpak-module", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/usr/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yselkowi/.local/lib/python3.12/site-packages/flatpak_module_tools/cli.py", line 294, in build_container_local
    rpm_builder.check(include_localrepo=True, allow_outdated=allow_outdated)
  File "/home/yselkowi/.local/lib/python3.12/site-packages/flatpak_module_tools/rpm_builder.py", line 366, in check
    need_rebuild, _, wait_for_event = self._check_packages(
                                      ^^^^^^^^^^^^^^^^^^^^^
  File "/home/yselkowi/.local/lib/python3.12/site-packages/flatpak_module_tools/rpm_builder.py", line 168, in _check_packages
    details = self._resolve_packages(include_localrepo=include_localrepo)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yselkowi/.local/lib/python3.12/site-packages/flatpak_module_tools/rpm_builder.py", line 152, in _resolve_packages
    output = self._run_depchase(
             ^^^^^^^^^^^^^^^^^^^
  File "/home/yselkowi/.local/lib/python3.12/site-packages/flatpak_module_tools/rpm_builder.py", line 128, in _run_depchase
    return subprocess.check_output(
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/subprocess.py", line 466, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['flatpak-module-depchase', '--profile=production', '--arch=amd64', '--tag=f40-flatpak-app-build', '--refresh=missing', 'resolve-packages', '--preinstalled', '/tmp/flatpak-kde5-runtime-f40fca1xr6d.packages', '--json', '--source', 'cantor']' returned non-zero exit status 1.

ping @otaylor

ping @otaylor

Would it be possible to implement what I asked for in: https://pagure.io/flatpak-module-tools/pull-request/36#comment-195704 - if that seems to hard, I'll merge your patch, then do that on top.

Pull-Request has been merged by otaylor

Metadata