Installation from source (git) error: snapcraft validation file is missing from installation path

Bug #1656884 reported by Simos Xenitellis 
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Snapcraft
Fix Released
Medium
Kyle Fazzari

Bug Description

When trying to install snapcraft from source, there are a few rough edges and in the end snapcraft will not work because the snapcraft validation file is not placed in the correct location.

Specifically,

1. Create a new LXD container (lxc launch ubuntu:x snaps)
2. Enter the container
    lxc exec snaps -- /bin/bash
3. Install the dependency packages
    apt update
    apt upgrade -y
    apt build-dep snapcraft

4. Get the source of snapcraft,

     git clone https://github.com/snapcore/snapcraft.git

5. Build and install

    cd snapcraft/
    python3 setup.py build
    python3 setup.py install

6. Test the newly install snapcraft

# mkdir mytest
# cd mytest
# snapcraft init
# snapcraft
Issues while validating snapcraft.yaml: snapcraft validation file is missing from installation path

WHAT SHOULD HAVE HAPPENED: snapcraft should have created the null snap.
WHAT HAPPENS: snapcraft cannot find the schema "snapcraft.yaml".

Specifically, snapcraft (installed from source) tries to find the schema snapcraft.yaml in /usr/share/snapcraft/schema/snapcraft.yaml
However, the schema is installed in
/usr/local/lib/python3.5/dist-packages/snapcraft-2.25-py3.5.egg/share/snapcraft/schema/snapcraft.yaml

Revision history for this message
Jan (5-jan-h) wrote :

Workaround that works for me:

sudo ln -s /usr/local/lib/python3.5/dist-packages/snapcraft-2.28-py3.5.egg/share/snapcraft/ /usr/share/snapcraft

Revision history for this message
Kyle Fazzari (kyrofa) wrote :

Sorry for the delay on this, Simos. The proposed fix is here: https://github.com/snapcore/snapcraft/pull/1356 . Would you mind testing it out?

Changed in snapcraft:
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Kyle Fazzari (kyrofa)
Revision history for this message
Simos Xenitellis  (simosx) wrote :

I have tested the new change and it works OK now.

1. I followed the Hacking guide to install snapcraft (instead of my original report's notes).
2. I used a clean 16.04 LXD container for the testing.
3. I applied the patch from the github pull request.

The variables that common.py touches, have been updated to

/home/ubuntu/venv/snapcraft/share/snapcraft/plugins
/home/ubuntu/venv/snapcraft/share/snapcraft/schema
/home/ubuntu/venv/snapcraft/share/snapcraft/libraries
/home/ubuntu/venv/snapcraft/share/snapcraft/tour

And here is the output of the creation of the null snap,

$ snapcraft
Preparing to pull my-part
Pulling my-part
Preparing to build my-part
Building my-part
Staging my-part
Priming my-part
Snapping 'my-snap-name' |
Snapped my-snap-name_0.1_amd64.snap
$ _

Changed in snapcraft:
status: In Progress → Fix Committed
milestone: none → 2.31
Revision history for this message
Kyle Fazzari (kyrofa) wrote :

Thanks so much for testing, Simos!

Kyle Fazzari (kyrofa)
Changed in snapcraft:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.