← Back to issue list

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

View original Github issue

Metadata

Project
craft-application
Number
#350
Type
issue
State
open
Author
sergiusens
Labels
—
Created
Updated
Closed
—

Current evaluation

instance_bashrc prints 'parts' instead of the real part name when cd-ing into a part build dir; caused by ${PWD#$"HOME"} quoting bug, still present at HEAD, unlabelled and unattended.

Suggested action: needs triage

Reason: The bug is confirmed still live at pinned HEAD: craft_application/misc/instance_bashrc line 19 uses `part_name=$(echo "${PWD#$"HOME"}" | cut -d "/" -f 3)`, where $"HOME" expands to the literal string HOME (not /root), so the prefix strip never matches and `cut -f 3` of /root/parts/digikam/build yields exactly the reported 'parts'. The root cause is pinpointed and the environment itself is sourced correctly, so impact is cosmetic-only. However, the issue has zero labels, zero comments and no maintainer response, so it shows no sign of having been categorised — needs_triage is the appropriate state pending a maintainer decision on whether a cosmetic shell-prompt message is worth fixing.

Evaluated by: mr-cal-bot

Impact: 25 Quick Win: 20 Complexity: 8 Confidence: 88 Actionability: 88

Issue body

### 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 ```shell 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 ```shell n/a ```

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 25
Quick Win: 20
Complexity: 8
Confidence: 88
Actionability: 88
needs triage instance_bashrc prints 'parts' instead of the real part name when cd-ing into a part build dir; caused by ${PWD#$"HOME"} quoting bug, still present at HEAD, unlabelled and unattended.
qwen/qwen3.6-35b-a3b
Impact: 20
Quick Win: 16
Complexity: 10
Confidence: 90
Actionability: 90
keep open The build environment shell script incorrectly extracts the part name due to a typo ($"HOME" instead of $HOME), causing it to always display 'parts' instead of the actual part name.
qwen/qwen3.8-27b
Impact: 20
Quick Win: 14
Staleness: 75
Complexity: 30
Confidence: 70
Support Request: 0
needs triage Shell prompt in snapcraft build --shell-after shows wrong part name ('parts' instead of 'digikam') when cd-ing into a part's build dir. Bug in craft_application/misc/instance_bashrc part-name detection. No maintainer response, no labels, 465 days since last activity.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 20
Confidence: 85
Support Request: 5
needs triage Bug where cd build in snapcraft shell prints incorrect part name (parts instead of actual part name). Open, unlabelled, no maintainer comments, inactive for over a year.
qwen3.6-35b-a3b-mtp-q6
Staleness: 85
Complexity: 40
Confidence: 75
Support Request: 10
needs triage Bug where cd build inside a snapcraft shell incorrectly reports the part name as 'parts' instead of the actual part. Unlabelled, no maintainer comments, inactive for over two years.

Update history

No update history recorded yet.

Related issues

No related issues found above the similarity threshold.