-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
charm pack fails with "metadata: Cannot read the metadata.yaml file." #619
Comments
I also had this problem, what got the build to at least work is adding the parts:
charm:
source: .
plugin: reactive
build-snaps: [charm]
build-packages:
- virtualenv
- git Whilst this did get the build to work, when I deploy the charm there seems to be some problem with setuptools (the following is an excerpt from the
|
I think #639 has solved this issue; please could you check again, and note here if it doesn't seem to be working? Thanks! |
@ajkavanagh I'm seeing the following with that change in place: https://pastebin.ubuntu.com/p/MFP3zn8pB9/ |
@mthaddon can you post a link to the problem charm (layer) - it would be good to see where the issue is. Thanks. |
@ajkavanagh sure, sorry, should have included that initially. It's https://code.launchpad.net/~mthaddon/juju-introspection-proxy-charm/+git/juju-introspection-proxy-charm/+ref/charmcraft. |
@mthaddon okay, so I got it to build by doing the following:
type: "charm"
bases:
- build-on:
- name: "ubuntu"
channel: "20.04"
run-on:
#- name: "ubuntu"
#channel: "16.04"
#- name: "ubuntu"
#channel: "18.04"
- name: "ubuntu"
channel: "20.04"
parts:
charm:
source: .
plugin: reactive
build-snaps:
- charm/2.x/stable
build-environment:
- CHARM_INTERFACES_DIR: /root/project/interfaces/
- CHARM_LAYERS_DIR: /root/project/layers/ Note, that a charm built on 20.04 is very unlike to run on 18.04, let alone 16.04 due to the python version differences. It's probably best to build on/run on each version separately, although we have some charms that build-on 18.04 and run on 20.04 as well. e.g. - build-on:
- name: ubuntu
channel: "18.04"
architectures:
- amd64
run-on:
- name: ubuntu
channel: "18.04"
architectures: [amd64, s390x, ppc64el, arm64]
- name: ubuntu
channel: "20.04"
architectures: [amd64, s390x, ppc64el, arm64] Obviously, you may not need the separate arches, in which case you'd just get amd64. Note I had to switch the charm to the 2.x/stable channel; not sure why it won't build with 3.x at the moment.
includes:
- 'layer:basic'
- 'layer:snap'
options:
basic:
use_venv: True
include_system_packages: False
repo: https://git.launchpad.net/juju-introspection-proxy-charm This just ensures that the charm doesn't pull any packages from the distro, and is mostly self contained. Might need testing if anything in the charm was relying on system packages?
Anyway, hope that helps in getting it moving forward. I still think we have an issue with the 3.x snap though. |
Thx for the pointers! |
Note that there is an issue with the snap when running on bionic, as @esunar discovered, installing the build-packages through charmcraft as discussed here works around the issue. The proper fix for that will most likely be in the charmcraft reactive plugin. Not sure if this is relevant for your specific issue but thought it was worth noting since you are trying to build on bionic. |
Otherwise, if you have a feature request or issue with any other charm command please delete the above and continue below
Checklist
What version am I running?
I ran the following command:
snap info charm
and got the following ouput:I am using: Ubuntu 22.04
Issue/Feature
Build fails as follows:
however, if I add the following to charmcraft.yaml, the build is successful, even though the interfaces and layers directories are empty:
To recreate:
I expect/expected the following
The problem is I'm unable to debug what I think is an interface linting issue because the metadata.yaml error goes away once I add the build-environment environment variables, even though they point to nothing.
The text was updated successfully, but these errors were encountered: