← Back to issue list

Allow setting of a working directory for the resulting ROCK in rockcraft.yaml

View original Github issue

Metadata

Project
rockcraft
Number
#121
Type
issue
State
open
Author
gruyaume
Labels
Created
Updated
Closed

Current evaluation

Feature request for a working-directory field in rockcraft.yaml to avoid cd wrappers. Core need addressed by service-level working-dir added in PR #305; maintainer triaged in Feb 2026 asking reporter to confirm if service-level is sufficient, no response in ~6 months.

Suggested action: close stale

Reason: The core use case (avoiding cd wrappers) is resolved by service-level working-dir merged in PR #305 (commit 4594740f). Maintainer gcomneno triaged on 2026-02-26 asking the reporter to confirm whether service-level working-dir suffices or if OCI image-level WorkingDir is specifically needed; no response after ~6 months. The remaining narrower request (OCI WorkingDir) is unconfirmed and the issue is 1419 days old.

Impact: 30 Quick Win: 19.5 Staleness: 60 Complexity: 35 Confidence: 78 Support Request: 10

Issue body

**Feature Request** Lots of software require the user to be in a given directory before the startup command can be called. As of Today, there is no way to set the working directory of a given rock, the default working directory being "/". This forces users to create an entrypoint (or cmd) that `cd's` in a given directory before calling the actual command). It would be great if a `working-directory` field was added to `rockcraft.yaml` that would set the working directory to the provided path. Here's an example of how the rockcraft.yaml could look: ```yaml name: magma-orc8r-nms-magmalte version: "1.6.0" base: ubuntu:18.04 summary: Magma Orchestrator NMS Magmalte description: Magma Orcestrator NMS Magmalte license: Apache-2.0 platforms: amd64: cmd: ["/bin/yarn", "run", "start:prod"] working-directory: "/usr/src/packages/magmalte/" ``` **Expected behaviour** - The `entrypoint` command is executed from the provided working-directory - At run time, if you `exec` a command in the container, it is executed from the directory provided in the `rockcraft.yaml` file. - Ideally: This working directory is available through environment variables inside of parts (ex. `$WORKING_DIRECTORY`).

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 30
Quick Win: 19.5
Staleness: 60
Complexity: 35
Confidence: 78
Support Request: 10
close stale Feature request for a working-directory field in rockcraft.yaml to avoid cd wrappers. Core need addressed by service-level working-dir added in PR #305; maintainer triaged in Feb 2026 asking reporter to confirm if service-level is sufficient, no response in ~6 months.
qwen/qwen3.6-35b-a3b
Staleness: 85
Complexity: 10
Confidence: 85
Support Request: 10
close stale Request to add a global working-directory field to rockcraft.yaml. Maintainers noted PR #305 added service-level working-dir support and asked if it resolves the request. Awaiting author confirmation after 4+ months of silence.
qwen3.6-35b-a3b-mtp-q6
Staleness: 85
Complexity: 20
Confidence: 90
Support Request: 10
close stale Feature request to add a global working-directory field to rockcraft.yaml. A maintainer recently noted that PR #305 already provides service-level working-dir support, addressing the original use case. Waiting for author confirmation after 4 months of inactivity.
qwen3.6-35b-a3b-mtp-q6
Staleness: 85
Complexity: 20
Confidence: 90
Support Request: 10
close stale Request to add a global working directory field to rockcraft.yaml. Resolved by PR #305, which introduced service-level working-dir support. Maintainers are confirming if the service-level option covers the original use case before closing.

Update history

No update history recorded yet.

Related work

  • Likely Fixed By: canonical/rockcraft#305 (confidence 85%)

    PR #305 'feat: add support for working-dir in the service schema' was merged and is referenced in the triage comment as covering the original request to avoid cd wrappers.

Related issues

No related issues found above the similarity threshold.