canonical / craft-application

The basis for *craft applications
https://canonical-craft-application.readthedocs-hosted.com/en/latest
GNU Lesser General Public License v3.0
5 stars 6 forks source link

Incorrect part name when cd-ing when within the build environment #350

Open sergiusens opened 1 month ago

sergiusens commented 1 month ago

Bug Description

snapcraft-digikam-on-amd64-for-amd64-21103592 ../parts/digikam# cd build
build environment set for part 'parts'

parts should be digikam

To Reproduce

snapcraft build --shell-after
cd /root/parts/digikam/build

part yaml

parts:
    kde-neon:
        source: /snap/snapcraft/current/share/snapcraft/extensions/desktop/kde-neon
        source-type: local
        plugin: make
        make-parameters:
        - PLATFORM_PLUG=kf5-5-113-qt-5-15-11-core22
        build-snaps:
        - kf5-5-113-qt-5-15-11-core22-sdk
        build-environment:
        - &id001
            PATH: /snap/kf5-5-113-qt-5-15-11-core22-sdk/current/usr/bin${PATH:+:$PATH}
        - &id002
            XDG_DATA_DIRS: $CRAFT_STAGE/usr/share:/snap/kf5-5-113-qt-5-15-11-core22-sdk/current/usr/share:/usr/share${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}
        - &id003
            XDG_CONFIG_HOME: $CRAFT_STAGE/etc/xdg:/snap/kf5-5-113-qt-5-15-11-core22-sdk/current/etc/xdg:/etc/xdg${XDG_CONFIG_HOME:+:$XDG_CONFIG_HOME}
        - &id004
            CRAFT_CMAKE_ARGS: -DCMAKE_FIND_ROOT_PATH=/snap/kf5-5-113-qt-5-15-11-core22-sdk/current${CRAFT_CMAKE_ARGS:+:$CRAFT_CMAKE_ARGS}
    digikam:
        after:
        - kde-neon
        parse-info:
        - usr/share/metainfo/org.kde.digikam.appdata.xml
        source: http://download.kde.org/stable/digikam/8.3.0/digiKam-8.3.0-1.tar.xz
        plugin: cmake
        build-packages:
        - appstream
        - bison
        - cmake
        - flex
        - gphoto2
        - libswscale-dev
        - libboost-graph-dev
        - libeigen3-dev
        - libexiv2-dev
        - libexpat1-dev
        - libheif-dev
        - libgphoto2-dev
        - libjpeg-dev
        - liblcms2-dev
        - liblensfun-dev
        - libmagick++-dev
        - libopencv-dev
        - libpng-dev
        - libtiff-dev
        - libusb-1.0-0-dev
        - libxslt1-dev
        - libxml2-dev
        - libglib2.0-dev
        build-snaps:
        - ffmpeg-2204-sdk
        stage-packages:
        - libexif12
        - libgphoto2-6
        - libgphoto2-port12
        - libheif1
        - libimage-exiftool-perl
        - libjpeg8
        - libjpeg-turbo8
        - liblensfun1
        - libltdl7
        - libtbb2
        - libwlocate0
        - libshp2
        - libx265-199
        - libxerces-c3.2
        - liburiparser1
        - libsz2
        - libsuperlu5
        - libspatialite7
        - librttopo1
        - libqhull-r8.0
        - libprotobuf23
        - libproj22
        - libpoppler118
        - libopencv-ml4.5d
        - libopencv-imgproc4.5d
        - libopencv-imgcodecs4.5d
        - libopencv-dnn4.5d
        - libopencv-core4.5d
        - libodbcinst2
        - libnetcdf19
        - libkmlengine1
        - libkmldom1
        - libkmlbase1
        - libhdf5-103
        - libhdf5-hl-100
        - libgif7
        - libgeotiff5
        - libgeos-c1v5
        - libgeos3.10.2
        - libgdcm3.0
        - libfyba0
        - libfreexl1
        - libfftw3-single3
        - libcharls2
        - libcfitsio9
        - libblosc1
        - libarpack2
        - libaec0
        - libmagickwand-6.q16-6
        - libmagickcore-6.q16-6
        - libmagick++-6.q16-8
        - libimath-3-1-29
        - libogdi4.1
        - libgdal30
        - libarmadillo10
        - libblas3
        - kimageformat-plugins
        - libexiv2-27
        stage-snaps:
        - ffmpeg-2204
        build-environment: &id005
        - *id001
        - *id002
        - *id003
        - *id004
        cmake-parameters:
        - "-DKDE_INSTALL_USE_QT_SYS_PATHS=FALSE"
        - "-DCMAKE_INSTALL_PREFIX=/usr"
        - "-DCMAKE_EXPORT_COMPILE_COMMANDS=ON"
        - "-DBUILD_TESTING=OFF"
        - "-DDIGIKAMSC_CHECKOUT_PO=OFF"
        - "-DDIGIKAMSC_CHECKOUT_DOC=OFF"
        - "-DDIGIKAMSC_COMPILE_PO=OFF"
        - "-DDIGIKAMSC_COMPILE_DOC=ON"
        - "-DDIGIKAMSC_COMPILE_DIGIKAM=ON"
        - "-DENABLE_KFILEMETADATASUPPORT=OFF"
        - "-DENABLE_AKONADICONTACTSUPPORT=OFF"
        - "-DENABLE_MYSQLSUPPORT=OFF"
        - "-DENABLE_INTERNALMYSQL=OFF"
        - "-DENABLE_MEDIAPLAYER=ON"
        - "-DENABLE_LCMS2=ON"
        - "-DDIGIKAMSC_USE_PRIVATE_KDEGRAPHICS=OFF"
        - "-DENABLE_DBUS=ON"
        - "-DENABLE_APPSTYLES=ON"
        - "-DENABLE_QWEBENGINE=ON"
        - "-DOpenCV_DIR=$CRAFT_STAGE/usr/share/OpenCV"
        - "-DENABLE_FACESENGINE_DNN=ON"
        - "-DCMAKE_FIND_ROOT_PATH=$CRAFT_STAGE\\;/snap/kf5-5-113-qt-5-15-11-core22-sdk/current\\;/snap/ffmpeg-2204/current"
        - "-Wno-dev"
        override-build: |
            craftctl default

            sed -i "${CRAFT_PART_INSTALL}/usr/share/applications/org.kde.digikam.desktop" -e 's|Icon=digikam$|Icon=${SNAP}/usr/share/icons/hicolor/scalable/apps/digikam.svg|'

            cd "${CRAFT_PART_INSTALL}/usr/share/icons/hicolor/scalable/apps"
            gzip -d -c digikam.svgz > digikam.svg

Relevant log output

n/a