cli: prioritize `--use-lxd` over `SNAPCRAFT_BUILD_ENVIRONMENT`
Metadata
Current evaluation
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.
Suggested action: —
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 |
|---|---|---|---|---|
| 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. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged CLI update prioritizing the --use-lxd flag over the SNAPCRAFT_BUILD_ENVIRONMENT environment variable, resolving issue #4307. The change achieved 100% diff coverage and was successfully integrated into the main branch. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #4832 `SNAPCRAFT_BUILD_ENVIRONMENT` takes priority over `--use-lxd` | snapcraft | open | SNAPCRAFT_BUILD_ENVIRONMENT was overriding the --use-lxd CLI flag; CRAFT_MANAGED_MODE precedence is intended per maintainer. Fixed by merged PR #4329 (commit 7f8d4cff9) which prioritizes the flag; issue remains open and can be closed. | |
| #4307 SNAPCRAFT_BUILD_ENVIRONMENT apparently takes precedence over "--use-lxd" | snapcraft | closed | Fixed via PR #4330. The SNAPCRAFT_BUILD_ENVIRONMENT environment variable no longer overrides the --use-lxd CLI flag. Command line arguments now correctly take precedence over environment variables for build provider selection. | |
| #1585 lxd: pass SNAPCRAFT_PARTS_URI through into container | snapcraft | merged | Merged to resolve bug 1719951. The change passes the SNAPCRAFT_PARTS_URI environment variable into LXD containers. Approved by one reviewer, passed CI checks, and added 19 lines across two files. | |
| #4638 fix(application): use SNAPCRAFT_MANAGED_MODE everywhere | snapcraft | merged | 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. | |
| #1263 lxd: pass through commands into the container | snapcraft | merged | Merged a pull request enabling snapcraft to pass build commands into LXD containers. The change allows remote builds to execute within the container environment, addressing path mounting issues during remote snap creation. Approved by one reviewer, though coverage decreased slightly. |