Open ca-scribner opened 1 year ago
Hello @ca-scribner , thanks for the report!
I reproduced the problem, and opened a new issue in the Craft Parts library which is the one that should be improved for this behaviour.
As a workaround, after modifying the permission of the file, run touch
on it, which will change its mtime
, and the file will be re-picked just fine.
Posting the full error message since googling for the exact error message did not find this issue:
Lint Errors:
- entrypoint: The entrypoint file is not executable: '/root/prime/src/charm.py' (https://juju.is/docs/sdk/charmcraft-analyzers-and-linters#heading--entrypoint)
Aborting due to lint errors (use --force to override).
Similar issue: moving charmcraft's LXC container between machines causes some files to not be detected as "updated"
Workaround that we used: https://github.com/canonical/data-platform-workflows/blob/f2556f7c75d47d51322404b15ba4818185f2f2dd/.github/workflows/build_charms_with_cache.yaml#L121-L127
(force charmcraft
to update all files)
Also might be related to https://github.com/canonical/charmcraft/issues/736
Thank you for reporting us your feedback!
The internal ticket has been created: https://warthogs.atlassian.net/browse/CRAFT-3250.
This message was autogenerated
What happened
charmcraft pack
will error out if you try to pack a charm with asrc/charm.py
that does not have execution permission on the file. If you fix the permissions and thenpack
again, it will respond with the same message. You need toclean
the charmcraft env before packing for this to work as expected.What did you expect
If I change the permissions on a file locally, I expect
charmcraft pack
to either reproduce those changes in my container or error specifically telling me it cannot do that. Instead, the current implementation quietly ignores some differences between my local files and container, leading users to continue debugging things they've already fixed just because it is not transparent whether the fix made it into the container.Reproduction
Additional comments
A mitigation is to use
charmcraft clean
liberally whenever you're not sure if something will propagate to the container, but that is a poor user experience. Cold-start for charmcraft is slow (minutes vs 10's of seconds) and very disruptive to an iterative workflow