Re: Provisional snap for DUB (D language package/build manager)

2016-11-13 Thread Joseph Rushton Wakeling

On 03/11/16 11:49, Joseph Rushton Wakeling wrote:

On 01/11/16 22:43, Sergio Schvezov wrote:

If this is x86_64, everything is aligned with the world, syscall 92 is chown. A
useful tool here can help you out, and luckily there is one, run `snap install
snappy-debug` and it will do some nice things to figure out what is going on wth
these apparmor and seccomp blockers.


Cheers, I'll try that out.  Will probably be a little while before I follow up
-- I'm going to be away from computer for the next couple of weeks.


Sorry for delayed response; I was on vacation and very deliberately AFK ;-)


If this is the problem and you can patch the software then removing the chown
could work, I am CCing Jamie for other ideas that could come up.


Looking at the dub source code, it seems that the actual build -- i.e. the 
compiler call that generates the binary -- writes to a temporary .dub/ directory 
created in the project tree, and the generated files are then copied to the 
user-perceived output location, with chown and chmod calls to preserve the 
permissions:

https://github.com/dlang/dub/blob/v1.0.0/source/dub/internal/vibecompat/core/file.d#L126-L128

That seems a reasonable enough approach in itself, but is it possible to 
preserve that basic operational principle without hitting the block on chown?


The `copy` function called earlier on L115 actually has an optional `preserve` 
parameter that allows file attributes to be maintained during the copy; it might 
be worth trying this out to see if that doesn't hit the blocks from the 
container, although it still does a chmod:

https://github.com/dlang/phobos/blob/60cd8d2aa70e1c9cfd7c58fa42bce7345fd00b77/std/file.d#L3393

... so whether that would work would presumably hinge on whether chmod is also 
forbidden by containerization, or just chown.


It's not obvious to me why the author of the dub code has instead created a 
POSIX-specific control block to set permissions manually, so I'll check out that 
with the dub folks.


--
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Provisional snap for DUB (D language package/build manager)

2016-11-13 Thread Joseph Rushton Wakeling

On 03/11/16 12:08, Jamie Bennett wrote:



Regards,
Jamie.


... I guess an email got lost there? :-)  Thanks in any case for taking the time 
to look at my questions.



--
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Cross platform snap creation?

2016-11-13 Thread Peter Uithoven
Hi folks,

This is a question on behalf of the people behind Electron: Is is possible
to create snaps from other platforms than Linux? Would this be possible
through a Docker container? Are there docs on this?

https://github.com/electron-userland/electron-packager/issues/525#issuecomment-260109515
https://github.com/electron-userland/electron-builder/issues/509

Electron enables the creation of cross platform application using web
technologies (javascript, css, html, Node.js etc). The Atom editor for
example is build with it.
http://electron.atom.io/

Thanks in advance,
Peter Uithoven
-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Cliqz Snap

2016-11-13 Thread Chris
On Sun, 2016-11-13 at 10:41 +0800, XiaoGuo Liu wrote:
> Hi Chris,
> 
> You may find the tips at https://github.com/snapcore/snapd/wiki/Secur
> ity. You may use the command like:
> 
> $ scmp_sys_resolver 983045
> set_tls
> to find out the security violation.
> 
> Best regards,
> XiaoGuo
> 

Thank you XiaoGuo, so in my case I have syscall=272. Running 

chris@localhost:~$ scmp_sys_resolver 272
unshare

I've installed snappy-debug but can't seem to get any kind of output
when run. Maybe I'm using the wrong commands?

> On Sun, Nov 13, 2016 at 7:13 AM, Chris 
> wrote:
> > Has anyone gotten this snap to run? The install went fine AFAICT
> > but
> > when executed nothing happens. Syslog shows
> > 
> > Nov 12 17:00:55 localhost /usr/lib/snapd/snapd[844]: daemon.go:174:
> > DEBUG: uid=1000;@ GET /v2/snaps 31.184976ms 200
> > 
> > Nov 12 17:00:55 localhost kernel: [250160.993225] audit: type=1326
> > audit(1478991655.666:65): auid=1000 uid=1000 gid=1000 ses=3
> > pid=10201
> > comm="cliqz" exe="/snap/cliqz/6/opt/CLIQZ/CLIQZ" sig=31
> > arch=c03e
> > syscall=272 compat=0 ip=0x7f5d82721c19 code=0x0
> > 
> > When executed from the cli
> > 
> > chris@localhost:~$ cliqz
> > Bad system call
> > 
> > --
> > Chris
> > KeyID 0xE372A7DA98E6705C
> > 31.11972; -97.90167 (Elev. 1092 ft)
> > 16:59:51 up 2 days, 21:28, 1 user, load average: 0.32, 0.37, 0.36
> > Ubuntu 16.04.1 LTS, kernel 4.4.0-47-generic #68-Ubuntu SMP Wed Oct
> > 26 19:39:52 UTC 2016
> > 
> > --
> > Snapcraft mailing list
> > Snapcraft@lists.snapcraft.io
> > Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman
> > /listinfo/snapcraft
> > 
> 
> 
> -- 
> XiaoGuo, Liu 
> -- 
> Snapcraft mailing list
> Snapcraft@lists.snapcraft.io
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/l
> istinfo/snapcraft
-- 
Chris
KeyID 0xE372A7DA98E6705C
31.11972; -97.90167 (Elev. 1092 ft)
08:57:09 up 3 days, 13:25, 1 user, load average: 0.14, 0.15, 0.22
Ubuntu 16.04.1 LTS, kernel 4.4.0-47-generic #68-Ubuntu SMP Wed Oct 26 19:39:52 
UTC 2016


