← Back to issue list

fix(application): use SNAPCRAFT_MANAGED_MODE everywhere

View original Github issue

Metadata

Project
snapcraft
Number
#4638
Type
pull request
State
merged
Author
mattculler
Labels
Created
Updated
Closed

Current evaluation

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.

Suggested action:

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
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.
qwen3.6-35b-a3b-mtp-q6 Merged a fix to standardize SNAPCRAFT_MANAGED_MODE usage, resolving logging issues in nested managed LXD instances. Approved after passing tests, it resolves issue #4610 but does not fix unrelated spread test failures.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#3962 Setup snapd for snapcraft_legacy providers snapcraft merged Merged a fix for failing spread tests caused by missing snapd sockets in LXD containers. The change adopts snapd initialization logic from craft-providers to properly start the service, resolving connection errors. Approved and passed CI.
73%
#3115 build providers: ignore missing LXD instance when cleaning project snapcraft merged Merged fix for SNAPCRAFT-1DB that catches the pylxd.NotFound exception during project cleanup, preventing failures when the LXD instance is manually deleted. Approved and passed CI.
72%
#2295 tests: use SNAPCRAFT_PACKAGE_TYPE everywhere snapcraft merged Merged PR #2295 to replace SNAPCRAFT_FROM_ environment variables with SNAPCRAFT_PACKAGE_TYPE across all tests, removing unused container tests and streamlining the spread testing transition. Approved with no coverage impact.
72%
#2647 build providers: catch LXD socket error snapcraft merged Merged to catch LXD socket errors in build providers, resolving SNAPCRAFT-WA. Approved by reviewer, passed CI checks, and integrated with a 14-line addition and 6-line deletion across three files. Minor test coverage decrease noted but did not block merge.
71%
#2502 meta: fix management of snap/local snapcraft merged Merged fix for snap/local management that prevents copying it into the snap and improves embedded directory copy logic. Approved, passed CI checks, and resolves SNAPCRAFT-J2 and SNAPCRAFT-JB.
71%
#4329 cli: prioritize `--use-lxd` over `SNAPCRAFT_BUILD_ENVIRONMENT` snapcraft merged Merged. Prioritizes the --use-lxd CLI argument over the SNAPCRAFT_BUILD_ENVIRONMENT environment variable, resolving issue #4307. Approved by reviewer, passed CI checks, and achieved 100% diff coverage.
71%
#2793 tests: enable SNAPCRAFT_BUILD_INFO for spread snapcraft merged Merged following approval and passing CI. Enabled SNAPCRAFT_BUILD_INFO for spread tests to cover manifest changes. Included a fix for the nil-basic spread test. Minimal diff across three files.
70%
#228 packages: run snap operations silently craft-parts merged Merged to fix #218 by running snap subprocesses silently, preventing stdout leakage that conflicts with craft-cli during lifecycle execution. Approved by one reviewer, passed CI, and modified two files (+32/-15 lines).
70%