Closed chanchiwai-ray closed 2 years ago
So this is a curious one. layer-basic's wheelhouse.txt
has the following lines:
Jinja2==2.10;python_version >= '3.0' and python_version <= '3.4' # py3 trusty
Jinja2==2.11;python_version == '2.7' or python_version == '3.5' # py27, py35
Jinja2;python_version >= '3.6' # py36 and on
PyYAML==5.2;python_version >= '3.0' and python_version <= '3.4' # py3 trusty
PyYAML<5.4;python_version == '2.7' or python_version >= '3.5' # all else
MarkupSafe<2.0.0;python_version < '3.6'
MarkupSafe<2.1.0;python_version == '3.6' # Just for python 3.6
MarkupSafe;python_version >= '3.7' # newer pythons
setuptools<42;python_version < '3.8'
# https://github.com/juju-solutions/layer-basic/issues/201
setuptools<62.2.0;python_version >= '3.8'
setuptools-scm<=1.17.0;python_version < '3.8'
# https://github.com/pypa/setuptools_scm/issues/722
setuptools-scm<7;python_version >= '3.8'
So the right pins are in there for building on py38 (20.04) and later (22.04 - py310). I wonder if it's the order of the MarkupSafe and Jinja2 declarations in the wheelhouse.txt
?
@chanchiwai-ray do you have a link to the example layer that you are building that has this problem, please?
I was building reactive charm for example: charm-duplicity and testing build-on 20.04 and run-on 20.04, and I encounter this problem. Some other charms like charm-prometheus2 also has this problem.
The charmcraft.yaml I used for charm-duplicity was
type: charm
parts:
charm:
source: src
plugin: reactive
build-snaps: [charm]
bases:
- build-on:
- name: ubuntu
channel: "20.04"
architectures: ["amd64"]
run-on:
- name: ubuntu
channel: "20.04"
architectures:
- amd64
Okay, so this isn't a bug in layer-basic, but is instead a bug in charm-tools: https://github.com/juju/charm-tools/issues/646
So keep you developing for the moment, if you change build-snaps
to:
...
parts:
...
build-snaps:
- charm/2.x/stable
then the charm will build successfully. I've tested this with the duplicity charm that was linked with the 2.x/stable branch.
Unfortunately, the 3.x branch currently not compatible with building on < 22.04 (hence the bug).
I'm going to close this, but put a link to it from the charm-tools bug.
It seems that these dependencies are comming from layer-basic. I am using charmcraft == 2.0.0.
Adding these to the charm's wheelhouse will make it build and install on 20.04, but not sure if it's the best choice.