signature.asc
Description: This is a digitally signed message part
-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Cliqz Snap

2016-11-13 Thread Chris
On Sun, 2016-11-13 at 09:17 -0600, Chris wrote:
> On Sun, 2016-11-13 at 10:41 +0800, XiaoGuo Liu wrote:
> > 
> > Hi Chris,
> > 
> > You may find the tips at https://github.com/snapcore/snapd/wiki/Sec
> > ur
> > ity. You may use the command like:
> > 
> > $ scmp_sys_resolver 983045
> > set_tls
> > to find out the security violation.
> > 
> > Best regards,
> > XiaoGuo
> > 
> Thank you XiaoGuo, so in my case I have syscall=272. Running 
> 
> chris@localhost:~$ scmp_sys_resolver 272
> unshare
> 
> I've installed snappy-debug but can't seem to get any kind of output
> when run. Maybe I'm using the wrong commands?
> 
Replying to my own post. I wasn't running the snap whenever I ran

sudo snappy-debug.security scanlog --all-entries cliqz

Once I executed the snap from the menu with the above running I got

chris@localhost:~$ sudo snappy-debug.security scanlog --all-entries
cliqz
kernel.printk_ratelimit = 0
= Seccomp =
Time: Nov 13 11:49:59
Log: auid=1000 uid=1000 gid=1000 ses=3 pid=29796 comm="cliqz"
exe="/snap/cliqz/6/opt/CLIQZ/CLIQZ" sig=31 arch=c03e 272(unshare)
compat=0 ip=0x7ffacd899c19 code=0x0
Syscall: unshare

So, now it seems as there is a seccomp violation stopping the snap from
running, at least that's what it appears to me to be. Where would I go
from here? Contact the snap author?

Chris

> > 
> > On Sun, Nov 13, 2016 at 7:13 AM, Chris 
> > wrote:
> > > 
> > > Has anyone gotten this snap to run? The install went fine AFAICT
> > > but
> > > when executed nothing happens. Syslog shows
> > > 
> > > Nov 12 17:00:55 localhost /usr/lib/snapd/snapd[844]:
> > > daemon.go:174:
> > > DEBUG: uid=1000;@ GET /v2/snaps 31.184976ms 200
> > > 
> > > Nov 12 17:00:55 localhost kernel: [250160.993225] audit:
> > > type=1326
> > > audit(1478991655.666:65): auid=1000 uid=1000 gid=1000 ses=3
> > > pid=10201
> > > comm="cliqz" exe="/snap/cliqz/6/opt/CLIQZ/CLIQZ" sig=31
> > > arch=c03e
> > > syscall=272 compat=0 ip=0x7f5d82721c19 code=0x0
> > > 
> > > When executed from the cli
> > > 
> > > chris@localhost:~$ cliqz
> > > Bad system call
> > > 
> > > --
> > > Chris
> > > KeyID 0xE372A7DA98E6705C
> > > 31.11972; -97.90167 (Elev. 1092 ft)
> > > 16:59:51 up 2 days, 21:28, 1 user, load average: 0.32, 0.37, 0.36
> > > Ubuntu 16.04.1 LTS, kernel 4.4.0-47-generic #68-Ubuntu SMP Wed
> > > Oct
> > > 26 19:39:52 UTC 2016
> > > 
> > > --
> > > Snapcraft mailing list
> > > Snapcraft@lists.snapcraft.io
> > > Modify settings or unsubscribe at: https://lists.ubuntu.com/mailm
> > > an
> > > /listinfo/snapcraft
> > > 
> > 
> > -- 
> > XiaoGuo, Liu 
> > -- 
> > Snapcraft mailing list
> > Snapcraft@lists.snapcraft.io
> > Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman
> > /l
> > istinfo/snapcraft
> -- 
> Snapcraft mailing list
> Snapcraft@lists.snapcraft.io
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/l
> istinfo/snapcraft
-- 
Chris
KeyID 0xE372A7DA98E6705C
31.11972; -97.90167 (Elev. 1092 ft)
11:59:03 up 3 days, 16:27, 1 user, load average: 0.34, 0.18, 0.17
Ubuntu 16.04.1 LTS, kernel 4.4.0-47-generic #68-Ubuntu SMP Wed Oct 26 19:39:52 
UTC 2016


