Closed hloeung closed 1 year ago
It's (unfortunately) a known issue that charmtools 3.x can't build focal charms. Please use charmtools 2.x for focal and previous versions. I'll update the README to make this clear. You can specify the charm tools version in the charmcraft as per:
type: charm
parts:
charm:
source: src/
plugin: reactive
build-snaps:
- charm/2.x/stable
build-environment:
- CHARM_INTERFACES_DIR: /root/project/interfaces/
- CHARM_LAYERS_DIR: /root/project/layers/
...
Then, in the appropriate branch for the charm version, you can control which version of charm tools is used to build the reactive charm.
Note, closing this, as it's currently not proposed to make the 3.x series of charm-tools be able to build focal charms; however, patches are welcome if this a feature that is really needed.
It's (unfortunately) a known issue that charmtools 3.x can't build focal charms. Please use charmtools 2.x for focal and previous versions.
This is a bit odd statement to make. It is true that due to the setuptools version shipped with Focal combined with this Jinja2 issue, it does currently not work without pinning Jinja2 and MarkupSafe or slipping in a newer version of setuptools into the virtualenv used to download/build the Jinja2 wheel ref #646.
The main difference between charm-tools 2.x and 3.x is that 2.x uses the Python version shipped in the core18 snap (i.e. Python 3.6) to build the charm, regardless of which version of the operating system it is run on. In other words it is hard coded to always build the charm on Bionic.
charm-tools 3.x uses the Python from the build environment, so to achieve the same behavior you could always use Ubuntu 18.04 as you charm build-base.
Checklist
What version am I running?
I ran the following command:
snap info charm
and got the following ouput:I am using: (Your operating system)
Issue/Feature
I expect/expected the following
Charm builds successfully with the chosen
wheel
python package pinned inwheelhouse.txt
.We'll get a .charm and
unzip -l
will show a different version ofwheel
than the latest.What I got
I get a failure to build. Here's steps to reproduce:
Then downgrading and retrying builds successfully:
Checking the contents:
I need to pin the
wheel
package for https://github.com/canonical/charmcraft/issues/923 & https://github.com/pypa/wheel/issues/487