feat: add override-overlay
Metadata
Current evaluation
Merged override-overlay support via #1472 (43dc8484), adding chrooted scriptlets, validation, mounts, hashing, and tests; docs followed in #1473 for 2.30.0.
Resolution: closed resolved
Reason: The feature landed in canonical/craft-parts#1472 at commit 43dc8484, with chroot execution, mutual-exclusion validation, hashing, and tests. PR #1473 added documentation and changelog coverage, listing the feature in version 2.30.0.
Evaluated by: mr-cal-bot
No scores available.
Issue body
- [ x] Have you followed the guidelines for contributing?
- [ x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [x ] Have you successfully run `make lint && make test`?
- [ ] Have you added an entry to the changelog (`docs/reference/changelog.rst`)?
---
**Summary of Changes**
This PR introduces the new override-overlay feature, enabling execution of an overlay scriptlet inside a chrooted environment as an alternative to the existing overlay-script mechanism.
**Key Updates**
Grammar: Added override-overlay keyword.
Validation: Added schema validation ensuring override-overlay is mutually exclusive with overlay-script.
**Execution logic:**
When override-overlay is set, run the scriptlet from within a minimal chroot.
Added necessary mountpoints (/usr, /bin, /lib64, /lib) to support chroot execution.
Hashing: Included override-overlay in layer hashing to ensure proper rebuild triggers.
Tests: Updated marshalling/unmarshalling tests to include the new field when not setted.
**Impact**
This feature expands overlay customization capabilities while preserving backwards compatibility. Standard overlay-script continues to function normally when override-overlay is not provided.
**Testing**
I tested the feature using the following parts.yaml, which exercises the override-overlay scriptlet inside the chroot and verifies environment behavior through proof.txt, using : python -m craft_parts --overlay-base <basedir> [clean]
```
parts:
hello:
plugin: nil
source: hello.sh
source-type: file
#overlay-script: |
override-overlay: |
echo "==== CHROOT TEST ===" > proof.txt
echo "PWD: $(pwd)" >> proof.txt
echo "result of : ls -l ." >> proof.txt
ls -l . >> proof.txt
readlink -f / >> proof.txt
override-build: |
cp hello.sh "${CRAFT_PART_INSTALL}/hello"
chmod +x "${CRAFT_PART_INSTALL}/hello"
stage:
- "*"
prime:
- "*"
```
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged override-overlay support via #1472 (43dc8484), adding chrooted scriptlets, validation, mounts, hashing, and tests; docs followed in #1473 for 2.30.0. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged #1472 (43dc8484), adding chrooted override-overlay scriptlets, overlay-script validation, required mounts, layer hashing, and test updates. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #1472 introduced override-overlay, running overlay scriptlets in a minimal chroot. Commit 43dc8484 added grammar, validation, execution, hashing, and tests; documentation followed in #1473. | |
| qwen/qwen3.6-35b-a3b | — | — | Merged override-overlay, enabling scriptlets to run in a chroot. Adds grammar support, mutual exclusivity with overlay-script, chroot mountpoints, layer hashing, and tests. Approved and passed CI. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged the override-overlay feature, allowing overlay scriptlets to execute within a chroot environment. Implementation includes schema validation, required mountpoints, layer hashing, and tests, preserving backward compatibility with overlay-script. |
Update history
No update history recorded yet.
Related work
-
Likely Fixed By:
canonical/craft-parts#1472
(confidence 100%)
Merged implementation commit 43dc8484 added override-overlay support.
-
Related To:
canonical/craft-parts#1473
(confidence 98%)
Merged commit 1b2b7d5a documented the feature and added its 2.30.0 changelog entry.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1472 feat: add override-overlay | craft-parts | merged | Merged #1472 (43dc8484), adding override-overlay scriptlets that run during the overlay step in a chroot, with validation and tests. | |
| #1473 docs: add override-overlay | craft-parts | merged | Merged into main as #1473 (commit 1b2b7d5a), documenting the override-overlay key and recording the feature introduced by #1472 in the changelog. | |
| #1165 feat: enable override-overlay | rockcraft | merged | Merged in rockcraft#1165 via commit 1024f092, enabling override-overlay, updating a spread test from overlay-script, and documenting the key. | |
| #299 feat: enable override-overlay | imagecraft | merged | Merged in #299 via commit 6d283be, upgrading craft-parts to ~=2.30 and adding spread coverage for override-overlay support. | |
| #134 overlay: add overlay package install (CRAFT-81) | craft-parts | merged | Merged in commit 041af872, adding chrooted overlay package installation on each declaring part's upper layer so maintainer scripts run and package databases stay correct. | |
| #1567 feat(overlay): plugins can define overlay commands | craft-parts | merged | Merged as commit 73d6a988, enabling plugin-defined overlay-chroot commands that users can replace or wrap via override-overlay. | |
| #1579 fix(state): track override-overlay changes | craft-parts | merged | Merged in commit 059b1c0f, adding override-overlay dirty tracking and unit coverage so override scriptlet changes are detected; fixes #1566. | |
| #111 overlay: add overlayfs helpers (CRAFT-462) | craft-parts | merged | Merged PR #111 via commit 7424a039, adding OverlayFS mount/unmount helpers and detection for special files and directories used in filesystem layering. |