Clone Repository Error for https

Hello all.
I tried to build an application for cloning the repository.
But for some reason I get an error when I apply.
For example, I tried to clone UE4

Cloning into 'UnrealEngine'...
warning: templates not found /usr/share/git-core/templates
fatal: Unable to find remote helper for 'https'

Snap package was build to Ubuntu 16.04.3 and on the same system was tested.
If does not clone from snap but from a regular console, all it works. And it does not work only from under snap.

name: uelauncher
version: "1.0"
summary: launcher
description: |
    Application for installing UE4
confinement: strict
architectures: [amd64]

apps:
    UE4launcherqml:
        command: bin/run.sh $SNAP/bin/UE4launcherqml
        plugs: [home, x11, opengl, network]
        environment:
            LD_LIBRARY_PATH: $SNAP/Qt/5.9.3/gcc_64/lib:$LD_LIBRARY_PATH
parts:
    files:
        plugin: dump
        source: scripts
        after: [integration]

    integration:
        plugin: nil
        stage-packages:
            - libc-bin
            - libclutter-1.0-0
            - libxkbcommon0
            - ttf-ubuntu-font-family
            - dmz-cursor-theme
            - libglib2.0-0
            - light-themes
            - shared-mime-info
            - libqt5gui5
            - libgdk-pixbuf2.0-0
            - libqt5svg5
            - libqt5quick5
            - appmenu-qt5
            - libqt5qml5
            - libqt5quickwidgets5
            - libgl1-mesa-dev
            - qml-module-qtquick-controls
            - qml-module-qtqml-models2
            - qmlscene
            - qml-module-qt-labs-folderlistmodel
            - qml-module-qtquick-xmllistmodel
            - build-essential
            - mono-xbuild
            - mono-dmcs
            - git
            - libmono-system-data-datasetextensions4.0-cil
            - libmono-system-web-extensions4.0-cil
            - libmono-system-management4.0-cil
            - libmono-system-xml-linq4.0-cil
            - cmake
            - dos2unix
            - clang
            - xdg-user-dirs
            - libxinerama-dev
            - libxrandr-dev
            - x11proto-xinerama-dev
            - libfreetype6-dev
            - libgtk-3-dev
            - libmono-microsoft-build-tasks-v4.0-4.0-cil
        after: [desktop-qt5]

I would be grateful for the tip where there could be a problem.
Thanks in advance.

I’m afraid I don’t quite understand what you’re saying, here, nor do I see a connection between your snapcraft.yaml and the error you posted. There doesn’t seem to be any remote source in the YAML. Are you trying to clone something and it’s failing?

@kyrofa Ths for answere.
Yes, I’m trying to clone a repository that is available to registered users.
In a normal system, this works, it does not work from snap.

So can I safely ignore the snapcraft.yaml you’ve pasted here, or am I missing something?

How does the repository register users? They may not support access from an automated build system, or perhaps you have to put your credentials in the URL (yuck). They don’t offer SSH access?

To clone the UnrealEngine4 you just need to register in https://github.com/EpicGames.
https://wiki.unrealengine.com/Building_On_Linux

Oh it’s private github. You should be able to use SSH, then, along with your keys. I’m still assuming this needs to be a source in the YAML. Or you can generate a token and use a URL like https://<token>@github.com/owner/repo.git.

For cloning I use this command
QString command = QString("git clone https://%1:%2@github.com/EpicGames/UnrealEngine.git").arg(getUserName(), getUserPass());

Ohh, I think I’m finally starting to figure out what you’re saying, here! You’re not trying to create a snap of UE, but a snap of an application that installs it. Which needs to be able to clone it. You probably want to set the GIT_TEMPLATE_DIR environment variable. Check out the demo in snapcraft that actually creates a snap of git for more info.

Hi @kyrofa
My application is not only for cloning, but also for compiling what will be cloned later and running the compiled program. This is my application, together with snapcraft.yaml
https://www.dropbox.com/s/y9w9w3vltppzpmn/UE4_launcher_qml.tar.bz2?dl=0

wow, thats a pretty advanced task … i’d take a look at using the “lxd-support” interface and an lxd container through the lxd snap for your compile process, doing it in the snap itself will have you navigate around a lot of roadblocks otherwise …

If anyone else stumbles on this and is wondering how to run git properly inside a snap, and notices that the snapcraft demo link @kyrofa posted above doesn’t work, I dug up the old version of the demo and with a little bit of magic got a version of git that works with HTTPS, submodules, etc. inside a strict snap: https://github.com/anonymouse64/git-snap

Of course it’s not really useful as an actual snap because it can’t read .gitconfig or .ssh, but if you don’t care about that and just need to be able to clone things inside a snap it works fine.

2 Likes