← 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

core22: spurious "'--enable-manifest'/'--manifest-image-information' is deprecated" warnings appear when only SNAPCRAFT_BUILD_INFO/SNAPCRAFT_IMAGE_INFO env vars are set. Confirmed by mr-cal; fix PR #6452 was closed unmerged, so still unfixed.

Suggested action: keep open

Reason: Maintainer mr-cal reproduced it and pinpointed the root cause: "argparse defaults `--enable-manifest` to `SNAPCRAFT_BUILD_INFO` ... Snapcraft needs to emit deprecation warnings before consuming the envvars." Verified in current HEAD — snapcraft/commands/core22/lifecycle.py:66-76 sets the argparse defaults from SNAPCRAFT_BUILD_INFO/SNAPCRAFT_IMAGE_INFO, and snapcraft/parts/lifecycle.py:361-364 and :456-465 emit the deprecation warning purely on the truthiness of parsed_args.enable_manifest, so the documented env-var path still triggers the warning. The referenced PR #6452 was "Closed without merge" and the issue remains open with no replacement fix, so the bug is valid and unaddressed. Impact is moderate (misleading deprecation output that pushes users away from the documented supported mechanism, core22-only), while the fix is small (distinguish explicit CLI args from env-var defaults) with an existing unit test at tests/unit/cli/test_lifecycle.py:602-630.

Evaluated by: mr-cal-bot

Impact: 35 Quick Win: 21 Complexity: 30 Confidence: 88 Actionability: 85

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
stealth/space-bunny-alpha
Impact: 35
Quick Win: 21
Complexity: 30
Confidence: 88
Actionability: 85
keep open core22: spurious "'--enable-manifest'/'--manifest-image-information' is deprecated" warnings appear when only SNAPCRAFT_BUILD_INFO/SNAPCRAFT_IMAGE_INFO env vars are set. Confirmed by mr-cal; fix PR #6452 was closed unmerged, so still unfixed.
stealth/space-bunny-alpha
Impact: 25
Quick Win: 16
Complexity: 25
Confidence: 88
Actionability: 85
keep open core22 lifecycle emits spurious deprecation warnings for --enable-manifest/--manifest-image-information when values come from SNAPCRAFT_BUILD_INFO/SNAPCRAFT_IMAGE_INFO env vars; fix PR #6452 open
qwen/qwen3.6-35b-a3b
Impact: 30
Quick Win: 17
Complexity: 30
Confidence: 85
Actionability: 80
keep open Deprecation warnings for --enable-manifest and --manifest-image-information are emitted when users set SNAPCRAFT_BUILD_INFO/SNAPCRAFT_IMAGE_INFO env vars instead of passing the deprecated flags directly
qwen/qwen3.8-27b
Impact: 20
Quick Win: 14
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.

Update history

Date Change
updated
updated

Related work

  • Related To: snapcraft#6452 (confidence 92%)

    PR 'fix(core22): don't warn about manifest arguments set by env vars' was opened by wak327 to fix this issue but closed without merge; it is superseded, so the underlying bug remains. Consider re-reviewing/reopening it.

Related issues

Issue Project State Summary Similarity
#4618 feat!: deprecate enable-manifest and manifest-image-information snapcraft merged Merged #4618 as e426d07a3, removing both options from core24; manifest generation now uses SNAPCRAFT_BUILD_INFO.
76%
#6452 fix(core22): don't warn about manifest arguments set by env vars snapcraft closed Closed unmerged without a resolving commit. The proposed core22 fix suppressed manifest-option warnings when values came from SNAPCRAFT environment variables; issue #4916 remains open.
73%