← Back to issue list

`--enable-manifest` and `--manifest-image-information` deprecation warnings display when options haven't been used

View original Github issue

Metadata

Project
snapcraft
Number
#4916
Type
issue
State
open
Author
jhenstridge
Labels
Created
Updated
Closed

Current evaluation

Snapcraft emits spurious deprecation warnings for --enable-manifest and --manifest-image-information when users set the documented SNAPCRAFT_BUILD_INFO/SNAPCRAFT_IMAGE_INFO env vars instead of the flags. Maintainer confirmed repro and root cause (argparse defaults consume env vars); bug still present in code.

Suggested action: keep open

Reason: Maintainer mr-cal confirmed the repro and identified the root cause ('argparse defaults --enable-manifest to SNAPCRAFT_BUILD_INFO... Snapcraft needs to emit deprecation warnings before consuming the envvars'), so the issue is triaged and valid. The bug is still present in the current code (snapcraft/parts/lifecycle.py:357-361 and 456-464 still warn based on parsed_args values that are populated from env vars), so it remains relevant. It is a minor cosmetic annoyance rather than a functional break, keeping impact low.

Impact: 20 Quick Win: 14.0 Staleness: 65 Complexity: 30 Confidence: 85 Support Request: 0

Issue body

### Bug Description When updating the CI for the `snapcore/action-build` Github action, I noticed that it generated warnings like: ``` /usr/bin/sudo -u runner -E snapcraft '--enable-manifest' is deprecated, and will be removed in core24. '--manifest-image-information' is deprecated, and will be removed in core24. ``` I had not passed either of these command line options, instead setting the `SNAPCRAFT_BUILD_INFO` and `SNAPCRAFT_IMAGE_INFO` environment variables (which is [documented as the supported replacement](https://snapcraft.io/docs/build-options#heading--deprecated)). ### To Reproduce In a core22 project, run `SNAPCRAFT_BUILD_INFO=1 SNAPCRAFT_IMAGE_INFO={} snapcraft`. ### Environment Snapcraft 8.3.1 running on Ubuntu 24.04. ### snapcraft.yaml ```shell base: core22 ``` ### Relevant log output ```shell 2024-07-15 17:02:36.558 '--enable-manifest' is deprecated, and will be removed in core24. 2024-07-15 17:02:36.558 '--manifest-image-information' is deprecated, and will be removed in core24. ``` ### Additional context _No response_

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 20
Quick Win: 14.0
Staleness: 65
Complexity: 30
Confidence: 85
Support Request: 0
keep open Snapcraft emits spurious deprecation warnings for --enable-manifest and --manifest-image-information when users set the documented SNAPCRAFT_BUILD_INFO/SNAPCRAFT_IMAGE_INFO env vars instead of the flags. Maintainer confirmed repro and root cause (argparse defaults consume env vars); bug still present in code.
qwen/qwen3.6-35b-a3b
Staleness: 75
Complexity: 20
Confidence: 90
Support Request: 0
keep open Snapcraft incorrectly shows deprecation warnings for enable-manifest and manifest-image-information when users set the documented environment variables instead. A maintainer confirmed the bug and identified the root cause in argparse handling.
qwen3.6-35b-a3b-mtp-q6
Staleness: 80
Complexity: 15
Confidence: 90
Support Request: 0
keep open Snapcraft emits deprecation warnings for CLI flags when only environment variables are used. Maintainer reproduced the issue and identified an argparse defaulting cause. Currently open and unlabelled.
qwen3.6-35b-a3b-mtp-q6
Staleness: 85
Complexity: 20
Confidence: 85
Support Request: 5
keep open False deprecation warnings trigger for --enable-manifest and --manifest-image-information when using their environment variable replacements. Root cause identified: argparse defaults the flags to the env vars, causing premature warnings. Needs fix.

Update history

No update history recorded yet.

Related work

  • Caused By: canonical/snapcraft#4618 (confidence 70%)

    Commit e426d07a3 'feat!: deprecate enable-manifest and manifest-image-information (#4618)' introduced the deprecation warnings that fire on env-var-driven defaults.

Related issues

No related issues found above the similarity threshold.