I am trying to snap https://github.com/nifty-site-manager/nsm-snap and everything seems to be working except for where my program needs to call git to clone or push. When it tries to do that the program outputs fatal: Unable to find remote helper for 'https'. I have added libcurl4-openssl-dev as a stage-package hoping that would fix the problem with git but unfortunately it does not (I tried curl-devel as well but it couldn’t find the package).
Does anyone know how to fix the problem? Thanks for reading/helping.
Also once it is working how do I get it to publish properly to the snap store? Do I just change confinement to classic? (it needs to be able to access the users files)
I don’t exactly remember why I wasn’t able to get it working with the version of git from the archive, but perhaps all you need are just the environment variables.
You should try to use the home and removable-media interfaces with strict confinement before using classic; for most cases these interfaces are sufficient and classic confinement is unnecessary. Should you find that you do need classic confinement for your snap, see the process documented at Process for reviewing classic confinement snaps for how to go about requesting that.
I have tried adding in those environment variables and still have the same problem fatal: Unable to find remote helper for 'https', does anyone else have any suggestions? Does anyone else have a project that has to call git clone/push?
inside your snap, what’s in the git-core directory?
Edit to add: if you look at icdiff’s snapcraft.yaml you’ll see that between the organize and stage sections it arranges to copy git and those bits of git-core that it needs for the operations it does. You’d likely need to do the same. Maybe try copying all of git-core, and then pruning back to keep things tight.
it looks like you’re not packaging git at all, so start by doing that. Again if you look at the icdiff yaml, look at the ppa part (so you get the latest git), and then in the icdiff part look at stage-packages as well as the aforementioned organise and stage sections.
@ijohnson I now have it working in confinement devmode and am trying to get it published to stable.
When I change confinement to strict and install using snap install --edge nsm it installs but cannot create/delete/open files as needed (it still works fine when I do snap install --edge --devmode nsm). How do I use the home and removable-media interfaces with strict confinement? Anyone else reading happen to know the answer?
The home and removable-media interfaces should auto-connect if you are running on a classic distro (i.e. not on Ubuntu Core) and if they are specified in your snapcraft.yaml.
You will need to modify your app to something like the following to declare the interfaces:
I can now create/delete/open files as needed when using snap install --edge nsm, however when I try to use git clone/push I am getting for example fatal: unable to access 'https://gitlab.com/pokebots/parchment-site.git/': Could not resolve host: gitlab.com.
It works fine when I use snap install --edge --devmode nsm. Anyone got any suggestions on what might be causing it? Would perhaps classic confinement be the solution?
Edit: Am heading to bed, will try people’s suggestions in the morning. Otherwise is there a way to get the install pages to tell people to use snap install --edge --devmode nsm?
I get Unprivileged users cannot access messages, unless persistent log storage is enabled. Users in the 'systemd-journal' group may always access messages. Both from --edge and from --edge --devmode.
I have tried using git-all as the stage package rather than git-core and still no love. Anyone got any other suggestions to try? Would it be worth trying classic confinement?