← Back to issue list

feat(remote-build): add --project-dir argument to support build paths

View original Github issue

Metadata

Project
snapcraft
Number
#6372
Type
pull request
State
open
Author
Tejas-Raj01
Labels
PR: Run Manual Spread
Created
Updated
Closed
—

Current evaluation

Adds --project-dir to snapcraft remote-build (monorepo/build paths) with unit + spread tests. Maintainer testing rejected the os.chdir/sys.argv workaround in favor of build-path; remote-build and lint CI are red, no approvals, quiet 28 days.

Suggested action: keep open

Reason: The approach is still unvalidated: mr-cal reported the exact repro failing ('Could not find a git repository in .../remote-build-subdir/foo') and stated 'os.chdir isn't the right approach either... We should be using the `build-path` instead', then flagged the craft-application monorepo PR #1109 as a possible alternative. The `remote-build` CI check is failing and there are 0 approvals with 28 days of inactivity, so this needs rework rather than merge; it is not yet abandoned (last author push 2026-08-22), so closing as stale is unwarranted. Note the `lint / files` failure was explicitly declared out of scope by mr-cal ("You can ignore this failure for now, it will be addressed by #6378", now merged with PLR0917 added to pyproject.toml), so that red check alone should not drive the decision.

Evaluated by: mr-cal-bot

Impact: 32 Quick Win: 5 Complexity: 35 Confidence: 80 Actionability: 25

Issue body

Fixes #6287 **Describe your changes:** This PR introduces the `--project-dir` command-line argument for the `snapcraft remote-build` command to support monorepo setups and custom build paths, fulfilling the requirements outlined in Issue #6287. **Key Technical Details:** * **Command-Line Interface:** Added the `--project-dir` option in `snapcraft/commands/remote.py`, mapping it to the newly supported `build_path` parameter in upstream `craft-application`. * **Testing (Unit):** Added unit tests in `tests/unit/commands/test_remote.py` to verify the argument parsing and API calls. A pre-existing test fixture (`test_multiple_artifacts_per_build_on`) was bypassed for the `PLR0917` linter rule using `# noqa: PLR0917` to keep the PR scope focused and avoid unrelated refactoring. * **Testing (Spread):** Created a new spread test environment under `tests/spread/core24/remote-build/` (including `task.yaml`, `arguments.txt`, `expected-snaps.txt`, and dummy project data) to exercise the `--project-dir` functionality in a remote build scenario. * **Release Notes:** Documented the new feature in `docs/release-notes/snapcraft-9-0.rst` under the "Minor features" section. --- - [x] I've followed the [contribution guidelines](https://github.com/canonical/snapcraft/blob/main/CONTRIBUTING.md). - [x] I've signed the [CLA](http://www.ubuntu.com/legal/contributors/). - [x] I've successfully run `make lint && make test`. - [x] I've added or updated any relevant documentation. - [x] In documents I changed, I [added a meta description](https://canonical-starflow.readthedocs-hosted.com/how-to/add-a-page-meta-description/) if one was missing. - [x] I've updated the relevant release notes.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 32
Quick Win: 5
Complexity: 35
Confidence: 80
Actionability: 25
keep open Adds --project-dir to snapcraft remote-build (monorepo/build paths) with unit + spread tests. Maintainer testing rejected the os.chdir/sys.argv workaround in favor of build-path; remote-build and lint CI are red, no approvals, quiet 28 days.
stealth/space-bunny-alpha
Impact: 48
Quick Win: 5
Complexity: 58
Confidence: 92
Actionability: 25
keep open Adds --project-dir to remote-build with unit and Spread coverage, but maintainer testing rejected the chdir workaround; build-path/monorepo integration remains unresolved and remote-build/lint CI is red.
qwen3.6-35b-a3b-mtp-q6
Impact: 50
Quick Win: 22
Staleness: 35
Complexity: 55
Confidence: 75
keep open Adds --project-dir argument to snapcraft remote-build for monorepo support. Under active review with maintainer suggesting alternative approaches using build-path or upstream monorepo feature.
qwen/qwen3.6-35b-a3b
Staleness: 5
Complexity: 40
Confidence: 90
needs review Adds --project-dir CLI argument for snapcraft remote-build to support monorepos. Currently awaiting contributor updates after maintainer feedback indicates the current chdir-based fix causes git repository detection failures and suggests using build-path instead.
qwen/qwen3.6-35b-a3b
Staleness: 5
Complexity: 40
Confidence: 85
needs review Adds --project-dir CLI argument for remote-build to support monorepos. Currently under active review with maintainer feedback on git directory handling and acknowledged CI lint failures.
qwen/qwen3.6-35b-a3b
Staleness: 5
Complexity: 35
Confidence: 90
needs review Adds --project-dir CLI argument to snapcraft remote-build for monorepo support. Includes unit and spread tests. Recently updated to fix a FileNotFoundError by parsing sys.argv early. Awaiting maintainer review.
qwen/qwen3.6-35b-a3b
Staleness: 10
Complexity: 40
Confidence: 85
needs review Adds --project-dir CLI argument to snapcraft remote-build for monorepo support. Recently updated to fix a FileNotFoundError by overriding the project directory before framework initialization. Awaiting maintainer review; known unrelated lint failure acknowledged by maintainer.
qwen/qwen3.6-35b-a3b
Staleness: 10
Complexity: 25
Confidence: 90
keep open Adds --project-dir CLI argument to snapcraft remote-build for monorepo support. Includes unit and spread tests, plus release notes. Currently awaiting contributor updates to fix a FileNotFoundError and rebase on main, with maintainer approval to ignore unrelated lint failures.
qwen/qwen3.6-35b-a3b
Staleness: 5
Complexity: 25
Confidence: 85
keep open Adds --project-dir CLI argument to snapcraft remote-build for monorepo support. Includes unit and spread tests. Currently awaiting author updates to fix a FileNotFoundError and merge main, with maintainer approval to ignore unrelated lint failures.
qwen/qwen3.6-35b-a3b
Staleness: 10
Complexity: 25
Confidence: 85
keep open Adds --project-dir CLI argument to snapcraft remote-build for monorepo support. Includes unit and spread tests, updates release notes. Currently awaiting contributor's follow-up commits to fix a FileNotFoundError and rebase on main.
qwen/qwen3.6-35b-a3b
Staleness: 5
Complexity: 25
Confidence: 85
needs review Adds --project-dir CLI argument to snapcraft remote-build for monorepo support. Includes unit and spread tests. Author is rebasing and fixing a maintainer-reported FileNotFoundError. Awaiting maintainer review.
qwen/qwen3.6-35b-a3b
Staleness: 10
Complexity: 25
Confidence: 85
keep open Adds --project-dir CLI argument to snapcraft remote-build for monorepo support. Includes unit and spread tests, plus release notes. Currently awaiting author's push to fix a FileNotFoundError and rebase on main, with maintainer approval to ignore unrelated lint failures.
qwen/qwen3.6-35b-a3b
Staleness: 10
Complexity: 20
Confidence: 85
keep open Adds --project-dir CLI argument to snapcraft remote-build for monorepo support. Includes unit and spread tests. Currently awaiting author's follow-up commit to fix a FileNotFoundError and address CI lint failures.
qwen/qwen3.6-35b-a3b
Staleness: 5
Complexity: 25
Confidence: 85
keep open Adds --project-dir CLI argument to snapcraft remote-build for monorepo support. Includes unit and spread tests. Maintainer acknowledged unrelated lint failures; author is preparing updates to fix a FileNotFoundError and merge main.
qwen/qwen3.6-35b-a3b
Staleness: 10
Complexity: 25
Confidence: 85
needs review Adds --project-dir CLI argument to snapcraft remote-build for monorepo support. Includes unit and spread tests, updates release notes. Awaiting maintainer review; CI lint failure acknowledged and deferred to another PR.
qwen/qwen3.6-35b-a3b
Staleness: 15
Complexity: 25
Confidence: 85
needs review Adds --project-dir CLI argument to snapcraft remote-build for monorepo support. Includes unit and spread tests, plus release notes. Awaiting maintainer review; CI lint failures acknowledged and deferred to another PR.
qwen3.6-35b-a3b-mtp-q6
Staleness: 5
Complexity: 25
Confidence: 85
needs review Adds --project-dir CLI argument to snapcraft remote-build for monorepo support. Includes unit/spread tests and docs. Awaiting maintainer review and guidance on pre-existing lint failures.
qwen3.6-35b-a3b-mtp-q6
Staleness: 5
Complexity: 20
Confidence: 85
needs review Adds --project-dir CLI argument to snapcraft remote-build for monorepo support. Includes unit/spread tests and docs. Currently awaiting maintainer guidance on unrelated lint failures and initial review.

