snapcraft builds remove snapcraft.yaml, altering 'git describe' output

Bug #1662388 reported by John Hood
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Snapcraft
In Progress
Medium
Kyle Fazzari

Bug Description

https://github.com/mobile-shell/mosh/pull/854 is a Snapcraft build for Mosh. This mostly works well, but there is one issue with build sources that causes a problem. Currently this snap uses a Git checkout from GitHub. The mosh build uses 'git describe --dirty' to obtain a version string when built from a Git repo. When snapcraft does its build, it removes snapcraft.yaml, a source artifact delivered by Git. This causes the version string to be 'mosh-1.3.0-rc2-12-g6686eeb-dirty' instead of 'mosh-1.3.0-rc2-12-g6686eeb' and the built Mosh programs report that.

When working with source obtained from a DVCS, Snapcraft should probably not be altering source artifacts placed by the DVCS, because the build may be expecting them to be as delivered by the DVCS.

Bug report requested by elopio@github.

Revision history for this message
Leo Arias (elopio) wrote :

Hello John,

We will discuss if removing the snapraft.yaml is needed at all. A workaround for some projects is to set source-type: git, that will copy it to the part source that's used during the build.

In the case of mosh that's not enough because make is called from the build dir, and even with the source-type the yaml is filtered out. We'll figure it out.

thanks a lot for the report!

tags: added: isv sources
Changed in snapcraft:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Kyle Fazzari (kyrofa) wrote :

The proposed fix for this is here: https://github.com/snapcore/snapcraft/pull/2289

Changed in snapcraft:
status: Confirmed → In Progress
assignee: nobody → Kyle Fazzari (kyrofa)
tags: added: 18.10-build-caching
Revision history for this message
Sergio Schvezov (sergiusens) wrote :

Workaround for our own tree is here https://github.com/snapcore/snapcraft/pull/2294
It should ideally be reverted when this is fixed.

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.