Skip to content

snapcraft fails with cmake not finding libpugixml.a #5933

@luspi

Description

@luspi

Check existing issues

  • I've verified that this bug isn't described by any existing issues.

Bug description

I'm attempting to build a snap based on core24 with the kde-neon-6 extension. It makes use of a bunch of library, but the one causing problems here is pugixml. I specify libpugixml-dev in the list of build-packages, however, a snapcraft pack fails with the error:

:: CMake Error at /snap/kde-qt6-core24-sdk/current/usr/lib/x86_64-linux-gnu/cmake/pugixml/pugixml-targets.cmake:111 (message):
::   The imported target "pugixml::static" references the file
::      "/snap/kde-qt6-core24-sdk/current/usr/lib/x86_64-linux-gnu/libpugixml.a"
::   but this file does not exist.  Possible reasons include:
::   * The file was deleted, renamed, or moved to another location.
::   * An install or uninstall procedure did not complete successfully.
::   * The installation package was faulty and contained
::      "/snap/kde-qt6-core24-sdk/current/usr/lib/x86_64-linux-gnu/cmake/pugixml/pugixml-targets.cmake"
::   but not all the files it references.
:: Call Stack (most recent call first):
::   /snap/kde-qt6-core24-sdk/current/usr/lib/x86_64-linux-gnu/cmake/pugixml/pugixml-config.cmake:20 (include)
::   CMakeLists.txt:228 (find_package)

When I run with the --debug flag and look around, I can find the libpugixml.a file in /usr/lib/x86_64-linux-gnu but not in the /snap/... directory.

Steps to reproduce

  1. Obtain snapcraft.yaml file
  2. Run snapcraft pack

Environment

  • Ubuntu 24.04
  • LXD
  • Snapcraft not run in destructive mode

snapcraft.yaml

# * Copyright 2024 Lukas Spies <Lukas@photoqt.org>
# * SPDX-License-Identifier: GPL-2.0-or-later
name: photoqt
confinement: strict
grade: stable
base: core24
platforms:
  amd64:
    build-on: [amd64]
    build-for: [amd64]

adopt-info: photoqt

description: Fast and highly configurable image viewer with a simple and nice interface, supporting well over 100 file formats, including images, videos, and documents.
summary: View and manage images, videos, and documents.

contact: Lukas@photoqt.org
issues: https://gitlab.com/lspies/photoqt/-/issues
source-code: https://gitlab.com/lspies/photoqt
website: https://photoqt.org
donation: https://photoqt.org/donate


apps:
  photoqt:
    extensions:
      - kde-neon-6
    common-id: org.photoqt.PhotoQt
    desktop: usr/local/share/applications/org.photoqt.PhotoQt.desktop
    command: usr/local/bin/photoqt
    slots:
      - session-slot
    plugs:
      - home
      - removable-media
      - desktop
      - desktop-legacy
      - opengl
      - wayland
      - x11
      - unity7
      - audio-playback
      - network
      - network-bind
      - cups
      - session-plug
    environment:
      LD_LIBRARY_PATH: "$LD_LIBRARY_PATH:$SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/libproxy:/usr/lib"

compression: lzo

plugs:
  session-plug:
    interface: dbus
    bus: session
    name: org.photoqt.PhotoQt

slots:
  session-slot:
    interface: dbus
    bus: session
    name: org.photoqt.PhotoQt

