Support referencing sibling directories of project root
Metadata
Current evaluation
Resolved experimentally by opt-in Git-root builds: PR #2836 (commit e06d40c1) added CHARMCRAFT_EXPERIMENTAL_MONOREPO, with craft-application PR #1109 supporting the underlying project-root behavior.
Resolution: closed resolved
Reason: The sibling-directory limitation was addressed by merged PR #2836, recorded in commit e06d40c1, which enables Git-driven build roots through CHARMCRAFT_EXPERIMENTAL_MONOREPO. Craft-application PR #1109 provides the underlying support, and documentation was added.
Evaluated by: mr-cal-bot
No scores available.
Issue body
### Check existing issues
- [x] I've verified that this request isn't described by any existing issues.
### Request
Consider the following directory structure:
```
my-repo/
shared-lib/
...
charm-1/
charmcraft.yaml
...
charm-2/
charmcraft.yaml
...
```
Currently, Charmcraft cannot readily build the individual charms without some preprocessing, because the `shared-lib` directory will not be accessible from the build containers for each of the charms.
Instead of using the folder containing charmcraft.yaml as the project root, the build environment should mount the entire containing repository and then set the working directory to the charmcraft.yaml directory. Each charm could then define a part with `source: ../shared-lib`.
### The problem it solves
This would fix the limitations encountered in e.g. https://github.com/canonical/charmcraft/issues/1079 and https://github.com/canonical/rockcraft/issues/959.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Resolved experimentally by opt-in Git-root builds: PR #2836 (commit e06d40c1) added CHARMCRAFT_EXPERIMENTAL_MONOREPO, with craft-application PR #1109 supporting the underlying project-root behavior. | |
| stealth/space-bunny-alpha | — | closed resolved | Added opt-in monorepo builds in Charmcraft 4.5 via PR #2836 (e06d40c1), mounting the enclosing Git root so charms can access shared parent and sibling files. | |
| stealth/space-bunny-alpha | — | closed resolved | Monorepo/sibling-directory support implemented experimentally via CHARMCRAFT_EXPERIMENTAL_MONOREPO in charmcraft PR #2836 and craft-application PR #1109, adding a top-level project-root key; docs now available. | |
| qwen/qwen3.6-35b-a3b |
Impact:
75
Quick Win:
29
Complexity:
55
Confidence:
90
Actionability:
85
|
close resolved | Feature request for monorepo support to reference sibling directories. Implemented experimentally via CHARMCRAFT_EXPERIMENTAL_MONOREPO in charmcraft PR #2836 and craft-application PR #1109, with documentation now available. | |
| qwen/qwen3.8-27b |
Impact:
80
Quick Win:
24
Staleness:
15
Complexity:
70
Confidence:
75
Support Request:
10
|
keep open | Feature request to build charms from a monorepo by mounting the whole git repo (sibling dirs like shared-lib) instead of only the charmcraft.yaml dir. Triaged, actively discussed; an experimental git-driven build root (CHARMCRAFT_EXPERIMENTAL_MONOREPO) has since landed. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
25
Complexity:
60
Confidence:
90
Support Request:
5
|
keep open | Feature request to enable referencing sibling directories via a new project-root configuration. Currently triaged with active maintainer design discussions and multiple user endorsements. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
30
Complexity:
65
Confidence:
85
Support Request:
10
|
keep open | Feature request to allow charmcraft to reference sibling directories via a project root configuration. Currently triaged with active design discussions and maintainer feedback on implementation approach. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
15
Complexity:
70
Confidence:
90
Support Request:
5
|
keep open | Feature request to allow charms to reference sibling directories via a project-root configuration. Triaged, under active discussion with design proposals and strong community interest. |
Update history
| Date | Change |
|---|---|
| closed |
Related work
-
Likely Fixed By:
canonical/charmcraft#2836
(confidence 99%)
Merged Charmcraft implementation of opt-in monorepo/Git-root builds.
-
Likely Fixed By:
canonical/craft-application#1109
(confidence 95%)
Underlying craft-application support for the project-root behavior.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #2836 feat: opt into git-driven build root via CHARMCRAFT_EXPERIMENTAL_MONOREPO | charmcraft | merged | Merged in #2836 (commit e06d40c1): adds CHARMCRAFT_EXPERIMENTAL_MONOREPO env var and APP_METADATA.allow_git_build_root so charmcraft packs charms from a monorepo, with unit and spread tests. | |
| #2761 feat(PROTOTYPE): git build-root for monorepos | charmcraft | closed | Prototype PR for git build-root monorepo support was closed unmerged; @mr-cal marked it superseded by PR #2836, which merged (e06d40c1) adding opt-in CHARMCRAFT_EXPERIMENTAL_MONOREPO git-driven build root. | |
| #1079 Do not ignore symlinks to external files | charmcraft | closed | Symlinks to files outside the charm project were skipped during packing. Closed as resolved: PR #2836 (commit e06d40c1) added opt-in CHARMCRAFT_EXPERIMENTAL_MONOREPO, mounting the enclosing git repo root into the build instance; shipped in Charmcraft 4.5 with docs and spread tests. |