Closed JGCarroll closed 1 month ago
I actually rolled back to Snapcraft 7 to try validate I wasn't going crazy (I am, but not on this aspect).
It's not just Snapcraft 8 that's broken, 7 and below seem to do the same now too, albeit the errors will be vaguely different.
I'd avoided WSL2 for a few months from around April (some LTS release may have tempted me...), but prior to then it was fully functional both since Microsoft officially supported Systemd in late 2022, and well before that with the systemd PID hacks.
(Weirdly WSL2 is a nice-ish environment to test on because I get decent Wayland support on NVidia ;))
Do you happen to be using Wayland in this VM?
There is a related failure for keyrings when ssh'ing into a machine Ubuntu Desktop machine. gnome-keyring
pops up a gui prompt to unlock the keyring. This doesn't show up at the terminal and the keyring fails to unlock. In this scenario, this will fall back to a file-based keyring storage, so it may be unrelated to your problem.
WSL2 has a built in Wayland and XWayland server for about the last 2 years, so every up to date version should have Wayland automatically.
What they don't have is a full desktop session, so e.g DBus is off the cards, I wouldn't expect the keyring popup to ever work in WSL2 itself, but the environment variable has always historically worked.
I can try unsetting $DISPLAY and $WAYLAND_DISPLAY prior to running Snapcraft to see if that makes a difference; I'm not sure how you "remove" those packages entirely because, in WSL2, the Wayland/XWayland servers are actually in a third VM (Microsofts CBL-Mariner), and so not trivially separated from the Linux environment you're actually using. But ultimately that's just a specific technical implementation that's always been the case (since it was enabled in 2022 anyway).
I've just tried this again today and it's no longer proving to be a problem. With the amount of components involved it's difficult to say what's changed, but on the latest updates (Windows/WSL/Ubuntu/Snap/Snapcraft), everything now works as expected.
Since there's no real point trying to work out what's broken now that it's fixed, I'll mark this as closed.
Bug Description
WSL2 doesn't run with a proper desktop session and must authenticate with the
SNAPCRAFT_STORE_CREDENTIALS
environment variable. This has traditionally worked for years.Having tried recently, this no longer works, Snapcraft will unconditionally complain about lack of system keyring and refuse to consider the environment variable.
To Reproduce
snapcraft export-login $fileName
), export it into the environment variable, and try perform a server-authenticated action.Environment
Windows environment: Fully updated Windows 11 22H2 (latest GA release)
snapcraft.yaml
Relevant log output
Additional context
No response