snapcraft should be able to autofill the version field based on some property of the build and/or stage files.

Bug #1611439 reported by Alistair Buxton
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
Fix Released
Medium
Sergio Schvezov

Bug Description

Given the following (incomplete) snap:

name: gmediarender
version: ????????

...

parts:
  gmediarender:
    plugin: nil
    stage-packages:
      - gmediarender

...

Here gmediarender is pulled from the Ubuntu archive and staged. I want the snap version to match the deb package version which was staged. There is no way I can know what that is before I run snapcraft and it fetches the package.

A similar problem occurs when I reference a git source URL.

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

Thanks for your report!

I'm not sure about this idea, because it would be an exception for when you have only one part with only one package. Doesn't sound general enough to make it a usable feature, IMO.

Also, in this case you are just turning a deb into a snap. With classic mode that's not required because you could just install the deb.

Revision history for this message
Alistair Buxton (a-j-buxton) wrote :

I am building a snap from a deb because I expect to use it on an all-snap system.

also the deb does not actually work, see https://bugs.launchpad.net/ubuntu/+source/gmrender-resurrect/+bug/1547763 and https://bugs.launchpad.net/snappy/+bug/1611819

As I said, this problem also applies when building from a git repository. Number of parts does not matter. The only thing that matters is the version on the executable that is actually exposed. Most snaps only expose one executable.

Revision history for this message
Alistair Buxton (a-j-buxton) wrote :

See https://github.com/ali1234/mysnaps/blob/master/sigrok/snapcraft.yaml for an example of a snap with multiple parts and two different exposed executables with different version numbers.

I don't even know what I should use for the version on a snap like this. But I would probably go with something like 0.4.0-0.6.0-0.3.0 which are the versions of libsigrok, sigrok-cli, and pulseview respectively. sigrok-cli and pulseview are exposed to the user, but the version of libsigrok determines the available hardware support.

Revision history for this message
Sergio Schvezov (sergiusens) wrote :

I am sorry but I don't think we can fulfill this request. The other way around we can

source: https://example.com/$SNAPCRAFT_NAME-$SNAPCRAFT-VERSION.tar.gz

There's a bug already for that case though.

When creating a snap with multiple things in it you are essentially creating a new product with your new snap name.

Changed in snapcraft:
status: New → Won't Fix
Revision history for this message
Oliver Grawert (ogra) wrote :

re-opening after IRC discussion

Changed in snapcraft:
status: Won't Fix → Triaged
importance: Undecided → Medium
assignee: nobody → Sergio Schvezov (sergiusens)
Revision history for this message
Sergio Schvezov (sergiusens) wrote :

This has been fixed in 2.32 iirc

Changed in snapcraft:
status: Triaged → 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.