fix(application): use SNAPCRAFT_MANAGED_MODE everywhere
Metadata
Current evaluation
Merged PR #4638 (commit 187777a36) unified application managed-mode checks on SNAPCRAFT_MANAGED_MODE, fixing logs being written to ephemeral in-LXD locations; closes #4610. Spread test failures were not fixed.
Resolution: closed resolved
Reason: The PR was merged into the feature/craft-application branch as commit 187777a36 with two approvals and @sergiusens requesting the merge; reviewer @tigarmo confirmed it fixes issue #4610, and #4610 is now closed.
Evaluated by: mr-cal-bot
No scores available.
Issue body
`craft-application` uses `CRAFT_MANAGED_MODE` environment variable, while `snapcraft` was still using `SNAPCRAFT_MANAGED_MODE`. This was causing inner managed instances of snapcraft to not realize they were running in managed mode, and write their logs into an ephemeral location inside the LXD instance, rendering those logs inaccessible from the host.
Note that while this fixes the logging issue, this does not fix the spread tests that @tigarmo was hoping it would.
- [x] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)?
- [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [x] Have you successfully run `tox run -m lint`?
- [x] Have you successfully run `tox run -e test-py310`? (supported versions: `py39`, `py310`, `py311`, `py312`)
-----
(CRAFT-2539)
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #4638 (commit 187777a36) unified application managed-mode checks on SNAPCRAFT_MANAGED_MODE, fixing logs being written to ephemeral in-LXD locations; closes #4610. Spread test failures were not fixed. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged #4638 (187777a36) standardized application managed-mode checks on SNAPCRAFT_MANAGED_MODE, fixing inaccessible logs in nested managed instances; related Spread failures remained unfixed. | |
| qwen/qwen3.6-35b-a3b | — | — | Merged. Replaces CRAFT_MANAGED_MODE with SNAPCRAFT_MANAGED_MODE to fix log loss in nested LXD instances. Approved by two reviewers and passed CI. Does not address unrelated spread test failures. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged fix standardizing SNAPCRAFT_MANAGED_MODE usage across snapcraft and craft-application. Resolves inner managed instance logging to ephemeral LXD paths. Spread test failures remain unresolved. |
Update history
No update history recorded yet.
Related work
-
Likely Fixed By:
canonical/snapcraft#4610
(confidence 95%)
Issue #4610 (non-core24 managed-mode runs not correctly logged) was fixed by this PR; @tigarmo confirmed the fix in a review comment.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #4610 [core24] Non-core24 runs in managed mode are not being correctly logged | snapcraft | closed | Fixed managed-mode detection by consistently using SNAPCRAFT_MANAGED_MODE, restoring LXD log discovery. Merged in canonical/snapcraft#4638 (187777a36). | |
| #2295 tests: use SNAPCRAFT_PACKAGE_TYPE everywhere | snapcraft | merged | PR #2295 merged as commit ffbad69ea: unit tests now use SNAPCRAFT_PACKAGE_TYPE instead of legacy SNAPCRAFT_FROM_* env vars, and unused container tests were removed to ease migration to spread. (LP: #1794379) |