parts:
  photoqt:
    plugin: cmake
    source: https://photoqt.org/downloads/source/photoqt-5.0-beta2-snap.tar.gz
    parse-info:
      - usr/local/share/metainfo/org.photoqt.PhotoQt.metainfo.xml
    override-build: |
      ln -sf /usr/include/GraphicsMagick/Magick++ /usr/include/Magick++
      ln -sf /usr/include/GraphicsMagick/magick /usr/include/magick
      sed -i 's/VERSION 3.26/VERSION 3.22/g' $SNAPCRAFT_PART_SRC/CMakeLists.txt
      snapcraftctl build
    cmake-parameters:
      - -DCMAKE_BUILD_TYPE=Release
      - -DWITH_IMAGEMAGICK=OFF
      - -DWITH_GRAPHICSMAGICK=ON
      - -DWITH_LIBRAW=ON
      - -DWITH_DEVIL=ON
      - -DWITH_FREEIMAGE=ON
      - -DWITH_POPPLER=OFF
      - -DWITH_QTPDF=ON
      - -DWITH_LIBARCHIVE=ON
      - -DWITH_VIDEO_QT=ON
      - -DWITH_VIDEO_MPV=ON
      - -DWITH_LIBVIPS=OFF
      - -DWITH_RESVG=OFF
      - -DWITH_EXIV2=ON
      - -DWITH_EXIV2_ENABLE_BMFF=ON
      - -DWITH_PUGIXML=ON
      - -DWITH_ZXING=ON
      - -DWITH_CHROMECAST=OFF
      - -DWITH_LOCATION=ON
      - -DWITH_LCMS2=ON
      - -DWITH_MOTIONPHOTO=ON
      - -DWITH_PHOTOSPHERE=ON
      - -DWITH_INCLUDED_EXTENSIONS=ON
    build-packages:
      - libexiv2-dev
      - libexpat1-dev
      - libheif-dev
      - libjpeg-dev
      - liblcms2-dev
      - libpng-dev
      - libtiff-dev
      - libxml2-dev
      - libraw-dev
      - libdevil-dev
      - libfreeimageplus-dev
      - libpugixml-dev
      - libarchive-dev
      - libzxing-dev
      - libmpv-dev
      - libgraphicsmagick++1-dev
      - libgraphicsmagick1-dev
      - libcups2-dev
      - libproxy1v5
      - libyaml-cpp-dev
    stage-packages:
      - libheif1
      - libjpeg8
      - libjpeg-turbo8
      - libx265-199
      - libgif7
      - kimageformat-plugins
      - libraw23t64
      - ghostscript
      - libdevil1c2
      - libfreeimage3
      - libpugixml1v5
      - libarchive13t64
      - libzxing3
      - libmpv2
      - libjxr0t64
      - libdjvulibre21
      - libgraphicsmagick-q16-3t64
      - libgraphicsmagick++-q16-12t64
      - graphicsmagick
      - libcups2t64
      - libyaml-cpp0.8

Log output

