Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Charmcraft snap thinks /cache is the cache directory if snapd doesn't set SNAP_USER_COMMON #2012

Open
lengau opened this issue Dec 3, 2024 · 0 comments
Labels
Bug Something isn't working

Comments

@lengau
Copy link
Collaborator

lengau commented Dec 3, 2024

Bug Description

If snapd fails to set $SNAP_USER_COMMON](https://bugs.launchpad.net/snapd/+bug/2090938) in the environment, charmcraft gets /cache as its [$XDG_CACHE_HOME`, which is generally not writable.

Related:

To Reproduce

With snapd 2.66.1:

echo '$SNAP/bin/python -c "from charmcraft import env; print(env.get_host_shared_cache_path())"' | PATH=/snap/bin /usr/bin/snap run --shell charmcraft

Environment

$ snap version
snap    2.66.1+25.04
snapd   2.66.1+25.04
series  16
ubuntu  25.04
kernel  6.11.0-9-generic

charmcraft.yaml

n/a

Relevant log output

See: https://github.com/canonical/k8s-operator/actions/runs/12143320826/job/33859924966
@lengau lengau added the Bug Something isn't working label Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant