[14:46] I wanted to try building a snap package so I decided to try build a go 1.7 snap [14:46] The recommended way for building go is running ./make.bash [14:47] Is there a snapcraft plugin for running shell scripts? Or should I solve this in another fashion? [15:04] i eneded up making my own plugin for things which have oddball build systems LBo [15:04] basically just a simple plugin which sets the environment up and calls the shell scripts required, one by one [15:04] LBo you're just in luck, I recently made a plugin to run bash scripts. [15:05] monsterjamp: awesome [15:05] Where can I find it? [15:05] yay! [15:05] One sec, I'll put it up on gist.github [15:05] Thanks! [15:06] LBo: https://gist.github.com/monsterjamp/570fbfe8bbdf959d94486f293956fdbe [15:07] Just put this file in parts/plugins/ [15:09] monsterjamp: thanks! Seems to work great! [15:09] LBo: If you have any questions or suggestions, let me know. [15:09] Your welcome [15:09] Now I have to find out how to set some env variables [15:20] LBo: you have binary builds on download.golang.org, why not just package those? [20:34] PR snapd#1559 opened: network-observe: add device read support [20:37] Hello! Wanted to make a snap for phpstorm, but the docs are awful.. [20:37] :( [20:38] I want to create a snap and a flatpak for the package, and see which one i prefer and stick with that [20:38] maybe somebody can point me in the right direction? [20:38] What do you need help with? [20:39] well.. 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:40] obsolete* [20:41] Can I see your snapcraft.yaml file? [20:41] so then i dowloaded and untarred the package myself, and put the snapcraft.yml in the root folder [20:42] http://pastebin.ca/3660258 [20:42] it's a concat from all different snippets and lines i've seen online :-p [20:46] http://pastebin.ca/3660260 [20:46] maybe this is more like it [20:47] download/extract and then run a script ( i know i still need to add the apps thingy :-) [20:47] Hm... I'm not entirely sure how to use the copy plugin either :P [20:47] don't even know if i need the copy plugin [20:47] i just want to download and untar the archive :-) [20:49] verwilst: https://github.com/snapcore/snapcraft/blob/master/integration_tests/snaps/simple-copy/snapcraft.yaml [20:49] Here's an example of how copy is used [20:51] verwlist are you able to make a snap if you download and untar it manually? [20:52] i'm not getting anywhere for now, so no :-) [20:52] even the yaml you showed me, src: dst, srcdir: dstdir.. say what? [20:53] oh wait :-) [20:53] it doesn't support http [20:53] [Errno 2] No such file or directory [20:53] Also the website is forbidden [20:53] https://download.jetbrains.com/webidePhpStorm-2016.2.tar.gz [20:54] Actually I think you can use http in snapcraft [20:54] https://download.jetbrains.com/webide/PhpStorm-2016.2.tar.gz [20:54] It works now :O [20:55] Although I don't know where the files will be after it's extracted [20:56] How big is this file? [20:56] couple of 100MBs :-) [20:57] Oh... [20:57] http://paste.ubuntu.com/19818676/ [20:57] This downloads the tar but it's gonna be a while before I know what copy does with the tar :/ [20:57] that doesn't work right? [20:57] it does? uh [20:57] It works [20:58] Snapcraft is downlaoding the tar atm [20:58] but src: dst doesnt make any sense :-) [20:58] any why copy after a download.. copy where.. :-p [20:58] but idd it downloads [20:59] I don't know, `snapcraft help copy` doesn't even explain what copy does :/ [20:59] extracting.. [20:59] You've already finished downloading ? [20:59] http://pastebin.ca/3660271 [20:59] sure :-) I usually get around 25MB/sec [21:01] Does it extract the tar? [21:01] The copy plugin takes a list of files to just directly copy without building or downloading anything. In [21:02] yeah think so, since there was a big pause after downloading [21:02] although my stage dir is empty [21:02] It should be in parts/phpstorm/src [21:02] ls parts/download/src/ [21:02] bin build.txt help Install-Linux-tar.txt jre lib plugins [21:02] that seems correct [21:03] I don't think you need the copy plugin, it's already extracted :O [21:04] http://pastebin.ca/3660279 [21:04] well, i think the copy files: thing then allows you to copy the extracted contents to the stage dir.. [21:04] 23:03:57 desktop ~/Downloads/phpstorm/PhpStorm-162.1121.38 $ ls stage/ [21:04] bin build.txt help Install-Linux-tar.txt jre lib plugins [21:05] so now i might only have to specify an app [21:07] http://pastebin.ca/3660282 this seemed to download and install a jdk from the ubuntu repos.. [21:09] That's weird... [21:10] verwilst: I think the easiest way to get your snap working would probably be to use my bash plugin: https://gist.github.com/monsterjamp/570fbfe8bbdf959d94486f293956fdbe [21:10] Snapped phpstorm_2016.2_amd64.snap [21:10] It worked :O [21:10] nvm then [21:11] not sure.. installed it [21:11] Did you add the apps section? [21:11] yup [21:12] bin/phpstorm.sh [21:12] there is a /snap/bin/phpstorm.test file now? [21:12] bash [21:12] is that the way to start apps? [21:13] http://pastebin.ca/3660285 [21:14] http://pastebin.ca/3660286 [21:14] Wait... Check parts/phpstorm/install [21:14] Is there a folder in there a bin folder there [21:14] yup [21:15] that folder seems to be the untarred source pkg [21:15] Try install the snap with the argument `--devmode` [21:15] Does the snap start? [21:15] devmode is in my yaml already [21:16] You have to specify it at install [21:16] confinement: devmode [21:16] The confinement is still strict if you don't install it with `--devmode` [21:16] ah ok [21:16] Or at least it is for me (could be a bug) [21:17] well, it started.. [21:17] somehow [21:17] still it's strange to having to start a /snap/bin/phpstorm.test file [21:17] ooh [21:17] i named my app: test :-p [21:17] Yeah [21:18] Try typing `test` in the terminal [21:18] test is kinda taken i think :-p [21:18] lol [21:18] going to rename it [21:18] still, the jdk stuff seems fishy [21:19] Do you know how to use snappy-debug? [21:19] i should just have it as a dep [21:19] nope [21:19] Yeah I really don't like the plugins, they're limiting [21:19] /snap/bin/phpstorm.letmetrythis works [21:20] phpstorm.letmetrythis is in my path [21:20] verwlist: https://wiki.ubuntu.com/SecurityTeam/Specifications/SnappyConfinement [21:21] ah, it uses apparmor? [21:21] Yeah [21:21] In devmode the snap is given permission to everything. [21:21] but i guess an IDE has to have access to everything :-p [21:22] The part the documentation almost completely skips over is the interfaces [21:22] i think documentation is a big word :-p [21:22] I'm guessing you have to allow phpstorm to access the X11 interface [21:23] yeah, but disk-wise i mean [21:23] some put their code under Documents, some under Projects, some under PhpStormProjects, etc [21:24] I think that's under the home interface [21:24] https://developer.ubuntu.com/en/snappy/guides/interfaces/ [21:25] Can access non-hidden files in $HOME [21:25] that's already a lot safer [21:25] no access to other settings or .ssh, .gpg [21:26] ssh might be under the network interfaces [21:26] i hope you can say 'but allow .phpstorm' for example [21:26] verwlist your snapcraft.yaml file will looking something like this: http://paste.ubuntu.com/19822190/ [21:27] why network-control? [21:27] Can configure networking. This is restricted because it gives wide, privileged access to networking and should only be used with trusted apps. [21:27] it's an IDE? [21:27] I thought you mentioned ssh :P [21:27] .ssh [21:27] the place you put your private key [21:28] Oh :P [21:29] Snaps are currently really limited mainly because it's "too secure". [21:29] i wonder what will come of flatpak and snappy [21:29] but it's definitely the way forward [21:29] Me too, have you used flatpak yet? [21:29] nope [21:29] i will try to package phpstorm as well though [21:29] just to get the feel for it [21:30] java.awt.AWTError: Can't connect to X11 window server using ':0' as the value of the DISPLAY variable [21:30] I've been meaning to try out flatpaks but the whole repo thing overwhelms me. [21:30] with plugs: [X11, home, network] [21:31] What does the snappy-debug logs say? [21:31] If it works with devmode, it should work in strict mode with plugs. [21:32] Jul 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:33] maybe it's lowercase [21:33] The permissions for snaps is still very confusing for me so I'm not sure how to fix that. [21:33] plugs: [x11, home, network] [21:33] going to try that [21:35] http://pastebin.ca/3660292 [21:35] Invalid Log Path: Log path '/home/verwilst/.PhpStorm2016.2/system/log' is inaccessible. [21:35] :-p [21:35] as i thought [21:36] Is that the error you get when runnig snappy-debug? [21:37] no, when running phpstorm [21:37] Oh, well snaps are pretty limiting :P [21:38] so they seem.. [21:40] well, thanks a lot for the help :-) At least i've gotten my toes wet ;-) [21:41] :D [21:41] bedtime! [21:56] I created a snap for go 1.7 just to try it out [21:56] dz0ny: that's true but I wanted to [21:56] http://paste.ubuntu.com/19825355/ [21:56] When running /snap/bin/golang17.go17 version I get this error: "execv failed: Permission denied" [21:57] What could be the problem here? [21:57] I've enabled devmode but that didn't solve the problem [21:58] LBo: Did you install it with the `--devmode` argument? [21:59] not yet [21:59] I'm going to try that [21:59] Did that. Same error [21:59] dmesg doesn't show anything useful [21:59] [2250360.316093] systemd[1]: snapd.refresh.timer: Adding 1h 43min 31.266732s random time. [21:59] [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" [22:01] I'm not really sure then, afaik if it doesn't work in devmode it won't work at all :/ [22:01] monsterjamp: ok, thanks for looking at it! [22:11] sudo /snap/bin/golang17.go17 works [22:17] hey monsterjamp, I'm back :) [22:28] If I copy it out of /snap/golang to my home directory and run it it runs fine [22:35] Doing an strace results in this: http://paste.ubuntu.com/19829595/ [22:52] Googling that error message in strace leads back to: https://github.com/snapcore/snap-confine/blob/master/src/sc-main.c#L70