Update history

Date Change
updated
updated
updated
updated
updated
updated
updated
updated
updated
updated
updated
updated
updated
updated
updated
updated
updated
updated
created

Related work

  • Related To: canonical/snapcraft#6287 (confidence 95%)

    Tracking issue the PR claims to fix; still open, summary confirms Snapcraft implementation and spread coverage remain outstanding.

  • Related To: canonical/snapcraft#6378 (confidence 90%)

    Merged ruff 0.16 PR that mr-cal said would address the pre-existing PLR0917 lint failures in this PR's CI.

  • Related To: canonical/craft-application#1109 (confidence 55%)

    Merged opt-in monorepo support cited by mr-cal as a possibly cleaner alternative to --project-dir, though no decision was made.

Related issues

Issue Project State Summary Similarity
#6287 remote-build: support build paths snapcraft open Triaged enhancement to let remote-build select a nested snapcraft.yaml via --project-dir; upstream support is complete, but Snapcraft implementation and spread coverage remain.
79%
#1106 remote-build: support `build_path` for snaps craft-application closed Closed as triaged after narrowing support to remote-build --project-dir; Snapcraft-side implementation remains in canonical/snapcraft#6287.
77%
#1128 feat(remotebuild): add build-path to snap recipes craft-application merged Merged PR #1128 as commit 90cc2c75, adding Launchpad build-path support to SnapRecipe and RemoteBuildService. It fixes #1106 and unblocks canonical/snapcraft#6287.
71%