My biggest problem is the buggy caching of already build parts and steps in snapcraft. It just causes random problems while tinkering with
snapcraft.yaml and rebuilding it for testing.
Example: I changed the version number of PyGObject in the following part and for certain versions the build fails with the error that wheel and setuptools couldn’t be installed.
After trying to debug the problem I realized that running
snapcraft clean cleared the issue. I previously just tried
snapcraft clean pygobject because that normally fixes similar problems.
Example: While testing the PR from @kenvandine I removed the line
build-environment: *buildenv from some modules and apparently that doesn’t cause a rebuild and snapcraft just continues to use the old cached result. (Take this example with a grain of salt because I haven’t looked into it too much and the issue might be something else.)
I ran into many similar problems that I can’t reproduce. Obviously this makes working with snapcraft painful because results of testing are basically random. The only way to be sure seems to be running
snapcraft clean but that takes a long time.
snapcraft builds are not reproducible and additionally random versions of dependencies are pulled from the internet. That just adds to the previous problem.
An annoyance is that paths change between compile time and runtime. This requires patching installed programs or setting environment variables for programs that can’t find resources that were located by the buildsystem when compiling.
I guess (2) and (3) are a side effect of snapcraft’s design and can’t be fixed.
In general there are many rough edges that require workarounds.
It works but I don’t quite understand why. I think I tested similar things. I currently don’t want to waste even more time trying to understand what exactly is going on. Thanks for looking into it.
I don’t think the following does anything:
See the result of the following command:
$ snap run --shell video-downloader -c 'type python3'
python3 is /snap/video-downloader/x3/usr/bin/python3
$ snap run --shell video-downloader -c 'echo "$PATH"'
Edit: I’ve build the Snap without it and it still works.
PYTHONPATH shouldn’t be necessary when actually using Python from the extension, right?
I was under the impression that during build Python from the Gnome extension is preferred anyway. I might be remembering it wrong.
- PATH: /snap/gnome-3-34-1804-sdk/current/usr/bin:$PATH