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