/srv/irclogs.ubuntu.com/2016/07/17/#snappy.txt

LBoI wanted to try building a snap package so I decided to try build a go 1.7 snap14:46
LBoThe recommended way for building go is running ./make.bash14:46
LBoIs there a snapcraft plugin for running shell scripts? Or should I solve this in another fashion?14:47
popeyi eneded up making my own plugin for things which have oddball build systems LBo15:04
popeybasically just a simple plugin which sets the environment up and calls the shell scripts required, one by one15:04
monsterjampLBo you're just in luck, I recently made a plugin to run bash scripts.15:04
LBomonsterjamp: awesome15:05
LBoWhere can I find it?15:05
popeyyay!15:05
monsterjampOne sec, I'll put it up on gist.github15:05
LBoThanks!15:05
monsterjampLBo: https://gist.github.com/monsterjamp/570fbfe8bbdf959d94486f293956fdbe15:06
monsterjampJust put this file in parts/plugins/15:07
LBomonsterjamp: thanks! Seems to work great!15:09
monsterjampLBo: If you have any questions or suggestions, let me know.15:09
monsterjampYour welcome15:09
LBoNow I have to find out how to set some env variables15:09
dz0nyLBo: you have binary builds on download.golang.org, why not just package those?15:20
mupPR snapd#1559 opened: network-observe: add device read support <Created by jaymell> <https://github.com/snapcore/snapd/pull/1559>20:34
verwilstHello! Wanted to make a snap for phpstorm, but the docs are awful..20:37
verwilst :(20:37
verwilstI want to create a snap and a flatpak for the package, and see which one i prefer and stick with that20:38
verwilstmaybe somebody can point me in the right direction?20:38
monsterjampWhat do you need help with?20:38
verwilstwell.. it's a java app.. so i tried parts: jdk: plugin: jdk, but i hardly know what i'm doing.. :-) I wanted to download the tarball and extract it and go from there.. so i messed with plugin tar-content ( which seems absolete, it says to use copy, but can't find a connection between tar and copy :-p ), source-type: tar, etc..20:39
verwilstobsolete*20:40
monsterjampCan I see your snapcraft.yaml file?20:41
verwilstso then i dowloaded and untarred the package myself, and put the snapcraft.yml in the root folder20:41
verwilsthttp://pastebin.ca/366025820:42
verwilstit's a concat from all different snippets and lines i've seen online :-p20:42
verwilsthttp://pastebin.ca/366026020:46
verwilstmaybe this is more like it20:46
verwilstdownload/extract and then run a script ( i know i still need to add the apps thingy :-)20:47
monsterjampHm... I'm not entirely sure how to use the copy plugin either :P20:47
verwilstdon't even know if i need the copy plugin20:47
verwilsti just want to download and untar the archive :-)20:47
monsterjampverwilst: https://github.com/snapcore/snapcraft/blob/master/integration_tests/snaps/simple-copy/snapcraft.yaml20:49
monsterjampHere's an example of how copy is used20:49
monsterjampverwlist are you able to make a snap if you download and untar it manually?20:51
verwilsti'm not getting anywhere for now, so no :-)20:52
verwilsteven the yaml you showed me, src: dst,  srcdir: dstdir.. say what?20:52
verwilstoh wait :-)20:53
verwilstit doesn't support http20:53
verwilst[Errno 2] No such file or directory20:53
monsterjampAlso the website is forbidden20:53
monsterjamphttps://download.jetbrains.com/webidePhpStorm-2016.2.tar.gz20:53
monsterjampActually I think you can use http in snapcraft20:54
verwilsthttps://download.jetbrains.com/webide/PhpStorm-2016.2.tar.gz20:54
monsterjampIt works now :O20:54
monsterjampAlthough I don't know where the files will be after it's extracted20:55
monsterjampHow big is this file?20:56
verwilstcouple of 100MBs :-)20:56
monsterjampOh...20:57
monsterjamphttp://paste.ubuntu.com/19818676/20:57
monsterjampThis downloads the tar but it's gonna be a while before I know what copy does with the tar :/20:57
verwilstthat doesn't work right?20:57
verwilstit does? uh20:57
monsterjampIt works20:57
monsterjampSnapcraft is downlaoding the tar atm20:58
verwilstbut src: dst  doesnt make any sense :-)20:58
verwilstany why copy after a download.. copy where.. :-p20:58
verwilstbut idd it downloads20:58
monsterjampI don't know, `snapcraft help copy` doesn't even explain what copy does :/20:59
verwilstextracting..20:59
monsterjampYou've already finished downloading ?20:59
verwilsthttp://pastebin.ca/366027120:59
verwilstsure :-) I usually get around 25MB/sec20:59
monsterjampDoes it extract the tar?21:01
verwilstThe copy plugin takes a list of files to just directly copy without building or downloading anything. In21:01
verwilstyeah think so, since there was a big pause after downloading21:02
verwilstalthough my stage dir is empty21:02
monsterjampIt should be in parts/phpstorm/src21:02
verwilstls parts/download/src/21:02
verwilstbin  build.txt  help  Install-Linux-tar.txt  jre  lib  plugins21:02
verwilstthat seems correct21:02
monsterjampI don't think you need the copy plugin, it's already extracted :O21:03
verwilsthttp://pastebin.ca/366027921:04
verwilstwell, i think the copy files: thing then allows you to copy the extracted contents to the stage dir..21:04
verwilst23:03:57 desktop ~/Downloads/phpstorm/PhpStorm-162.1121.38 $ ls stage/21:04
verwilstbin  build.txt  help  Install-Linux-tar.txt  jre  lib  plugins21:04
verwilstso now i might only have to specify an app21:05
verwilsthttp://pastebin.ca/3660282 this seemed to download and install a jdk from the ubuntu repos..21:07
monsterjampThat's weird...21:09
monsterjampverwilst: I think the easiest way to get your snap working would probably be to use my bash plugin: https://gist.github.com/monsterjamp/570fbfe8bbdf959d94486f293956fdbe21:10
verwilstSnapped phpstorm_2016.2_amd64.snap21:10
monsterjampIt worked :O21:10
monsterjampnvm then21:10
verwilstnot sure.. installed it21:11
monsterjampDid you add the apps section?21:11
verwilstyup21:11
verwilstbin/phpstorm.sh21:12
verwilstthere is a /snap/bin/phpstorm.test file now?21:12
verwilstbash21:12
verwilstis that the way to start apps?21:12
verwilsthttp://pastebin.ca/366028521:13
verwilsthttp://pastebin.ca/366028621:14
monsterjampWait... Check parts/phpstorm/install21:14
monsterjampIs there a folder in there a bin folder there21:14
verwilstyup21:14
verwilstthat folder seems to be the untarred source pkg21:15
monsterjampTry install the snap with the argument `--devmode`21:15
monsterjampDoes the snap start?21:15
verwilstdevmode is in my yaml already21:15
monsterjampYou have to specify it at install21:16
verwilstconfinement: devmode21:16
monsterjampThe confinement is still strict if you don't install it with `--devmode`21:16
verwilstah ok21:16
monsterjampOr at least it is for me (could be a bug)21:16
verwilstwell, it started..21:17
verwilstsomehow21:17
verwilststill it's strange to having to start a /snap/bin/phpstorm.test file21:17
verwilstooh21:17
verwilsti named my app: test :-p21:17
monsterjampYeah21:17
monsterjampTry typing `test` in the terminal21:18
verwilsttest is kinda taken i think :-p21:18
monsterjamplol21:18
verwilstgoing to rename it21:18
verwilststill, the jdk stuff seems fishy21:18
monsterjampDo you know how to use snappy-debug?21:19
verwilsti should just have it as a dep21:19
verwilstnope21:19
monsterjampYeah I really don't like the plugins, they're limiting21:19
verwilst/snap/bin/phpstorm.letmetrythis works21:19
verwilstphpstorm.letmetrythis is in my path21:20
monsterjampverwlist: https://wiki.ubuntu.com/SecurityTeam/Specifications/SnappyConfinement21:20
verwilstah, it uses apparmor?21:21
monsterjampYeah21:21
monsterjampIn devmode the snap is given permission to everything.21:21
verwilstbut i guess an IDE has to have access to everything :-p21:21
monsterjampThe part the documentation almost completely skips over is the interfaces21:22
verwilsti think documentation is a big word :-p21:22
monsterjampI'm guessing you have to allow phpstorm to access the X11 interface21:22
verwilstyeah, but disk-wise i mean21:23
verwilstsome put their code under Documents, some under Projects, some under PhpStormProjects, etc21:23
monsterjampI think that's under the home interface21:24
monsterjamphttps://developer.ubuntu.com/en/snappy/guides/interfaces/21:24
verwilstCan access non-hidden files in $HOME21:25
verwilstthat's already a lot safer21:25
verwilstno access to other settings or .ssh, .gpg21:25
monsterjampssh might be under the network interfaces21:26
verwilsti hope you can say 'but allow .phpstorm' for example21:26
monsterjampverwlist your snapcraft.yaml file will looking something like this: http://paste.ubuntu.com/19822190/21:26
verwilstwhy network-control?21:27
verwilstCan configure networking. This is restricted because it gives wide, privileged access to networking and should only be used with trusted apps.21:27
verwilstit's an IDE?21:27
monsterjampI thought you mentioned ssh :P21:27
verwilst.ssh21:27
verwilstthe place you put your private key21:27
monsterjampOh :P21:28
monsterjampSnaps are currently really limited mainly because it's "too secure".21:29
verwilsti wonder what will come of flatpak and snappy21:29
verwilstbut it's definitely the way forward21:29
monsterjampMe too, have you used flatpak yet?21:29
verwilstnope21:29
verwilsti will try to package phpstorm as well though21:29
verwilstjust to get the feel for it21:29
verwilstjava.awt.AWTError: Can't connect to X11 window server using ':0' as the value of the DISPLAY variable21:30
monsterjampI've been meaning to try out flatpaks but the whole repo thing overwhelms me.21:30
verwilstwith plugs: [X11, home, network]21:30
monsterjampWhat does the snappy-debug logs say?21:31
monsterjampIf it works with devmode, it should work in strict mode with plugs.21:31
verwilstJul 17 23:30:22 desktop kernel: [ 8746.944817] audit: type=1400 audit(1468791022.946:540): apparmor="DENIED" operation="connect" profile="snap.phpstorm.phpstorm" pid=19790 comm="java" family="unix" sock_type="stream" protocol=0 requested_mask="send receive connect" denied_mask="send connect" addr=none peer_addr="@/tmp/.X11-unix/X0" peer="unconfined"21:32
verwilstmaybe it's lowercase21:33
monsterjampThe permissions for snaps is still very confusing for me so I'm not sure how to fix that.21:33
verwilstplugs: [x11, home, network]21:33
verwilstgoing to try that21:33
verwilsthttp://pastebin.ca/366029221:35
verwilstInvalid Log Path: Log path '/home/verwilst/.PhpStorm2016.2/system/log' is inaccessible.21:35
verwilst:-p21:35
verwilstas i thought21:35
monsterjampIs that the error you get when runnig snappy-debug?21:36
verwilstno, when running phpstorm21:37
monsterjampOh, well snaps are pretty limiting :P21:37
verwilstso they seem..21:38
verwilstwell, thanks a lot for the help :-) At least i've gotten my toes wet ;-)21:40
monsterjamp:D21:41
verwilstbedtime!21:41
LBoI created a snap for go 1.7 just to try it out21:56
LBodz0ny: that's true but I wanted to21:56
LBohttp://paste.ubuntu.com/19825355/21:56
LBoWhen running /snap/bin/golang17.go17 version I get this error: "execv failed: Permission denied"21:56
LBoWhat could be the problem here?21:57
LBoI've enabled devmode but that didn't solve the problem21:57
monsterjampLBo: Did you install it with the `--devmode` argument?21:58
LBonot yet21:59
LBoI'm going to try that21:59
LBoDid that. Same error21:59
LBodmesg doesn't show anything useful21:59
LBo[2250360.316093] systemd[1]: snapd.refresh.timer: Adding 1h 43min 31.266732s random time.21:59
LBo[2250360.576927] audit: type=1400 audit(1468792753.293:29): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="snap.golang17.go17" pid=3709 comm="apparmor_parser"21:59
monsterjampI'm not really sure then, afaik if it doesn't work in devmode it won't work at all :/22:01
LBomonsterjamp: ok, thanks for looking at it!22:01
LBosudo /snap/bin/golang17.go17 works22:11
tsimonq2hey monsterjamp, I'm back :)22:17
LBoIf I copy it out of /snap/golang to my home directory and run it it runs fine22:28
LBoDoing an strace results in this: http://paste.ubuntu.com/19829595/22:35
LBoGoogling that error message in strace leads back to: https://github.com/snapcore/snap-confine/blob/master/src/sc-main.c#L7022:52

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!