cli: prioritize `--use-lxd` over `SNAPCRAFT_BUILD_ENVIRONMENT`
Metadata
Current evaluation
Merged PR #4329 (commit 7f8d4cff9) fixes #4307: get_provider() now checks the CLI --use-lxd argument before SNAPCRAFT_BUILD_ENVIRONMENT, matching documented priority.
Resolution: closed resolved
Reason: PR #4329 by maintainer mr-cal was merged as commit 7f8d4cff9; snapcraft/providers.py get_provider() now selects the provider argument first and only falls back to the SNAPCRAFT_BUILD_ENVIRONMENT env var, snap config, then platform default, and docs/how-to/select-a-build-provider.rst documents the same priority.
Evaluated by: mr-cal-bot
No scores available.
Issue body
- [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 `make lint`?
- [x] Have you successfully run `pytest tests/unit`?
-----
Prioritize the command line argument `--use-lxd` over the environment variable `SNAPCRAFT_BUILD_ENVIRONMENT=host`.
Resolves #4307
(CRAFT-1956)
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #4329 (commit 7f8d4cff9) fixes #4307: get_provider() now checks the CLI --use-lxd argument before SNAPCRAFT_BUILD_ENVIRONMENT, matching documented priority. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged #4329 made --use-lxd override SNAPCRAFT_BUILD_ENVIRONMENT, resolving #4307; landed as commit 7f8d4cff9. | |
| qwen/qwen3.6-35b-a3b | — | — | 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. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged CLI update to prioritize the --use-lxd flag over the SNAPCRAFT_BUILD_ENVIRONMENT environment variable, resolving issue #4307. The change maintains 100% test coverage and enforces explicit command line overrides. |
Update history
No update history recorded yet.
Related work
-
Related To:
canonical/snapcraft#4307
(confidence 97%)
Issue 'SNAPCRAFT_BUILD_ENVIRONMENT apparently takes precedence over --use-lxd', now closed by this merge.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #4307 SNAPCRAFT_BUILD_ENVIRONMENT apparently takes precedence over "--use-lxd" | snapcraft | closed | Fixed by merged PR #4329 (commit 7f8d4cff9): --use-lxd now overrides SNAPCRAFT_BUILD_ENVIRONMENT, matching documented precedence. | |
| #354 Prefer `--use-lxd` over `CRAFT_BUILD_ENVIRONMENT` | craft-application | closed | Fixed in PR #1229 by updating _use_provider to check --use-lxd before CRAFT_BUILD_ENVIRONMENT, ensuring CLI flags take priority. | |
| #4832 `SNAPCRAFT_BUILD_ENVIRONMENT` takes priority over `--use-lxd` | snapcraft | open | Triaged bug: PR #4329 fixed core22 precedence for SNAPCRAFT_BUILD_ENVIRONMENT, but core24 remains unverified and its spread test is restricted to Ubuntu 22.04; CRAFT_MANAGED_MODE precedence is intentional. | |
| #1229 fix(lifecycle): prefer --use-lxd over CRAFT_BUILD_ENVIRONMENT | craft-application | merged | Merged PR #1229 fixes #354 by making --use-lxd override CRAFT_BUILD_ENVIRONMENT=host to force managed mode in _use_provider, with updated tests and documentation. | |
| #2179 cli: SNAPCRAFT_BUILD_ENVIRONMENT isn't deprecated | snapcraft | merged | Merged PR #2179 (commit 1ff7550be) by kyrofa fixed the conflicting-env-vars error in the CLI, which wrongly named SNAPCRAFT_BUILD_ENVIRONMENT as deprecated; it now correctly names SNAPCRAFT_CONTAINER_BUILDS. |