signature.asc
Description: This is a digitally signed message part
-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Provisional snap for DUB (D language package/build manager)

2016-11-13 Thread Joseph Rushton Wakeling

On 13/11/16 10:11, Joseph Rushton Wakeling wrote:

On 03/11/16 11:49, Joseph Rushton Wakeling wrote:

On 01/11/16 22:43, Sergio Schvezov wrote:

If this is the problem and you can patch the software then removing the chown
could work, I am CCing Jamie for other ideas that could come up.


Looking at the dub source code, it seems that the actual build -- i.e. the
compiler call that generates the binary -- writes to a temporary .dub/ directory
created in the project tree, and the generated files are then copied to the
user-perceived output location, with chown and chmod calls to preserve the
permissions:
https://github.com/dlang/dub/blob/v1.0.0/source/dub/internal/vibecompat/core/file.d#L126-L128


OK, upstream accepted my patch to deal with this.  The current state of my 
external snap package, described here:

https://github.com/WebDrake/dub.snap/pull/1

... now works with some essential basics:

  * it can compile a program that has no dependencies;

  * it can download dub packages from https://code.dlang.org/ and incorporate
them into a project.

The major TODOs would be:

  * ensure the dub plugin downloads an upstream dub rather than relying on
ubuntu packages;

  * separate the D compiler from the snap, allowing dub to use any compiler
available on the host system (whether installed as a system package or
as a snap package);

  * find a way for it to access system libraries so as to build dub packages
that have these as dependencies.

The latter two I presume come down to the known issue about how to make host 
resources available to a snap in a safe manner, but I'd be interested in any 
thoughts on whether the D compiler issue might be achieved any more easily.


--
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Nand flash booting.

2016-11-13 Thread Daniel Toussaint
I am working on a board similar to Beaglebone Black, however instead of
SD/eMMC it is booting from NAND flash directly. As far as I can see in the
documentation there is no way yet to boot a Snappy image in this fashion,
is support for this planned ? Is there anything I can do to help out with
that ?

Meanwhile, I am considering using the Yocto version of snapcraft to package
the apps, so that we can later migrate to from the current Yocto image to
Snappy.

Thanks for your comments.
-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


crontab like snaps or interfaces

2016-11-13 Thread Enwei Zhang
Hello,
I want to ask if there is any snaps or interfaces that could support
crontab or systemd.timer or that kind of timed operations.
For example, if my snap uses syslog to save all the logs, how should
logrotate work?

Thanks so much.

Br
Enwei
-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


snapd-glib 1.3 released

2016-11-13 Thread Robert Ancell
Overview of changes in snapd-glib 1.3

* Use new payment API (now stable).
* Add API to get plug/slot attributes.
* Add API for create user API.
* Add async version of snapd_client_connect_sync().
* Fix crash when fail to connect to snapd.
* Don't fail assertion if attempt to connect while already connected.
* Fix transfer notation on GDateTime objects.
* Fix build not regenerating .vapi.
* Small documentation fixes.
* Fix small memory leak.

https://launchpad.net/snapd-glib/+download
-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Tutorial: how to create a simple snapcraft custom plugin

2016-11-13 Thread XiaoGuo Liu
Hi,

Today, I created a very simple tutorial on how to create a snapcraft custom
plugin. The link is at:

http://blog.csdn.net/ubuntutouch/article/details/52981623

Hopefully, it is useful to some of you!

Best regards,
XiaoGuo

-- 
XiaoGuo, Liu
-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: Tutorial: how to create a simple snapcraft custom plugin

2016-11-13 Thread XiaoGuo Liu
Hi,

I am sorry that I pasted the wrong link for the article. The correct one is:

http://blog.csdn.net/ubuntutouch/article/details/53157531

Best regards,
XiaoGuo

On Mon, Nov 14, 2016 at 2:57 PM, XiaoGuo Liu 
wrote:

> Hi,
>
> Today, I created a very simple tutorial on how to create a snapcraft
> custom plugin. The link is at:
>
> http://blog.csdn.net/ubuntutouch/article/details/52981623
>
> Hopefully, it is useful to some of you!
>
> Best regards,
> XiaoGuo
>
> --
> XiaoGuo, Liu
>



-- 
XiaoGuo, Liu
-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft