Closed Vultaire closed 3 years ago
This is a long-standing issue that stems from the old charm store not having the ability to do per-arch charms, meaning dependencies which include compiled code like this need to be handled differently. If possible, it's strongly recommended to move to the Operator framework, the charmcraft
tool, and CharmHub.io which has native support for architecture-aware charm builds.
If for some reason you can't yet migrate your charm, you can use the python_packages
layer config to arrange for the package to be built and installed at install time, however this means that your charm will need to be able to talk to PyPI when deployed. Another option would be to attach the arch-specific library as a binary wheel resource for each supported arch, but there's no framework-provided helpers for doing that (although it's not terribly complicated; just have an install
/ upgrade
hook handler that calls resource-get
and pip install
on the appropriate resource for the arch it's running on).
Thanks John - python_packages is perfect here I think; we already are using it for one Python dependency.
I think we can close this.
Hello,
I've encountered an issue with charm build when building with the Python cryptography library under certain circumstances.
I've created a demo repository which provides exact code which reproduces the issue: https://github.com/Vultaire/charm-cffi-bug-sscce
Basically, it appears that the include paths used when installing a dependency of cryptography, cffi, are not quite adequate to match the header files provided by the charm snap. This results in the build failing since gcc cannot find the appropriate header file.
Please see the above mentioned demo repository for further details. Command executed: "charm build --debug charm-test"
Checklist
What version am I running?
I ran the following command:
snap info charm
and got the following ouput:I am using: Ubuntu Focal
Issue/Feature
I expect/expected the following
I expected the charm to build without errors.
What I got
The charm failed to build since gcc could not find a required header file. The snap does provide this header file, but an appropriate -I parameter to gcc was not provided, thus gcc could not find it.
Quick excerpt:
For full details, please see the demo repository mentioned near the top of this message.