← Back to issue list

Packages in `requirements.txt` not updated without `charmcraft clean`

View original Github issue

Metadata

Project
charmcraft
Number
#1058
Type
issue
State
open
Author
carlcsaposs-canonical
Labels
Created
2023-03-29 19:29:32+00:00
Updated
2023-03-30 15:45:03+00:00
Closed

Current evaluation

No evaluation has been recorded for this issue yet.

Issue body

Version: `2.2.0` ## Steps to reproduce 1. `git clone https://github.com/carlcsaposs-canonical/charm-bug-report.git` 2. `cd charm-bug-report/` 3. `charmcraft pack` 4. `git checkout origin/update` 5. `charmcraft pack` 6. Unzip *.charm & `cat venv/package/foo.py` or deploy charm and look at `juju debug-log --replay` ## Expected behavior Message should be `Hello!` (same as `cat package/package/foo.py`) ## Actual behavior Message is `Hello, world!` (package was not updated with changes in `origin/update` branch) ## Workaround I'm able to get charmcraft to correctly update the package without a `charmcraft clean` by deleting `/root/parts/charm/build/charmcraft-dependencies-hash.txt` in the LXC container It appears that there's an issue here: https://github.com/canonical/charmcraft/blob/8a3a0e6f1380b993c4c53b6e318485cb853234a8/charmcraft/charm_builder.py#L294-L311 The dependencies hash file remains the same if there are updates to the `./package/` Python package since `requirements.txt` remains unchanged. ## Notes I also believe (but haven't tested to confirm) that this means that if you have a requirements.txt that looks like this ``` ops>=1.5.0 tenacity ``` that any new versions of `ops` or `tenacity` would not be updated without a `charmcraft clean`.

Evaluation history

No evaluation history available.