snapcraft
snapcraft copied to clipboard
Setting verbosity via environment variable no longer works on 8.0.4.post33+git61228836
Bug Description
One can set verbosity level either via CLI with a flag --verbosity=foo
or with a corresponding environment variable SNAPCRAFT_VERBOSITY_LEVEL=foo
. Doing the latter no longer works, and the default verbosity level is used instead.
Other environment variables seem unaffected (like SNAPCRAFT_{BUILD_INFO,UA_TOKEN}
).
To Reproduce
Install snapcraft
on latest/edge (tested on 10677 (amd64) and 10926 (riscv64))
Set SNAPCRAFT_VERBOSITY_LEVEL=verbose
Invoke snapcraft
for any snap
Using --verbosity=verbose
works as expected.
The behavior is as expected in my test-cases using latest/stable.
Environment
Ubuntu ~23.10 on AMD64 and RISCV64. On RISCV64, it's just the simple preinstalled server image for the VisionFive2. In my test cases I was building ubuntu-image and serial-vault-snap.
snapcraft.yaml
Any snapcraft.yaml should suffice
Relevant log output
ubuntu@ubuntu:~/ubuntu-image$ env | grep SNAPCRAFT_VERBOSITY
SNAPCRAFT_VERBOSITY_LEVEL=verbose
ubuntu@ubuntu:~/ubuntu-image$ snapcraft
Attached specified UA token
Detached specified UA token
Generated snap metadata
Generated snap manifest
Lint OK:
- classic: Snap confinement is set to classic.
Lint warnings:
- library: libbrotlienc.so.1: unused library 'usr/lib/riscv64-linux-gnu/libbrotlienc.so.1.0.9'. (https://snapcraft.io/docs/linters-library)
Created snap package ubuntu-image_3.3_riscv64.snap
compare:
ubuntu@ubuntu:~/ubuntu-image$ snapcraft clean; snapcraft --verbosity=verbose
Cleaned build provider
Starting snapcraft
Logging execution to '/home/ubuntu/.local/state/snapcraft/log/snapcraft-20240308-154549.239864.log'
Starting snapcraft
Logging execution to '/home/ubuntu/.local/state/snapcraft/log/snapcraft-20240308-154549.239864.log'
Running on riscv64 for riscv64
Launching instance...
Creating instance from base instance
Starting instance
Starting snapcraft
Logging execution to '/root/.local/state/snapcraft/log/snapcraft-20240308-155237.920470.log'
Starting snapcraft
Logging execution to '/root/.local/state/snapcraft/log/snapcraft-20240308-155237.920470.log'
Running on riscv64 for riscv64
Initializing parts lifecycle
{snip}
Installing build-packages
Installing build-snaps
Pulling ubuntu-image
Fetching stage-packages
Building ubuntu-image
:: + ins_bin=/root/parts/ubuntu-image/install/bin/
:: + mkdir -p /root/parts/ubuntu-image/install/bin/
:: + CGO_ENABLED=0
{snip}
Additional context
No response