Re: Getting snapcraft.yaml version from a script
On Mar 31, 2017 4:57 PM, "Gregory Lutostanski" < gregory.lutostan...@canonical.com> wrote: Curious how everyone makes sure the version string in the snapcraft.yaml up to date. And if there is an easy way to essentially drive it via 'git tags' and 'git describe'. If anyone has an recipe I would be very happy to use it across my repos. I've tried the following prepare script: sed -i 's/^version: .*/version: '`git describe --tags`'/' snapcraft.yaml But that won't work because snapcraft has read it before checking out the part to build. And I don't like having a separate build script if not necessary (especially since the launchpad builders wont use it). I have been playing around with npm recently, and the way their versions work are good -- but they are only dealing with public releases with a set semver (usually), but at least they have a script to update it with 'npm/yarn version'. What I would really like is to not directly specify the version but let snapcraft get it for me by executing a script. If there is nothing already existent out there... here is a proposal for allowing it and letting it be backward compatible: By default get it from the top-level 'version' value in snapcraft.yaml If that is not present one (and only one) of the parts must have a 'source-version'[1] key,value pair, where the value is a script to be executed -- just like the prepare step. [1] could also be named source-version-script This would get us the following: allow to specify string version using the old keyword. Make a new-keyword that allows us to set the version based on a script. The two different examples would look like... ``` name: some-package version: 1.2.0 ``` XOR ``` name: some-package parts: some-package: source: . source-version: git describe --tags ``` A further extension could be to have the source plugins (such as git/bzr/hg) have default source-version commands and if there is a part with the same name as the snap, use that by default, but that is just sugar and implicit data (which could be argued for either way). Thoughts, or other ways people are doing this now would be greatly appreciated. By the way, not sure if this is already thought out or if this is even the right place for a post like this. To avoid duplication I will redirect you to https://forum.snapcraft.io/t/snapcraft-version-scriptlets/106 -- Snapcraft mailing list Snapcraft@lists.snapcraft.io Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/snapcraft
Getting snapcraft.yaml version from a script
Curious how everyone makes sure the version string in the snapcraft.yaml up to date. And if there is an easy way to essentially drive it via 'git tags' and 'git describe'. If anyone has an recipe I would be very happy to use it across my repos. I've tried the following prepare script: sed -i 's/^version: .*/version: '`git describe --tags`'/' snapcraft.yaml But that won't work because snapcraft has read it before checking out the part to build. And I don't like having a separate build script if not necessary (especially since the launchpad builders wont use it). I have been playing around with npm recently, and the way their versions work are good -- but they are only dealing with public releases with a set semver (usually), but at least they have a script to update it with 'npm/yarn version'. What I would really like is to not directly specify the version but let snapcraft get it for me by executing a script. If there is nothing already existent out there... here is a proposal for allowing it and letting it be backward compatible: By default get it from the top-level 'version' value in snapcraft.yaml If that is not present one (and only one) of the parts must have a 'source-version'[1] key,value pair, where the value is a script to be executed -- just like the prepare step. [1] could also be named source-version-script This would get us the following: allow to specify string version using the old keyword. Make a new-keyword that allows us to set the version based on a script. The two different examples would look like... ``` name: some-package version: 1.2.0 ``` XOR ``` name: some-package parts: some-package: source: . source-version: git describe --tags ``` A further extension could be to have the source plugins (such as git/bzr/hg) have default source-version commands and if there is a part with the same name as the snap, use that by default, but that is just sugar and implicit data (which could be argued for either way). Thoughts, or other ways people are doing this now would be greatly appreciated. By the way, not sure if this is already thought out or if this is even the right place for a post like this. Thanks, Greg -- Snapcraft mailing list Snapcraft@lists.snapcraft.io Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/snapcraft
Re: Updating cloud part
+1, thanks, Alan! On 31.03.2017 18:51, Alan Pope wrote: On 31 March 2017 at 17:41, Tim Süberkrübwrote: ah, thanks for that info. So I guess '/' in part names has been deprecated? Yes. Some docs for cloud parts in general would be nice ;) Agreed. https://github.com/CanonicalLtd/snappy-docs/issues/54 :) -- Snapcraft mailing list Snapcraft@lists.snapcraft.io Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/snapcraft
Re: Updating cloud part
On 31 March 2017 at 17:41, Tim Süberkrübwrote: > ah, thanks for that info. So I guess '/' in part names has been deprecated? > Yes. > Some docs for cloud parts in general would be nice ;) > Agreed. https://github.com/CanonicalLtd/snappy-docs/issues/54 :) -- Alan Pope Snap Advocate Canonical - Ubuntu Engineering and Services +44 (0) 7973 620 164 alan.p...@canonical.com http://ubuntu.com/ -- Snapcraft mailing list Snapcraft@lists.snapcraft.io Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/snapcraft
Re: Updating cloud part
Hi Tim, Don't use '/' in part names. Rename 'liri-platform/v0.10.0' to 'liri-platform-v0.10.0' and update the snapcraft.yaml at https://github.com/lirios/snapcraft-parts.git to use that as the part name not the nested naming you have there now. That should get things updated for you. Thanks, Joe On Fri, Mar 31, 2017 at 12:26 PM, Tim Süberkrübwrote: > Hey Joe, > > thanks for your reply. > > Yeah, I know but I updated it here: https://wiki.ubuntu.com/snapcraft/parts > (see entry at the very bottom). > > I already checked snapcraft update/search and the API url. > > All the best, > > Tim > > > > On 31.03.2017 18:24, Joe Talbott wrote: >> >> I see 'liri-app' here https://parts.snapcraft.io/v1/parts.yaml >> >> Make sure you run 'snapcraft update' to download the latest parts.yaml >> file. >> >> Joe >> >> On Fri, Mar 31, 2017 at 12:22 PM, Tim Süberkrüb >> wrote: >>> >>> Hey, >>> >>> I made some changes to the Liri cloud part few hours earlier, but >>> parts.snapcraft.io still hasn't updated. >>> >>> Is there a problem with my changes or am I just too impatient? ;) >>> >>> >>> All the best, >>> >>> Tim >>> >>> -- >>> Snapcraft mailing list >>> Snapcraft@lists.snapcraft.io >>> Modify settings or unsubscribe at: >>> https://lists.ubuntu.com/mailman/listinfo/snapcraft > > > > -- > Snapcraft mailing list > Snapcraft@lists.snapcraft.io > Modify settings or unsubscribe at: > https://lists.ubuntu.com/mailman/listinfo/snapcraft -- Snapcraft mailing list Snapcraft@lists.snapcraft.io Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/snapcraft
Re: Updating cloud part
Hey Joe, thanks for your reply. Yeah, I know but I updated it here: https://wiki.ubuntu.com/snapcraft/parts (see entry at the very bottom). I already checked snapcraft update/search and the API url. All the best, Tim On 31.03.2017 18:24, Joe Talbott wrote: I see 'liri-app' here https://parts.snapcraft.io/v1/parts.yaml Make sure you run 'snapcraft update' to download the latest parts.yaml file. Joe On Fri, Mar 31, 2017 at 12:22 PM, Tim Süberkrübwrote: Hey, I made some changes to the Liri cloud part few hours earlier, but parts.snapcraft.io still hasn't updated. Is there a problem with my changes or am I just too impatient? ;) All the best, Tim -- Snapcraft mailing list Snapcraft@lists.snapcraft.io Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/snapcraft -- Snapcraft mailing list Snapcraft@lists.snapcraft.io Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/snapcraft
Re: Updating cloud part
I see 'liri-app' here https://parts.snapcraft.io/v1/parts.yaml Make sure you run 'snapcraft update' to download the latest parts.yaml file. Joe On Fri, Mar 31, 2017 at 12:22 PM, Tim Süberkrübwrote: > Hey, > > I made some changes to the Liri cloud part few hours earlier, but > parts.snapcraft.io still hasn't updated. > > Is there a problem with my changes or am I just too impatient? ;) > > > All the best, > > Tim > > -- > Snapcraft mailing list > Snapcraft@lists.snapcraft.io > Modify settings or unsubscribe at: > https://lists.ubuntu.com/mailman/listinfo/snapcraft -- Snapcraft mailing list Snapcraft@lists.snapcraft.io Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/snapcraft
Re: Issues using dbus in strict
Hi folks, any tips here to unblock this critical issue? Thanks On 03/31/2017 10:55 AM, Sergey Borovkov wrote: Hi. I am running a couple of daemons (daemon: simple) and they interact between each other using dbus. Unfortunately I've ran into the issue when porting them from devmode to strict, I am getting this backtrace just trying to obtain SystemBus in python: Mar 31 12:44:02 localhost.localdomain snap[1466]: GLib.Error: g-io-error-quark: Could not connect: Permission denied (14) Mar 31 12:44:02 localhost.localdomain snap[1466]: return Gio.bus_get_sync(type, None).pydbus Mar 31 12:44:02 localhost.localdomain snap[1466]: File "/snap/screenly- client/165/lib/python3.5/site-packages/pydbus/bus.py", line 19, in bus_get Mar 31 12:44:02 localhost.localdomain snap[1466]: return bus_get(Bus.Type. SYSTEM) Mar 31 12:44:02 localhost.localdomain snap[1466]: File "/snap/screenly- client/165/lib/python3.5/site-packages/pydbus/bus.py", line 57, in SystemBus Mar 31 12:44:02 localhost.localdomain snap[1466]: self.bus = SystemBus() Mar 31 12:44:02 localhost.localdomain kernel: audit: type=1400 audit(1490964242.523:72): apparmor="DENIED" operation="connect" profile= "snap.screenly-client.websocket" name="/run/dbus/system_bus_socket" pid=1466 comm="python3" req Mar 31 12:44:02 localhost.localdomain audit[1466]: AVC apparmor="DENIED" operation="connect" profile="snap.screenly-client.websocket" name="/ run/dbus/system_bus_socket" pid=1466 comm="python3" requested_mask="wr" denied_mask="wr" I am not sure if I need to use some additional interfaces - to get it working under devmode I've used the following code (And I can't find anything relevant in wiki): playlist: command: usr/bin/playlist-service.sh daemon: simple plugs: [network-bind, network] slots: [playlist-dbus-server] websocket: command: usr/bin/websocket-service.sh daemon: simple plugs: [network-bind, network, playlist-dbus-client] slots: playlist-dbus-server: interface: dbus name: com.screenly.playlist bus: system plugs: playlist-dbus-client: interface: dbus name: com.screenly.playlist bus: system -- Snapcraft mailing list Snapcraft@lists.snapcraft.io Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/snapcraft
Re: Issues creating webapps snaps with stric confinement
Hi Vincent, What plugs did you use? This is a quick snap I assembled recently which I tested successfully on top of X11: https://github.com/lool/soracom-console-snap/blob/master/snapcraft.yaml Cheers, - Loïc On Fri, Mar 31, 2017 at 3:28 PM, Vincent JOBARDwrote: > Hi Everyone > > I just try to follow the tutorial to learn how to create webapps snaps > using snapcraft. ( > https://developer.ubuntu.com/en/phone/web/ubuntu-webapps-guide/, very nice > tutorial by the way) > > Unfortunately, when I try to create my snap with strict confinement, I have > a network Error page, but all works fine in devmode. > > I'm at work behind a proxy with cntlm authentification. could it be related > ? > > Thx for your answers guys > > Cheers > Winael > -- > Snapcraft mailing list > Snapcraft@lists.snapcraft.io > Modify settings or unsubscribe at: https://lists.ubuntu.com/ > mailman/listinfo/snapcraft > -- - Loïc -- Snapcraft mailing list Snapcraft@lists.snapcraft.io Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/snapcraft
Re: ANN: snapcraft 2.28 has been released
On 03/31/2017 03:37 AM, Colin Watson wrote: > On Fri, Mar 31, 2017 at 11:22:50AM +0100, Mark Shuttleworth wrote: >> On 30/03/17 20:54, Sergio Schvezov wrote: >>> ### sources >>> >>> Sources, thanks to an external contributor, can now make use of a new >>> entry, `source-checksum` which can be added to sources that can be hashed, >>> the format is the following: `source-checksum: /`. These >>> are the supported algorithms: >>> >>> - `md5` >>> - `sha1` >>> - `sha224` >>> - `sha256` >> >> Please cull those from the acceptable digests, they are the Fake News of >> cryptographic reassurance ;) > > Seriously? MD5 and SHA-1 of course yes, but there's no particular > evidence that SHA256 is problematic, and as yet it's far more popular as > an advertised tarball hash than anything based on SHA-3 or BLAKE2. (I > don't know about SHA224, but it's at least also in the SHA-2 family.) Indeed, looking at what upstream provides for a few projects I use in my snaps: - Nextcloud: MD5 and SHA256 (https://nextcloud.com/install/#instructions-server) - Apache: PGP sig or MD5 (https://www.apache.org/dyn/closer.cgi#verify) - PHP: MD5 or SHA256 (https://secure.php.net/downloads.php) - Redis: SHA1 and SHA256 (https://github.com/antirez/redis-hashes/blob/master/README) - Ubuntu itself: SHA256 (it seems that it also supports MD5 and SHA1 (https://www.ubuntu.com/download/how-to-verify) I think supporting commonly-used ones here is important, or this becomes difficult to use. -- Kyle Fazzari (kyrofa) Software Engineer Canonical Ltd. k...@canonical.com signature.asc Description: OpenPGP digital signature -- Snapcraft mailing list Snapcraft@lists.snapcraft.io Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/snapcraft
Issues using dbus in strict
Hi. I am running a couple of daemons (daemon: simple) and they interact between each other using dbus. Unfortunately I've ran into the issue when porting them from devmode to strict, I am getting this backtrace just trying to obtain SystemBus in python: Mar 31 12:44:02 localhost.localdomain snap[1466]: GLib.Error: g-io-error-quark: Could not connect: Permission denied (14) Mar 31 12:44:02 localhost.localdomain snap[1466]: return Gio.bus_get_sync(type, None).pydbus Mar 31 12:44:02 localhost.localdomain snap[1466]: File "/snap/screenly- client/165/lib/python3.5/site-packages/pydbus/bus.py", line 19, in bus_get Mar 31 12:44:02 localhost.localdomain snap[1466]: return bus_get(Bus.Type. SYSTEM) Mar 31 12:44:02 localhost.localdomain snap[1466]: File "/snap/screenly- client/165/lib/python3.5/site-packages/pydbus/bus.py", line 57, in SystemBus Mar 31 12:44:02 localhost.localdomain snap[1466]: self.bus = SystemBus() Mar 31 12:44:02 localhost.localdomain kernel: audit: type=1400 audit(1490964242.523:72): apparmor="DENIED" operation="connect" profile= "snap.screenly-client.websocket" name="/run/dbus/system_bus_socket" pid=1466 comm="python3" req Mar 31 12:44:02 localhost.localdomain audit[1466]: AVC apparmor="DENIED" operation="connect" profile="snap.screenly-client.websocket" name="/ run/dbus/system_bus_socket" pid=1466 comm="python3" requested_mask="wr" denied_mask="wr" I am not sure if I need to use some additional interfaces - to get it working under devmode I've used the following code (And I can't find anything relevant in wiki): playlist: command: usr/bin/playlist-service.sh daemon: simple plugs: [network-bind, network] slots: [playlist-dbus-server] websocket: command: usr/bin/websocket-service.sh daemon: simple plugs: [network-bind, network, playlist-dbus-client] slots: playlist-dbus-server: interface: dbus name: com.screenly.playlist bus: system plugs: playlist-dbus-client: interface: dbus name: com.screenly.playlist bus: system -- Snapcraft mailing list Snapcraft@lists.snapcraft.io Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/snapcraft
Issues creating webapps snaps with stric confinement
Hi Everyone I just try to follow the tutorial to learn how to create webapps snaps using snapcraft. ( https://developer.ubuntu.com/en/phone/web/ubuntu-webapps-guide/, very nice tutorial by the way) Unfortunately, when I try to create my snap with strict confinement, I have a network Error page, but all works fine in devmode. I'm at work behind a proxy with cntlm authentification. could it be related ? Thx for your answers guys Cheers Winael -- Snapcraft mailing list Snapcraft@lists.snapcraft.io Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/snapcraft
Re: ANN: snapcraft 2.28 has been released
On Fri, Mar 31, 2017 at 11:22:50AM +0100, Mark Shuttleworth wrote: > On 30/03/17 20:54, Sergio Schvezov wrote: > > ### sources > > > > Sources, thanks to an external contributor, can now make use of a new > > entry, `source-checksum` which can be added to sources that can be hashed, > > the format is the following: `source-checksum: /`. These > > are the supported algorithms: > > > > - `md5` > > - `sha1` > > - `sha224` > > - `sha256` > > Please cull those from the acceptable digests, they are the Fake News of > cryptographic reassurance ;) Seriously? MD5 and SHA-1 of course yes, but there's no particular evidence that SHA256 is problematic, and as yet it's far more popular as an advertised tarball hash than anything based on SHA-3 or BLAKE2. (I don't know about SHA224, but it's at least also in the SHA-2 family.) Current NIST policy recommends SHA256 as a minimum, and says "Currently there is no need to transition applications from SHA-2 to SHA-3", dated 2015-08-05 (http://csrc.nist.gov/groups/ST/hash/policy.html). Of course it's always important to retain hash algorithm agility and usually wise to prefer more recent standards in new applications, but it's IMO far too early to regard SHA256 as unacceptable. -- Colin Watson [cjwat...@ubuntu.com] -- Snapcraft mailing list Snapcraft@lists.snapcraft.io Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/snapcraft
Re: ANN: snapcraft 2.28 has been released
What a great release, thank you! Only one request: On 30/03/17 20:54, Sergio Schvezov wrote: > ### sources > > Sources, thanks to an external contributor, can now make use of a new entry, > `source-checksum` which can be added to sources that can be hashed, the > format is the following: `source-checksum: /`. These are > the supported algorithms: > > - `md5` > - `sha1` > - `sha224` > - `sha256` Please cull those from the acceptable digests, they are the Fake News of cryptographic reassurance ;) Mark -- Snapcraft mailing list Snapcraft@lists.snapcraft.io Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/snapcraft
Re: classic 32 bit application
On 31 March 2017 at 05:38, Seth Arnoldwrote: > On Thu, Mar 30, 2017 at 08:10:26AM +0200, Alistair Grant wrote: >> I'm trying to package a 32 bit software development environment: Pharo >> Smalltalk (http://pharo.org). >> >> I've got it working OK as a devmode package, but as soon as I switch it >> to classic confinement it fails to run. > > I was under the impression the usual progression is from devmode to > strict. Are you certain classic is the correct direction for your snap? I ran into a similar conundrum for the Python snap I built. If your package contains a language runtime and interactive shell, it is difficult to decide what sort of confinement policy makes sense. It is possible to run under strict confinement with few or any interfaces connected, but depending on what the user wants to do might want a lot more permission (e.g. ability to access the network, ability to write to the home directory, etc). At present the best option seems to be to package things with strict confinement but ensure that it will be functional if installed with --classic. That gives safety by default, but full functionality on request. Of course, this means snapcraft isn't giving any help with the necessary link flags to get things working reliably on non-Ubuntu systems. I guess that's something to try and solve next. James. -- Snapcraft mailing list Snapcraft@lists.snapcraft.io Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/snapcraft
Re: desktop-gtk3
Le 31/03/2017 à 05:55, Spencer Parkin a écrit : That just adds a deprecation warning (if I add the '/', I mean.) It says, "DEPRECATED: Found a "/" in the name of the 'desktiop/gtk3' part" Here's the major error I'm getting... "Issue while loading plugin: properties failed to load for desktop-gtk3: Additional properties are not allowed ('prime' was unexpected)" I'm punting on this for now (i.e., giving up), but if anyone has any ideas, please let me know. Thanks. Check that the indentation is correct and you didn't change spaces with tabs or so on. I just copied your snapcraft.yaml and don't have any problem here. $ snapcraft --version 2.28 Didier On Thu, Mar 30, 2017 at 11:21 AM, José Pekkarinen < jose.pekkari...@canonical.com> wrote: Did you tried [desktop/gtk3]? $ snapcraft search ... desktop-gtk3 Helpers for gtk2, gtk3, qt4 and qt5 or glib minimal launchers. ... desktop/gtk3 Helpers for gtk2, gtk3, qt4 and qt5 or glib minimal launchers. ... Best regards. José. On Thursday 30 March 2017 11:09:00 Spencer Parkin wrote: Take a look at the following .yaml file. https://github.com/ubuntu/snapcraft-desktop-helpers/ blob/master/demos/gtk3/s napcraft.yaml Notice the following line in it... after: [desktop-gtk3] That's the line I need, and the line I've used most often in my git history, but it doesn't work anymore. When I'm back on my linux box this evening, I can give more information. I wonder if something has changed with an update of snapcraft. On Thu, Mar 30, 2017 at 11:05 AM, José Pekkarinen < jose.pekkari...@canonical.com> wrote: On Thursday 30 March 2017 11:01:02 Spencer Parkin wrote: Yes, that's the complete file. See, here's the thing. My program has been correctly snapping with "desktop-gtk3" in there fore quite some time. It's only recently that it's stopped working. I've looked in my git history to see if maybe I've broken something, but that's how it's always been. Reading your file what I thing you might want to do is this: ... parts: twistypuzzle: plugin: scons source: https://github.com/spencerparkin/TwistyPuzzle.git source-branch: stable-release build-packages: - after: - desktop-gtk3 - fontsystem - 3dmath - permutationgroup - rapidjson ... Let me know if I'm wrong on this assumption. Best regards. José. -- Snapcraft mailing list Snapcraft@lists.snapcraft.io Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/snapcraft