Check existing issues
Bug description
When both the current working directory and the project directory provided by -p contain a charmcraft.yaml, charmcraft gets confused (somehow mixes the two and fails).
Steps to reproduce
- Clone and enter
https://github.com/canonical/istio-beacon-k8s-operator.git
- Run
charmcraft pack -p ./tests/integration/testers/service-mesh-tester
- Observe an error:
ubuntu@microk8s-vm:~/istio-beacon-k8s-operator$ charmcraft pack -p ./tests/integration/testers/service-mesh-tester
Platform 'ubuntu@22.04:amd64' not found in the project definition.
Detailed information: Valid platforms are: 'ubuntu-20.04-amd64'.
Failed to run charmcraft in instance
Full execution log: '/home/ubuntu/.local/state/charmcraft/log/charmcraft-20260526-184109.244315.log'
- Run
charmcraft pack and observe a successful build.
- Remove the charmcraft file from the current dir:
rm charmcraft.yaml
- Run
charmcraft pack -p ./tests/integration/testers/service-mesh-tester and see it succeed.
Environment
Charmcraft version: 4.2.1
OS: Ubuntu 24.04 (inside my development VM)
(It worked before updating from 4.0.1 to 4.2.1)
It also fails CI pipelines with a similar setup.
charmcraft.yaml
Log output
Check existing issues
Bug description
When both the current working directory and the project directory provided by -p contain a charmcraft.yaml, charmcraft gets confused (somehow mixes the two and fails).
Steps to reproduce
https://github.com/canonical/istio-beacon-k8s-operator.gitcharmcraft pack -p ./tests/integration/testers/service-mesh-testercharmcraft packand observe a successful build.rm charmcraft.yamlcharmcraft pack -p ./tests/integration/testers/service-mesh-testerand see it succeed.Environment
Charmcraft version: 4.2.1
OS: Ubuntu 24.04 (inside my development VM)
(It worked before updating from 4.0.1 to 4.2.1)
It also fails CI pipelines with a similar setup.
charmcraft.yaml
Log output