← Back to issue list

5.5.0 changes pack semantics if the project file has different metadata

View original Github issue

Metadata

Project
craft-application
Number
#821
Type
issue
State
open
Author
javierdelapuente
Labels
Status: Triaged Type: Bug
Created
2025-07-24 10:57:18+00:00
Updated
2025-07-28 16:37:34+00:00
Closed

Current evaluation

No evaluation has been recorded for this issue yet.

Issue body

### Bug Description Before `3.5.2.post40+g5e0dd360` changing `charmcraft.yaml` and running `charmcraft pack` would result in a new .charm file. In `3.5.2.post40+g5e0dd360`, changing `charmcraft.yaml` and packing will not change the .charm file. A log message like the following will be issued: ``` ubuntu@paas-tests-iam:~/abc$ charmcraft pack Launching managed ubuntu 22.04 instance... :: Starting instance - (4.4s)chown: invalid user: ‘a+rwx’ Already packed: flask-framework_ubuntu-22.04-amd64.charm ``` and the .charm file will not change to the new changes in charmcraft.yaml. ### To Reproduce Install the latest edge as of today: ``` ubuntu@paas-tests-iam:~/abc$ sudo snap refresh charmcraft --channel=edge charmcraft (edge) 3.5.2.post40+g5e0dd360 from Canonical✓ refreshed ``` Init the charm directory: ``` ubuntu@paas-tests-iam:~/abc$ charmcraft init --profile flask-framework --name flask-framework Charmed operator package file and directory tree initialised. Now edit the following package files to provide fundamental charm metadata and other information: charmcraft.yaml src/charm.py README.md ``` Pack: ``` ubuntu@paas-tests-iam:~/abc$ charmcraft pack WARNING: Cannot get a keyring. Every store interaction that requires authentication will require you to log in again. Launching managed ubuntu 22.04 instance... :: Starting instance - (22.1s)chown: invalid user: ‘a+rwx’ Packed flask-framework_ubuntu-22.04-amd64.charm ``` The .cham is there: ``` ubuntu@paas-tests-iam:~/abc$ ls -lrht total 12M -rw-rw-r-- 1 ubuntu ubuntu 1.4K Jul 24 12:43 charmcraft.yaml -rw-rw-r-- 1 ubuntu ubuntu 31 Jul 24 12:43 requirements.txt -rw-rw-r-- 1 ubuntu ubuntu 766 Jul 24 12:43 pyproject.toml drwxrwxr-x 2 ubuntu ubuntu 4.0K Jul 24 12:43 src -rw-rw-r-- 1 ubuntu ubuntu 1.9K Jul 24 12:43 tox.ini drwxrwxr-x 3 ubuntu ubuntu 4.0K Jul 24 12:44 lib -rw-r--r-- 1 ubuntu ubuntu 12M Jul 24 12:46 flask-framework_ubuntu-22.04-amd64.charm ``` Edit the charmcraft.yaml file (adding for example a config option): ``` ubuntu@paas-tests-iam:~/abc$ echo "config:" >> charmcraft.yaml ubuntu@paas-tests-iam:~/abc$ echo " options:" >> charmcraft.yaml ubuntu@paas-tests-iam:~/abc$ echo " greeting:" >> charmcraft.yaml ubuntu@paas-tests-iam:~/abc$ echo ' default: "Hello, world!"' >> charmcraft.yaml ubuntu@paas-tests-iam:~/abc$ echo ' type: string' >> charmcraft.yaml ubuntu@paas-tests-iam:~/abc$ echo ' description: nothing' >> charmcraft.yaml ``` Pack again: ``` ubuntu@paas-tests-iam:~/abc$ charmcraft pack Launching managed ubuntu 22.04 instance... :: Starting instance - (4.4s)chown: invalid user: ‘a+rwx’ Already packed: flask-framework_ubuntu-22.04-amd64.charm ``` No change in the .charm file: ``` ubuntu@paas-tests-iam:~/abc$ ls -lrhta total 12M -rw-rw-r-- 1 ubuntu ubuntu 75 Jul 24 12:43 .gitignore -rw-rw-r-- 1 ubuntu ubuntu 31 Jul 24 12:43 requirements.txt -rw-rw-r-- 1 ubuntu ubuntu 766 Jul 24 12:43 pyproject.toml drwxrwxr-x 2 ubuntu ubuntu 4.0K Jul 24 12:43 src -rw-rw-r-- 1 ubuntu ubuntu 1.9K Jul 24 12:43 tox.ini drwxrwxr-x 3 ubuntu ubuntu 4.0K Jul 24 12:44 lib drwxrwxr-x 4 ubuntu ubuntu 4.0K Jul 24 12:46 . -rw-r--r-- 1 ubuntu ubuntu 12M Jul 24 12:46 flask-framework_ubuntu-22.04-amd64.charm -rw-rw-r-- 1 ubuntu ubuntu 1.5K Jul 24 12:49 charmcraft.yaml drwxr-x--- 11 ubuntu ubuntu 4.0K Jul 24 12:49 .. ``` Refreshing charmcraft to the latest version and running pack will overwrite the .charm file. ### Environment I have tried in a new 24.04 multipass machine. I think the relevant part is the release of charmcraft `3.5.2.post40+g5e0dd360` ### charmcraft.yaml ```yaml ubuntu@paas-tests-iam:~/abc$ cat charmcraft.yaml # This file configures Charmcraft. # See https://juju.is/docs/sdk/charmcraft-config for guidance. name: flask-framework type: charm bases: - build-on: - name: ubuntu channel: "22.04" run-on: - name: ubuntu channel: "22.04" # (Required) summary: A very short one-line summary of the Flask application. # (Required) description: | A comprehensive overview of your Flask application. extensions: - flask-framework # Uncomment the integrations used by your application # Integrations set to "optional: false" will block the charm # until the applications are integrated. # requires: # mysql: # interface: mysql_client # optional: false # limit: 1 # postgresql: # interface: postgresql_client # optional: false # limit: 1 # mongodb: # interface: mongodb_client # optional: false # limit: 1 # redis: # interface: redis # optional: false # limit: 1 # s3: # interface: s3 # optional: false # limit: 1 # saml: # interface: saml # optional: false # limit: 1 # rabbitmq: # interface: rabbitmq # optional: false # limit: 1 # tracing: # interface: tracing # optional: true # limit: 1 # smtp: # interface: smtp # optional: false # limit: 1 # openfga: # interface: openfga # optional: false # limit: 1 ``` ### Relevant log output ```shell Already packed: flask-framework_ubuntu-22.04-amd64.charm ```

Evaluation history

No evaluation history available.