:: CMake Error at /snap/kde-qt6-core24-sdk/current/usr/lib/x86_64-linux-gnu/cmake/pugixml/pugixml-targets.cmake:111 (message):
::   The imported target "pugixml::static" references the file
::
::      "/snap/kde-qt6-core24-sdk/current/usr/lib/x86_64-linux-gnu/libpugixml.a"
::
::   but this file does not exist.  Possible reasons include:
::
::   * The file was deleted, renamed, or moved to another location.
::
::   * An install or uninstall procedure did not complete successfully.
::
::   * The installation package was faulty and contained
::
::      "/snap/kde-qt6-core24-sdk/current/usr/lib/x86_64-linux-gnu/cmake/pugixml/pugixml-targets.cmake"
::
::   but not all the files it references.
::
:: Call Stack (most recent call first):
::   /snap/kde-qt6-core24-sdk/current/usr/lib/x86_64-linux-gnu/cmake/pugixml/pugixml-config.cmake:20 (include)
::   CMakeLists.txt:228 (find_package)
::
::
:: -- Configuring incomplete, errors occurred!
Failed to run the build script for part 'photoqt'.
Detailed information: 
:: + cmake /build/photoqt/parts/photoqt/src -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=Release -DWITH_IMAGEMAGICK=OFF -DWITH_GRAPHICSMAGICK=ON -DWITH_LIBRAW=ON -DWITH_DEVIL=ON -DWITH_FREEIMAGE=ON -DWITH_POPPLER=OFF -DWITH_QTPDF=ON -DWITH_LIBARCHIVE=ON -DWITH_VIDEO_QT=ON -DWITH_VIDEO_MPV=ON -DWITH_LIBVIPS=OFF -DWITH_RESVG=OFF -DWITH_EXIV2=ON -DWITH_EXIV2_ENABLE_BMFF=ON -DWITH_PUGIXML=ON -DWITH_ZXING=ON -DWITH_CHROMECAST=OFF -DWITH_LOCATION=ON -DWITH_LCMS2=ON -DWITH_MOTIONPHOTO=ON -DWITH_PHOTOSPHERE=ON -DWITH_INCLUDED_EXTENSIONS=ON
:: CMake Error at /snap/kde-qt6-core24-sdk/current/usr/lib/x86_64-linux-gnu/cmake/pugixml/pugixml-targets.cmake:111 (message):
::   The imported target "pugixml::static" references the file
::      "/snap/kde-qt6-core24-sdk/current/usr/lib/x86_64-linux-gnu/libpugixml.a"
::   but this file does not exist.  Possible reasons include:
::   * The file was deleted, renamed, or moved to another location.
::   * An install or uninstall procedure did not complete successfully.
::   * The installation package was faulty and contained
::      "/snap/kde-qt6-core24-sdk/current/usr/lib/x86_64-linux-gnu/cmake/pugixml/pugixml-targets.cmake"
::   but not all the files it references.
:: Call Stack (most recent call first):
::   /snap/kde-qt6-core24-sdk/current/usr/lib/x86_64-linux-gnu/cmake/pugixml/pugixml-config.cmake:20 (include)
::   CMakeLists.txt:228 (find_package)
Recommended resolution: Check the build output and verify the project can work with the 'cmake' plugin.
For more information, check out: https://documentation.ubuntu.com/snapcraft/8.13.2/reference/plugins/
Full execution log: '/root/.local/state/snapcraft/log/snapcraft-20251220-082232.373367.log'
Build failed
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/lpbuildd/target/build_snap.py", line 323, in run
    self.build()
  File "/usr/lib/python3/dist-packages/lpbuildd/target/build_snap.py", line 306, in build
    self.run_build_command(["snapcraft"], cwd=output_path, env=env)
  File "/usr/lib/python3/dist-packages/lpbuildd/target/operation.py", line 70, in run_build_command
    return self.backend.run(args, cwd=cwd, env=full_env, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/lpbuildd/target/lxd.py", line 736, in run
    subprocess.check_call(cmd, **kwargs)
  File "/usr/lib/python3.12/subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['lxc', 'exec', 'lp-noble-amd64', '--env', 'LANG=C.UTF-8', '--env', 'SHELL=/bin/sh', '--env', 'http_proxy=http://10.10.10.1:8222/', '--env', 'https_proxy=http://10.10.10.1:8222/', '--env', 'HTTP_PROXY=http://10.10.10.1:8222/', '--env', 'HTTPS_PROXY=http://10.10.10.1:8222/', '--env', 'GIT_PROXY_COMMAND=/usr/local/bin/lpbuildd-git-proxy', '--env', 'SNAPPY_STORE_NO_CDN=1', '--env', 'LAUNCHPAD_INSTANCE=production', '--env', 'LAUNCHPAD_SERVER_URL=launchpad.net', '--env', 'SNAPCRAFT_BUILD_INFO=1', '--env', 'SNAPCRAFT_IMAGE_INFO={"build-request-id": "lp-104356469", "build-request-timestamp": "2025-12-20T08:08:59Z", "build_url": "https://launchpad.net/~build.snapcraft.io/+snap/3b9eeba570adc0c0eb0a99e87989645e/+build/2998537"}', '--env', 'SNAPCRAFT_BUILD_ENVIRONMENT=host', '--env', 'SNAPCRAFT_BUILD_FOR=amd64', '--env', 'CRAFT_PLATFORM=amd64', '--', '/bin/sh', '-c', 'cd /build/photoqt && linux64 snapcraft']' returned non-zero exit status 1.
Revoking proxy token...
[Sat Dec 20 08:22:53 2025]
RUN: /usr/share/launchpad-buildd/bin/in-target scan-for-processes --backend=lxd --series=noble --abi-tag=amd64 --isa-tag=amd64 SNAPBUILD-2998537
Scanning for processes to kill in build SNAPBUILD-2998537

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions