← Back to issue list

`source-subdir` Not Working With `override-build`

View original Github issue

Metadata

Project
rockcraft
Number
#967
Type
issue
State
closed
Author
MattiaSarti
Labels
Type: Documentation Status: Triaged Type: Bug
Created
Updated
Closed

Current evaluation

Closed without a code fix due to backward compatibility concerns, as correcting the behavior would break existing workarounds. Documentation updates will clarify the current limitation.

Suggested action:

No scores available.

Issue body

### Bug Description In `rockcraft.yaml`, while other `source-` part properties seem to work, `source-subdir` does not, at least when `override-build` is specified as well. ### To Reproduce With Rockcraft **_1.13.0_**, run `rockcraft pack` on the **_rockcraft.yaml_** file introduced with [this pull request](https://github.com/canonical/kubeflow-model-registry-rocks/pull/10), first by keeping the original source (which works) and then undoing the workaround of [this comment](https://github.com/canonical/kubeflow-model-registry-rocks/pull/10#discussion_r2348258259) (which gives the bug). ### Environment Rockcraft **_1.13.0_** on Ubuntu 24.04 LTS. ### rockcraft.yaml ```yaml # Dockerfile: https://github.com/kubeflow/model-registry/blob/v0.2.22/clients/ui/Dockerfile name: model-registry-ui summary: An image for the User Interface (UI) of Kubeflow Model Registry description: An image for the User Interface (UI) of Kubeflow Model Registry version: "0.2.22" license: Apache-2.0 base: ubuntu@24.04 platforms: amd64: run-user: _daemon_ services: ui: command: /bff [ --deployment-mode=kubeflow --port=8080 ] override: replace summary: "model registry ui service" startup: enabled entrypoint-service: ui parts: security-team-requirement: plugin: nil override-build: | mkdir -p ${CRAFT_PART_INSTALL}/usr/share/rocks (echo "# os-release" && cat /etc/os-release && echo "# dpkg-query" && dpkg-query -f '${db:Status-Abbrev},${binary:Package},${Version},${source:Package},${Source:Version}\n' -W) > ${CRAFT_PART_INSTALL}/usr/share/rocks/dpkg.query ui: plugin: nil source: https://github.com/kubeflow/model-registry.git # NOTE: "source-subdir" does not seem to work, but as a workaround "cd" can # be run as the first command of the "override-build" section below # source-subdir: clients/ui/frontend source-tag: v0.2.22 source-type: git build-environment: - DEPLOYMENT_MODE: kubeflow - STYLE_THEME: mui-theme build-snaps: - node/20/stable override-build: |- cd clients/ui/frontend npm cache clean --force npm ci --omit=optional npm run build:prod cp -r dist $CRAFT_PART_INSTALL/static/ bff: plugin: nil source: https://github.com/kubeflow/model-registry.git # NOTE: "source-subdir" does not seem to work, but as a workaround "cd" can # be run as the first command of the "override-build" section below # source-subdir: clients/ui/bff source-tag: v0.2.22 source-type: git build-environment: - CGO_ENABLED: "0" - GOARCH: amd64 - GOOS: linux build-snaps: - go/1.24/stable override-build: |- cd clients/ui/bff go mod download go build -a -o bff ./cmd cp bff $CRAFT_PART_INSTALL/bff ``` ### Relevant log output ```shell The expected subdirectory source is not found and the override-build commands fail. ```

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b Closed without a code fix due to backward compatibility concerns, as correcting the behavior would break existing workarounds. Documentation updates will clarify the current limitation.
qwen/qwen3.6-35b-a3b Closed without a code fix. Maintainers declined to correct the source-subdir behavior with override-build to avoid breaking existing projects using workarounds. Documentation will be updated to clarify the actual behavior.
qwen/qwen3.6-35b-a3b Closed without a code fix. Maintainers declined to correct source-subdir behavior with override-build to avoid breaking existing workarounds. The issue was resolved by updating documentation to reflect the current behavior instead.
qwen3.6-35b-a3b-mtp-q6 Closed as wontfix. Fixing the bug would break existing projects relying on the current workaround. The team decided to maintain backward compatibility and will update documentation to clarify the behavior.
qwen3.6-35b-a3b-mtp-q6 Acknowledged as a bug but declined to fix to avoid breaking existing projects relying on workarounds. Closed as wontfix, with a recommendation to update documentation to clarify the current behavior.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#427 Using `source-subdir` results in `No such file or directory` craft-parts open source-subdir not respected in override-build commands; behavior now documented as intended in #1374, attempted fix #442 was reverted; user must cd into subdir manually in override-build
84%