This fixes an issue where calling "craftctl" in a scriptlet would fail with a ModuleNotFoundError for craft_parts. This happened when the snapcraft project included build-packages that pulled in libpython3.10-minimal.
The reason that this failed is because in Rockcraft the python plugin (used to build the snapcraft part) works by adding a custom "sitecustomize.py" in /usr/lib/python3.10/ to add the part's Python libraries to the Python path. This is fine unless the libpython3.10-minimal package is explicitly installed later on a container created from the rock, because that package has its own sitecustomize.py file which overwrites Rockcraft's.
The solution is to make apt and dpkg aware that all of these Python-related packages are already installed in the rock, by adding the dependency explicitly as an overlay-package. This also has the extra beneficial side-effect of improving installation of build-packages because dpkg/apt are aware of the installed packages and don't have to download and re-install them unnecessarily.
This fixes an issue where calling "craftctl" in a scriptlet would fail with a ModuleNotFoundError for craft_parts. This happened when the snapcraft project included build-packages that pulled in libpython3.10-minimal.
The reason that this failed is because in Rockcraft the
python
plugin (used to build thesnapcraft
part) works by adding a custom "sitecustomize.py" in/usr/lib/python3.10/
to add the part's Python libraries to the Python path. This is fine unless thelibpython3.10-minimal
package is explicitly installed later on a container created from the rock, because that package has its own sitecustomize.py file which overwrites Rockcraft's.The solution is to make apt and dpkg aware that all of these Python-related packages are already installed in the rock, by adding the dependency explicitly as an
overlay-package
. This also has the extra beneficial side-effect of improving installation of build-packages because dpkg/apt are aware of the installed packages and don't have to download and re-install them unnecessarily.Fixes #33.