Closed carlcsaposs-canonical closed 1 year ago
From some testing, it appears that charmcraft gets the target revision from /etc/craft-instance.conf
in the LXC container—even if a different revision of charmcraft is installed
2023-08-03 13:36:56.912 Revisions found: host='1349', target='1349'
2023-08-03 13:36:56.912 Skipping snap injection: target is already up-to-date with revision on host
Thanks for the report.
Craft-providers assumes the snap is not refreshed or being installed by another entity. This assumption contributes to this problem and could be improved.
Craft-providers is already disabling automatic snap refreshes here, but with the old syntax (snap set system refresh.hold=<24 hours>
). I'm not sure why it's failing in your workflow, there haven't been any changes this year. Perhaps it has always been failing and it has not been noticed.
Your workaround uses the new syntax (snap refresh --hold=forever charmcraft
). We've been waiting to use the new syntax since it was put into snapd's beta (https://github.com/canonical/craft-providers/issues/184). It may be time we switch.
Yes it's likely it hasn't been noticed—normally we use the latest version of charmcraft but because of #1179 we've been pinning to 2.3.0 because we cannot build our charm with the latest version
As part of this enhancement, we will be adding a regression test to charmcraft where we create a charm and assert the automatic refreshes are held.
Bug Description
Because of #1179, our team is currently using charmcraft 2.3.0 by installing the snap with
--revision=1349
However, inside the LXC container charmcraft is installed as 2.3.1 and we're running into the same issue as #1179
Expected behavior
charmcraft has the same version in the LXC container as charmcraft on the host machine
To Reproduce
Unable to reproduce so far
Examples: https://github.com/canonical/mysql-operator/actions/runs/5745497262/job/15573643405 https://github.com/canonical/mysql-operator/actions/runs/5751410879/job/15590220679
Environment
Ubuntu 22.04 LTS
charmcraft.yaml
Relevant log output