Kernel plugin: Avoid redownloading os.snap on a local Git repo

Bug #1655008 reported by Dalton Durst
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
Confirmed
Undecided
Sergio Schvezov

Bug Description

Currently, if I make a change to my kernel source (I'm using a source in '.' in my case) then commit it, Snapcraft simply ignores the changes since it has pulled the source previously, printing 'Skipping pull kernel (already ran)'. I have to run 'snapcraft clean' in order to get it to pull the (local) source again. Snapcraft then goes on and redownloads 'os.snap', a 60MB file. On a fast connection, this is no problem. I'm on a slightly slower connection that also has a data cap, so this is a waste of both time and bits.

It seems like there are two ways to avoid this: Cache os.snap locally, or have Snapcraft run 'git pull' to grab source changes into its working directory. The second option seems better as it will behave similar to a non-snap build, where editing the source code has an immediate change.

Tags: dirty
Leo Arias (elopio)
tags: added: dirty
Leo Arias (elopio)
Changed in snapcraft:
status: New → Confirmed
description: updated
Revision history for this message
Kyle Fazzari (kyrofa) wrote :

@Dalton, I don't quite understand what your source is in this case. It initially says that it's in '.' but then suggests using `git pull` as a solution. Any chance your project is public so we can take a look? Even if you could just paste a snippet of your YAML for the kernel part that would be useful.

Revision history for this message
Dalton Durst (universalsuperbox) wrote :

Hello Kyle,

This is the source of the kernel I'm using: https://github.com/ubports/android_kernel_fairphone_fp2/tree/snappy-experimental . More specifically, here's the snapcraft.yaml: https://github.com/ubports/android_kernel_fairphone_fp2/blob/snappy-experimental/snapcraft.yaml

This repository is cloned locally.

The kernel's source directory is . and its type is Git. When I run `snapcraft --target-arch=armhf` in the source directory, Snapcraft uses the local repo as a mirror and clones it into `./parts/kernel/src`.

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

Excellent, thank you. All is clear now.

Changed in snapcraft:
assignee: nobody → Sergio Schvezov (sergiusens)
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.