Bug 287677 - print/qt6-pdf: 'stage' python error when "Generating Chromium SBOM for Pdf" if spdx-tools installed
Summary: print/qt6-pdf: 'stage' python error when "Generating Chromium SBOM for Pdf" i...
Status: In Progress
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-kde (group)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-06-20 13:37 UTC by John Hein
Modified: 2025-11-10 20:38 UTC (History)
1 user (show)

See Also:
makc: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Hein 2025-06-20 13:37:31 UTC
'make -C print/qt6-pdf stage' fails if misc/py-spdx-tools is installed...

=====================
 .
 .
-- Installing: /wrkdirs/usr/ports/print/qt6-pdf/work/stage/usr/local/libdata/pkgconfig/Qt6PdfQuick.pc
-- Starting SBOM generation in build dir: /wrkdirs/usr/ports/print/qt6-pdf/work/.build/qt_sbom/qtpdf/staging-qtpdf.spdx.in
-- Generating Chromium SBOM for Pdf...
-- Found Gn: /wrkdirs/usr/ports/print/qt6-pdf/work/.build/install/bin/gn (found suitable exact version "6.9.1.qtwebengine.qt.io")
CMake Error at /wrkdirs/usr/ports/print/qt6-pdf/work/qtwebengine-everywhere-src-6.9.1/cmake/QtGnSbom.cmake:52 (message):


  -- SBOM generation FAILED


  ['/wrkdirs/usr/ports/print/qt6-pdf/work/qtwebengine-everywhere-src-6.9.1/src/3rdparty/chromium/tools/licenses/sbom.py',
  '--gn-binary',
  '/wrkdirs/usr/ports/print/qt6-pdf/work/.build/install/bin/gn',
  '--gn-target-list', ':QtPdf', '--build-dir-list',
  '/wrkdirs/usr/ports/print/qt6-pdf/work/.build/src/pdf/Release/amd64',
  '--gn-version', '6.9.1.qtwebengine.qt.io', '--package-id', 'Pdf',
  '--namespace', 'https://qt.io/spdxdocs/qtwebengine-chromium-pdf-6.9.1',
  '/wrkdirs/usr/ports/print/qt6-pdf/work/.build/qt_sbom/qtwebengine-chromium-pdf-6.9.1.spdx.json']


  Error: Failed parsing 'third_party/abseil-cpp': [Errno 2] No such file or
  directory: 'git'

  Error: Failed parsing 'third_party/icu': [Errno 2] No such file or
  directory: 'git'

  Error: Failed parsing 'third_party/libjpeg_turbo': [Errno 2] No such file
  or directory: 'git'

  Error: Failed parsing 'third_party/nasm': [Errno 2] No such file or
  directory: 'git'

  Error: Failed parsing 'third_party/pdfium': [Errno 2] No such file or
  directory: 'git'

  Traceback (most recent call last):

    File "/wrkdirs/usr/ports/print/qt6-pdf/work/qtwebengine-everywhere-src-6.9.1/src/3rdparty/chromium/tools/licenses/sbom.py", line 259, in <module>
      sys.exit(main())
               ^^^^^^
    File "/wrkdirs/usr/ports/print/qt6-pdf/work/qtwebengine-everywhere-src-6.9.1/src/3rdparty/chromium/tools/licenses/sbom.py", line 252, in main
      spdx_text = CreateSpdxText(targets_and_metadatas, args.package_id, args.namespace, args.gn_version)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/wrkdirs/usr/ports/print/qt6-pdf/work/qtwebengine-everywhere-src-6.9.1/src/3rdparty/chromium/tools/licenses/sbom.py", line 218, in CreateSpdxText
      child_pkg_id = writer.add_package(ExtendedPackage(child_pkg_name, license_file, dep_metadata))
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/wrkdirs/usr/ports/print/qt6-pdf/work/qtwebengine-everywhere-src-6.9.1/src/3rdparty/chromium/tools/licenses/sbom.py", line 83, in add_package
      license_id, need_to_add_license = self._get_license_id(pkg)
                                        ^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/wrkdirs/usr/ports/print/qt6-pdf/work/qtwebengine-everywhere-src-6.9.1/src/3rdparty/chromium/tools/licenses/spdx_writer.py", line 169, in _get_license_id
      existing = self.existing_license_files.get(pkg.file)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  TypeError: unhashable type: 'list'

  -- Exit code: 1



CMake Error at src/gen_qtwebengine_chromium_sbom_Pdf-Release.cmake:3 (execute_process):
  execute_process failed command indexes:

    1: "Child return code: 1"

Call Stack (most recent call first):
  qt_sbom/qtpdf/assemble_sbom.cmake:25 (include)
  src/cmake_install.cmake:65 (include)
  cmake_install.cmake:42 (include)

*** Error code 1

Stop.
make: stopped in /wrkdirs/usr/ports/print/qt6-pdf/work/.build
=====================

There's no direct dependency on py-spdx-tools by qt6-pdf, so building in poudriere succeeds.  But this seems to be an upstream bug.  I don't see FreeBSD bug reports at bugreports.qt.io, however (although this is likely not FreeBSD-specific).  How have we been reporting bugs to upstream?
Comment 1 Max Brazhnikov freebsd_committer freebsd_triage 2025-11-09 18:56:28 UTC
I suppose spdx-tools is used by upstream when building sources from the git.
If the problem still persists we can mark the build conflict for qt6-pdf port.
Comment 2 John Hein 2025-11-09 22:31:47 UTC
(In reply to Max Brazhnikov from comment #1)
I did report a bug upstream... https://bugreports.qt.io/browse/QTBUG-137987

There is good information there, but no fix yet.

As you can read in the bug discussion, we can set some cmake knobs to avoid trying to generate the .spdx file.  That avoids the build failure, but of course, the resulting package will not contain the .spdx file.

How much do we (FreeBSD/qt) care whether there is a .spdx file in the pkg?
Comment 3 John Hein 2025-11-09 22:33:56 UTC
(In reply to John Hein from comment #2)
Modification to my in comment 2 reply...  There may be a fix (submitted 20251025 - https://bugreports.qt.io/browse/QTBUG-137987).  I have not tested it yet.
Comment 4 Max Brazhnikov freebsd_committer freebsd_triage 2025-11-10 20:38:58 UTC
(In reply to John Hein from comment #3)
Nice! Could you prepare patch for print/qt6-pdf port and test it?