/srv/irclogs.ubuntu.com/2017/06/14/#snappy.txt

=== JanC_ is now known as JanC
=== mup_ is now known as mup
=== chihchun_afk is now known as chihchun
mupPR snapd#3477 opened: tests: fix snap create-key by restarting automatically rng-tools <Created by sergiocazzolato> <https://github.com/snapcore/snapd/pull/3477>02:21
chrisblazekhello, looking for support to get i2c enabled for snappy02:33
chrisblazekis it possible, if so, how do I go about enabling it? thanjs02:33
chrisblazekwelp03:08
zyga-susegood morning06:38
=== zyga is now known as zyga-ubuntu
mupBug #1697880 opened: Add "search" as an alias for "find" in snap command <Snappy:New> <https://launchpad.net/bugs/1697880>07:42
Chipacaniemeyer: feedback on bug 1697880 appreciated07:59
mupBug #1697880: Add "search" as an alias for "find" in snap command <Snappy:Confirmed> <https://launchpad.net/bugs/1697880>07:59
Chipacagood morning all07:59
pstolowskio/07:59
zyga-ubuntuhey08:00
Chipacawhat's the expected state of a change after an "abort" succeeds?08:30
morphisdidn't we mark the interfaces-openvswitch spread test as manual? I see it failing again a numer of times today09:06
morphisfgimenez: ^^09:10
fgimenezmorphis: afaik the PR for marking it as manual was finally closed because other fixes seemed to solve the openvswitch flakyness, sergio knows the details better09:12
morphisfgimenez: hm, whatever was changed I still see it timing out09:12
fallentreeHey all. Question. I'd like to deploy a python application as a snap, for our clients. I want to host X instances of each, per server. They're all the SAME application, but different client and different config. Is it possible to install a single snap multiple times (presumably with different names)?09:23
mvozyga-ubuntu, zyga-fedora: snap-confine in the bind mount magic sets up /var/lib as a symlink, correct?09:24
zyga-ubuntumvo: not quite09:34
zyga-ubuntumvo: /var/lib is a tmpfs and there's a symlink farm to the core snap and to (on classic) one specific location in hostfs09:34
zyga-ubuntumvo: why? anything broken?09:34
mvozyga-ubuntu: mostly wondering about the permissions, they are quite permissive 177709:46
=== rumble is now known as grumble
Chipacapedronis: you around?10:10
pedronisChipaca: yessish, had a bit of hard time sleeping last night10:12
Chipacapedronis: ouh :-(10:12
Chipacapedronis: I don't know how to properly abort a task it seems, as its change either ends up in Done or in Error10:13
Chipacapedronis: but it's not urgent if that's too ish-y10:13
pedronisChipaca: abort in which sense ?10:13
Chipacai've got plenty of other things to work on :-)10:13
Chipacapedronis: 'snap abort nn'10:13
pedroniswhat do you expect ?10:13
Chipacapedronis: shouldn't it say something other than Done or Error in snap changes if you've successfully aborted it?10:14
pedronisno,  you get the abort, cannot finish, return error -> Undo the rest -> Error10:15
pedronisat least that's how hook do this for example10:16
ograkoza, did you get anywhere yet ? btw ... http://people.canonical.com/~ogra/hummingboard-gate-serial.jpg10:18
pedronisChipaca: AbortStatus is not a final status, is just  a marker status  afaiu10:18
Chipacayeap, it's Abort not Aborted10:19
kozaogra, hey, nowhere near; replaced hdmi cable and microSD card; tried images, etc.. notning new10:21
ogradamn ...10:21
pedronisChipaca: this are ready states:   DoneStatus, UndoneStatus, HoldStatus, ErrorStatus10:23
ograkoza, there seems to be a difference between revisions. mine has "REV1.2" printed next to the name on the PCB10:24
kozaogra, rev1.2 is here too10:25
ograkoza, do you know if solid run offers any reference images ... and did you try one yet to make sure it isnt a HW issue ?10:26
kozaogra, no I did not and I do not know of any. Trying to get this info from Linaro folks who - I have been told - are using this board.10:27
ograkoza, seems there are https://wiki.solid-run.com/doku.php?id=products:imx6:software:os:debian10:27
ograhttps://images.solid-build.xyz/IMX6/Debian/10:27
kozaogra, are you sure about tX and RX, here http://download.solid-run.com/pub/solidrun/HummingBoard%202/HummingBoard2%20Schematics%20rev%201.2.pdf They say TX is in the middle (Page 2, search for J25) and you marked RX there10:28
ograkoza, yes, i am ... i got it wired like this here10:28
kozaogra, ok, just double checking10:29
kozayes, good idea try this debian img10:29
ograwhite is definitely in the middle ... i had initially mixed up gnd and green, that works but doesnt recognize input (obviously ... if TX is wrong :P )10:30
ograso i'm 100% sure thats the correct wiring10:30
kozagot it10:31
mupPR snapd#3478 opened: tests: extend upower-observe test to cover snaps providing slots <Created by fgimenez> <https://github.com/snapcore/snapd/pull/3478>10:35
Chipacapedronis: should this manager auto-abort things when it's told to stop?10:36
pedronisChipaca: that should happens automatically10:58
Chipacapedronis: it doesn't seem to10:58
pedronistask runner kills on the tombs10:58
pedroniss/on the/all the tombs/10:58
Chipacapedronis: i'll push code in a bit to see if i'm doing something wrong10:58
ograppisati, is there any reason why our linux-generic armhf build doesnt enable any allwinner SoCs ?11:33
ogra(seems there are many upstreamed already, but not enbled)11:34
ogra*enabled11:36
* zyga-ubuntu finally groks async/await python11:47
Chipacapedronis: i'm definitely doing something wrong :-) if you could take a look at https://github.com/snapcore/snapd/compare/master...chipaca:oddjob it'd be helpful11:47
Chipacapedronis: the failing test is the one with printlns in it; it never gets past the "before stop" line11:47
Chipacai thought it was waiting for the exec to finish (as i had a "sleep 1h" in there originally), but it's not that11:48
Chipacawait maybe it's the lock11:48
Chipacadammit11:49
* zyga-ubuntu hugs Chipaca 11:51
Chipacapedronis: fixed the lock issue, pushed, still have questions (TestExecStop fails, with the change still in Doing)11:56
morphisfgimenez: another failure of the openvswitch test: https://travis-ci.org/snapcore/snapd/builds/24274631112:05
fgimenezmorphis: does this happen only on debian? we could disable it only on that system if that's the case12:07
morphisfgimenez: I saw it on ubuntu and debian today12:07
morphisso doesn't seem to be specific to a system12:08
fgimenezmorphis: ok, i'll propose a PR for marking it as manual12:08
morphisthanks12:08
mupPR snapd#3479 opened: tests: mark interfaces-openvswitch as manual due to prepare errors <Created by fgimenez> <https://github.com/snapcore/snapd/pull/3479>12:12
pedronisChipaca: just a heads up, I think there are some thing the that don't follow naming conventions12:15
Chipacathat's ok, i can change the conventions :-P12:15
pedronisChipaca: EnsureBefore doesn't do anything interesting if you don't use overlord.Loop or Settle fwiw12:17
ChipacaI might have just copied that from my testing code in api.go (not committed)12:18
zyga-ubuntumorphis: I need to skip our call today12:22
pedronisChipaca: you are hitting the new code that make sure we retry downloads across stopping of snapd12:28
pedronisChipaca: Stop provoked errors are turned into Retry12:29
Chipacaahh12:29
pedronislet me give you a pointer12:29
Chipacayes i saw that code but it didn't click12:29
morphiszyga-ubuntu: ok12:30
pedronisChipaca: here, https://github.com/snapcore/snapd/blob/master/overlord/state/taskrunner.go#L16812:30
sborovkovogra: hello, you said you were doing something about splash screen support so wanted to ask you if you saw this linker error? (I added #define CONFIG_SPLASH_SCREEN to include/configs/rpi.h) /build/snaps/pi3-gadget/u-boot/common/splash.c:94: undefined reference to `bmp_display'12:30
Chipacapedronis: easiest approach is to just document them as retried on stop, then :-)12:30
ograsborovkov, nope, did you set CONFIG_CMD_BMP in your config ?12:31
pedronisChipaca: Stop != Abort basically12:31
pedronisnot sure it makes sense for all potential uses of Exec12:31
pedronisbut that's the current state of things12:32
sborovkovogra: yeah that fixed that error. I did not add that define because wiki page said that by enabling splash screen bmp support would be enabled automatically12:33
ograthe internet is full of lies ;)12:33
Chipacapedronis: agreed on that12:34
Chipacapedronis: wrt naming conventions, you meant about Manager/NewManager vs OddJobManager/Manager, or something more than that?12:34
pedronisyes12:34
pedronisthat sort of stuff12:35
pedronisand oddjob vs oddjobstate12:35
Chipacaah12:35
pedronisand splitting oddjob.go into two12:35
pedronisfiles12:35
Chipacadoes it deserve the "state" ending?12:35
pedroniswell  it makes manager, all the things with one have that name12:36
pedronisand yes everything now has *state/*state.go vs *state/*mgr.go12:37
pedronisafaict12:37
Chipacaok12:41
pedronisChipaca: and *mgr  has manager and handlers (unless and there's a lot and then we have handlers.go)  and *state has things making Tasks/Tasksets and query function helper taking state.State12:43
sborovkovogra: after rebuilding uboot, the only binary I should replace in the gadget snap should be uboot.bin? I see that there is a bunch of other binaries but I am not sure where they are coming from12:44
pstolowskijdstrand, hi! do you have a moment to take a look at https://github.com/snapcore/snapd/pull/3476 ? it's a small change12:44
mupPR snapd#3476: snap-confine: validate SNAP_NAME against security tag <Created by stolowski> <https://github.com/snapcore/snapd/pull/3476>12:44
ograsborovkov, yeah ... i usually do my development on a running install and just replace it on the system-boot partition ...12:45
sborovkovogra: thanks12:45
ograonly uboot.bin should be fine (make sure you have the uboot.ppatch in use though, else it wont find uboot.env)12:46
ppisatiogra: no real reason, we just didn't have any hw to test it13:00
Chipacapedronis: would it be reasonable to have a helper in oddjobstate that did an NewChange and the whole dance?13:00
pedronisChipaca: we don't do that usually13:01
ograppisati, but it wouldnt break any existing stuff to enabled it, would it ?13:02
* ogra is just rebuilding a test deb here with just allwinner SoC turned on in the config 13:02
ogra(i have a banana pro here that i never booted, and orange pi and nano pi ordered ... )13:05
ppisatiogra: are you on a board spree? :)13:10
ppisatiogra: if it's multiplatform, it should be ok13:10
ograppisati, kind of ... i'm waiting for some 96boards to get delivered ... and since that takes so long i boredly start to add other boards :)13:10
ppisatiogra: nonetheless, when you have something that works for you, we'll test on all the supported hw13:11
ogracool13:11
ograi'll let you know13:11
Vamsi_Hi! I am a trying to install ubuntu core on Raspberry pi 3. I am facing an error during the installation in that, it is not accepting my email address. This is the error I am facing13:40
Vamsi_Creating user failed:  error: while creating user: cannot create user "email ID": Get https://login.ubuntu.com/api/v2/keys/emailID: dial tcp: lookup login.ubuntu.com on 10.58.194.16:53: no such host13:41
zyga-fedoraVamsi_: this looks like DNS issue13:41
zyga-fedoraVamsi_: are you using the wifi connection?13:41
Vamsi_nope. I am using a wired internet connection.13:41
Vamsi_zyga-fedora: What could be the possible error? Becuase the error was reported the 1st time after it took a while to contact the server.13:44
zyga-fedorano such host indicates that this is a DNS issue and that login.ubuntu.com is the domain that cannot be resolved13:45
Vamsi_Okay. Please don't mind me asking, but I am what I call as a noob_level developer. So could you please guide me as to how to solve this issue?13:46
zyga-fedoraVamsi_: I don't know, try checking your network13:47
Vamsi_okay. thank you.13:49
ograyeah, sounds like a network issue13:50
mupPR snapd#3480 opened: overlord/oddjobstate: new package for running commands as tasks <Created by chipaca> <https://github.com/snapcore/snapd/pull/3480>13:50
ograVamsi_, the network config worked without any error on the page before ?13:50
Chipacapedronis: ^ PR up13:51
Vamsiogra: yup. No error on page.13:52
ograthats weird ... it should work (surely does for me, i do regular test installs of the pi ... though using the daily edge image)13:53
ograVamsi, is 10.58.194.16 a properly working nameserver in your LAN usually ?13:54
ograseems that is what your board gets as DNS entry (judging by the error message)13:55
Vamsiyup. It is a properly working name server13:57
ograwell, the error looks like it can not resolve "login.ubuntu.com"13:58
ogrado you have another machine that uses this DNS server where you could check if you can reach login.ubuntu.com ?13:58
VamsiYes I have another machine. Although... um... How do I check this?14:00
ograjust try "ping login.ubuntu.com" or if you have a desktop/UI on thereand a browser, go to login.ubuntu.com in there14:00
Vamsitried this on another linux machine and this is what I got:14:01
Vamsi--- login.ubuntu.com ping statistics ---14:02
Vamsi10 packets transmitted, 0 received, 100% packet loss, time 9198ms14:02
ograhmm14:03
* ogra just notices that he cant ping that either ... but a browser works14:03
ograseems the login.ubuntu.com machine simply denies pings ... so a ping wont help as test14:04
ograVamsi, better try: wget http://login.ubuntu.com/14:04
ograthat should download an index.html file14:05
ograand you should see "200 OK" somewhere in the output when you run this14:05
VamsiYup I see 200 OK.14:06
ograok, then it isnt the DNS server14:10
ograhmm14:10
VamsiOkay! I realised the mistake I was doing.14:12
ograVamsi, oh, wait, did you literally type "emailID" into the user field in the setup screen ?14:12
* ogra just noticed the url :)14:12
VamsiI was using a different network for my notebook as compared to the one for the raspbery pi14:14
ograah14:15
VamsiThe network I was using for the raspberry pi was one with a number of restrictions.14:15
ograyeah14:15
Vamsiogra: After you suggested the wget http://login.ubuntu.com/ i noticed that the address was different and that's when I realised that I was using a different network.14:17
ogra:)14:17
VamsiThanks mate!14:18
* ogra crosses fingers that it works with the new network14:18
jdstrandpstolowski: yes14:18
=== chihchun is now known as chihchun_afk
mupPR snapd#3481 opened: tests: add avahi-observe interface test <Created by fgimenez> <https://github.com/snapcore/snapd/pull/3481>14:29
Vamsiogra: Okay. Now I am stuck at another place. The installation is now stuck in the page that lists all the host key fingerprints14:30
ograVamsi, that isnt stuck, it means you are finished ... there should be an ssh command in the output that you can use to connect to your board14:32
Vamsioh okay. Thanks. I actually did connect to my board now. I was expecting to automatically to restart or omething.14:34
VamsiThanks :)14:34
ograenjoy :)14:34
mupPR snapd#3482 opened: asserts: support timestamp and optional disabled header on repair <Created by pedronis> <https://github.com/snapcore/snapd/pull/3482>14:43
pedronismvo: Chipaca: ^14:43
mvopedronis: thanks14:43
mvopedronis: I check it in a wee bit, still wrestling with seccomp and snap-confine :/14:43
pedronisChipaca: will we still need snapd#3462 ?14:45
mupPR snapd#3462: systemd: refactor service ops to also be exposed more directly <Created by chipaca> <https://github.com/snapcore/snapd/pull/3462>14:45
=== koza is now known as koza|away
mupPR snapd#3462 closed: systemd: refactor service ops to also be exposed more directly <Created by chipaca> <Closed by chipaca> <https://github.com/snapcore/snapd/pull/3462>14:54
Chipacapedronis: maybe not, but I might pull some of the commits into a new pr instead14:54
pedronisok14:54
Chipacahurra for being more careful with my commits \o/14:55
sborovkovogra: how do you even get into autoboot console on the rpi? at least for me even though it says press any key to cancel autoboot it just goes on with booting no matter what I am pressing on my keyboard15:00
ograsborovkov, is it actually counting down ?15:00
ogramight be we did set bootdelay=0 because it causes issues with addon boards15:01
sborovkovogra: i even tried increasing it to 15 seconds... but nothing happens15:01
ograso you would need to set bootdelay to something higher ... on the running pi you can use "fw_printenv/fw_setenv"15:01
ograhmm15:02
* ogra has no pi wired up atm ... 15:02
ograhttps://github.com/snapcore/pi3-gadget/blob/master/prebuilt/uboot.env.in says we default to bootdelay=2 though15:02
ograsborovkov, and you are sure your serial is wired up correctly ?15:03
sborovkovogra: I set it to 15 in the boot settings :-) Ok I guess something wrong with my setup15:04
ogracheck if you accidentially flipped TX and GND wires15:04
mupPR snapd#2592 closed: many: add support for session dbus services via snaps <Created by mvo5> <Closed by mvo5> <https://github.com/snapcore/snapd/pull/2592>15:13
morphiszyga-fedora, zyga-ubuntu, mvo: can you guys review and approve https://github.com/snapcore/snapd/pull/3479 ?15:14
mupPR snapd#3479: tests: mark interfaces-openvswitch as manual due to prepare errors <Created by fgimenez> <https://github.com/snapcore/snapd/pull/3479>15:14
zyga-fedoralooking15:14
zyga-fedoramerged15:14
mupPR snapd#3479 closed: tests: mark interfaces-openvswitch as manual due to prepare errors <Created by fgimenez> <Merged by zyga> <https://github.com/snapcore/snapd/pull/3479>15:15
mupPR snapd#3460 closed: ifacestate: only re-generate all security profiles if the system-key changes <Created by mvo5> <Closed by mvo5> <https://github.com/snapcore/snapd/pull/3460>15:16
mupPR snapd#3468 closed: debian: add missing  Type=notify in 14.04 packaging <Created by mvo5> <Merged by mvo5> <https://github.com/snapcore/snapd/pull/3468>15:17
mupPR snapd#3469 closed: many: add "release.BuildStamp" to identify the current build <Created by mvo5> <Closed by mvo5> <https://github.com/snapcore/snapd/pull/3469>15:17
mupPR snapd#3471 closed: snap: make `snap run` look at the system-key for security profiles <Created by mvo5> <Closed by mvo5> <https://github.com/snapcore/snapd/pull/3471>15:17
pedronisChipaca: do we need timeout support for those Exec tasks, like we have for hooks ?15:18
Chipacahmmm15:18
Chipacapedronis: I don't think we do right now15:18
pedronisChipaca: ok, I'll do the actual full reviewing tomorrow16:00
Chipacapedronis: no worries16:00
Chipacapedronis: try to get some sleep16:00
mupPR snapcraft#1183 closed: First step; ruby support <Created by justincan> <Closed by kyrofa> <https://github.com/snapcore/snapcraft/pull/1183>16:51
Chipacazyga, out of the blue (no core refresh) 'snap try' stopped working again16:53
Chipacaand snap install16:53
Chipaca(cannot setup mount for snap "core": cannot update mount namespace of snap "core": cannot update preserved namespace of snap "core": cannot update snap namespace: not implemented) followed by (cannot update mount namespace of snap "core": cannot update preserved namespace of snap "core": cannot update snap namespace: not implemented)16:54
Chipacazyga-fedora: zyga-ubuntu ^16:54
Chipacahow did i fix this?16:54
kyrofaHaha, no suse today eh?16:54
* Chipaca purges snapd and starts over16:58
Chipacagah, that didn't work17:00
bdxkyrofa, elopio: I have a strawman here https://gist.github.com/jamesbeedy/3a8b4de1d3f38be4e551ef028df0ba9c17:06
bdxhow can I test this?17:06
bdxkyrofa, elopio: any insight there would be appreciated17:07
bdxI'm thinking I need to use the cmake plugin though17:08
kyrofabdx, have you tried using it just as a local plugin?17:11
bdxwhat would my snapcraft.yaml need to look like to do that?17:11
bdxI would have a ruby part, with `plugin: x_ruby` ?17:12
kyrofabdx, take this plugin and put it in snap/plugins/x-ruby.py17:12
kyrofabdx, then in snap/snapcraft.yaml, you can use it like `plugin: ruby`17:13
bdxgot it ... not `plugin: x_ruby`?17:13
bdxor `x-ruby`17:13
bdxahh, ok, x_ruby17:15
kyrofaNo, snapcraft has (flawed, IMO) logic to look for x-ruby.py if you just use "ruby"17:17
mupPR snapcraft#1258 closed: python-plugin: support pip list columns mode <Created by sdeancos> <Closed by kyrofa> <https://github.com/snapcore/snapcraft/pull/1258>17:27
bdxkyrofa: here is what I'm experiencing http://paste.ubuntu.com/24858016/17:37
kyrofabdx, what did you name your plugin file?17:39
kyrofax_ruby.py or x-ruby.py?17:39
bdxx_ruby.py17:40
kyrofaUse a hyphen17:40
kyrofaTake heed of that warning, though-- refer to the cmake plugin (or another in-tree plugin) for a more up-to-date __init__17:40
bdxoohok17:41
bdxthx17:41
mupPR snapd#3483 opened: tests: dependency packages installed during project prepare <Created by sergiocazzolato> <https://github.com/snapcore/snapd/pull/3483>17:46
bdxhttps://github.com/snapcore/snapcraft/blob/master/docs/plugins.md#initializing-a-plugin18:10
bdx"DEPRECATED: the plugin used by part 'ruby' needs to be updated to accept project options in its initializer. See https://github.com/snapcore/snapcraft/blob/master/docs/plugins.md#initializing-a-plugin for more information"18:10
bdxthat link doesn't seem to exist :(18:10
bdxI can't create a issue on snapcore/snapcraft for this either18:12
bdxthere is no issues tab18:13
* zyga-fedora is mentally drained and takes a break/walk18:16
kyrofabdx, whoope18:39
kyrofabdx, bugs at https://bugs.launchpad.net/snapcraft, please18:40
kyrofaThat's definitely one18:40
kyrofabdx, but just copy the __init__ declaration from cmake, or another plugin in snapcraft18:41
kyrofa(you're just missing a parameter there)18:41
bdxkyrofa: ok, done18:43
bdxkyrofa: so I backed of a bit18:44
bdxhttp://paste.ubuntu.com/24858444/18:44
bdxthe issue I seem to be hitting ... http://paste.ubuntu.com/24858448/18:45
bdxapt  needs an update before the build_packages install18:46
kyrofabdx, you mean if you run `apt update` before this that works?18:46
bdxkyrofa: well trying these commands in a fresh lxd18:47
kyrofabdx, no, it's libxslt1-dev18:47
kyrofabdx, but is that just for building ruby?18:48
bdxkyrofa: yeah ... if I launch a fresh instance, and try to `apt install libxslt1-dev`, it fails18:48
bdxkyrofa: if I `apt update`, `apt install libxslt1-dev` succeeds18:48
kyrofabdx, yes that makes sense. But snapcraft runs apt update, you're just using the wrong name there18:48
bdxoh my -18:49
bdxthanks18:49
bdxthat got me going18:50
bdxthanks for bearing with me18:50
kyrofabdx, you're doing awesome man, no bearing needed18:50
kyrofabdx, where are you getting that list of deps for ruby, out of curiosity? That's quite a bit more than I typically use18:52
bdxkyrofa: https://github.com/battlemidget/juju-layer-ruby/blob/master/lib/rubylib.py#L51,L5418:52
kyrofaAre you sure they're all required?18:54
bdxkyrofa: I just now tried spinning up a lxd and pulled down a ruby tar18:55
kyrofaRuby builds with just gcc g++ make libz-dev libssl-dev libreadline-dev, I think18:55
bdxoh reall18:55
bdxlet me give that a try18:55
kyrofaYou might be missing features that way though, but we should know for sure18:56
kyrofa(when I deploy my rails projects, that's what I use to build ruby)18:56
bdxkyrofa: that is all that was needed19:03
bdxI'll swap those deps out19:03
kyrofaNice. A little lighter19:03
bdxkyrofa: now I'm getting http://paste.ubuntu.com/24858731/19:23
kyrofabdx, ah, try zlib1g-dev19:27
bdxlibz-dev jus installed for me on a fresh lxd though ... grrr19:28
kyrofaVirtual packages...19:28
bdxlol ... whatever that means19:28
kyrofaelopio, that's ringing a bell for me. Is there a reason those don't work?19:28
kyrofaI remember hearing you talk about that19:28
kyrofabdx, yeah, I think this is a bug19:29
bdxkyrofa: where can I find the issue tracker for snapcraft?19:31
kyrofabdx, https://bugs.launchpad.net/snapcraft19:31
bdxahh nice, thx19:31
kyrofabdx, yeah: https://bugs.launchpad.net/snapcraft/+bug/166066619:32
mupBug #1660666: build-packages fails on pure virtual packages <Snapcraft:Confirmed> <https://launchpad.net/bugs/1660666>19:32
bdxahh nice19:32
bdxwell, nice thats its being tracked already19:32
kyrofaKnew it sounded familiar19:32
elopiobdx: can you install the snapcraft snap from the edge channel?19:34
bdxkyrofa: what is this telling me http://paste.ubuntu.com/24858783/?19:34
bdxdo I need to pass some init values to the call to super or something19:34
bdxyeah19:34
kyrofabdx, that you need a better definition of __init__. Refer to any other plugin snapcraft19:35
kyrofaplugin in, rather19:35
bdxhttps://github.com/snapcore/snapcraft/blob/master/snapcraft/plugins/make.py#L9519:36
kyrofaHuh... yeah wait19:36
bdxI grabbed it exactly as it is there19:36
bdxif I comment out pull() I don't get the error19:37
bdxooh19:37
bdxscratch that19:37
bdxhttp://paste.ubuntu.com/24858822/19:37
bdx^ that will build19:38
kyrofaWut19:38
kyrofaYeah something is busted here... let me poke at it19:39
bdxhttp://paste.ubuntu.com/24858839/ - uncommenting either of the declarations in init will cause that error to surface19:41
kyrofaI wonder if the importing is breaking things19:44
bdxooh, my bad19:48
bdxuncommenting         self._ruby_dir = join(self.partdir, 'ruby')19:48
bdxworks19:48
bdxits only the self._ruby_tar that breaks it19:49
bdxooh, possibly I'm missing an arg to Tar()19:49
bdxI am19:49
bdxgeeeeh!19:50
kyrofaOh jeez, I just find that too19:51
kyrofaThe deprecation warning is a little trigger happy, and masks the real issue19:51
kyrofaYou're just missing source_dir19:52
kyrofaI say log another bug19:52
kyrofa:P19:52
kyrofaYou're on a roll today!19:53
bdxonce `snapcraft` succeeds, I end up with a ruby-test_0.1_amd64.snap file19:56
bdxI install the snap with `sudo snap install --devmode ruby-test_0.1_amd64.snap`19:56
bdxhow can I introspect the snap now that it is installed?19:57
kyrofabdx, well first of all, none of the plugins I've seen so far from you actually builds ruby19:57
kyrofaRight?19:57
bdxkyrofa: correct, I'm just trying to poke around to make sure what I've done so far produces the expected results19:58
kyrofabdx, the short answer is: look in the prime/ dir, that represents what goes into the final snap19:58
kyrofaSounds good19:58
kyrofaOnce the prime step ends, all the snap step does is mksquashfs prime19:59
bdxahh19:59
bdxkyrofa: alright, I'm going to take a shot at the pull and build steps20:09
bdxkyrofa: this seems to be building successfully https://gist.github.com/jamesbeedy/3a8b4de1d3f38be4e551ef028df0ba9c20:19
bdxkyrofa: should I use a chdir context manager to chdir into the directory created from untaring the ruby tar, and run the `./configure`, `make`, `make install` commands?20:20
kyrofabdx, no, snapcraft gives you a few tools you can use20:22
kyrofaLet me find you an example20:22
kyrofabdx, yeah, check out the nodejs plugin20:23
kyrofabdx, you'll see `self.run([...] cwd=blah)`20:23
bdxkyrofa: so I need to define the dir rootdir/<extracted ruby dir> to use with the run() function then right20:40
kyrofaYou got it20:40
bdx`install_dir = join(installdir, "ruby-{version}".format(version=self.options.ruby_version)20:43
bdxself.run(['./configure'], cwd=install_dir)20:43
bdx`20:43
bdxlike that?20:44
kyrofaAssuming the ruby tarball is unpacked into install_dir, yeah (more like a build_dir in my mind)20:44
bdxyeah, totally ... so the tar gets unpacked into `join(self.partdir, 'ruby')`20:45
bdxso I would want that dir20:45
bdxok20:45
bdxgot it20:45
mupPR snapcraft#1342 closed: nodejs: run install and commands in source-subdir <Created by Saviq> <Closed by kyrofa> <https://github.com/snapcore/snapcraft/pull/1342>20:51
bdxkyrofa: I think I'm on the right track here, mind having another look https://gist.github.com/jamesbeedy/3a8b4de1d3f38be4e551ef028df0ba9c20:55
kyrofabdx, yeah that's getting there, although I suggest always using lists for `self.run()` (you're mixing lists with strings)20:58
bdxahh, gotcha, fixed now https://gist.github.com/jamesbeedy/3a8b4de1d3f38be4e551ef028df0ba9c20:59
kyrofaYes, much better21:00
bdxso next I need to symlink the binary? something similar to this https://github.com/snapcore/snapcraft/blob/master/snapcraft/plugins/make.py#L112,L117 ?21:00
kyrofaRight, this will build ruby, but as it is right now it'll install it _on the host_ instead of into the snap21:01
kyrofa(and fail unless you're using sudo, of course)21:01
kyrofaSo you'll want to either install it with DESTDIR, or configure a prefix. I'd try destdir first21:01
bdxkyrofa: I'm having a hard time connecting the dots on how that is done21:05
kyrofabdx, you want ruby to end up in `self.installdir`21:05
bdxoh I do?21:05
bdxok21:05
kyrofabdx, yeah let's back up a bit. Do you have much experience using snapcraft?21:06
kyrofaI want to fill some of the holes for you, just need to know where to start21:06
bdxkyrofa: outside of following the tutorials, no21:06
bdxnone21:07
kyrofabdx, so you probably know that every part in snapcraft goes through a lifecycle of steps21:07
bdxyes21:07
kyrofapull -> build -> stage -> prime21:07
kyrofaThen once all the parts go through that lifecycle, the "snap" step runs21:07
bdx10-421:08
kyrofaThe plugins are responsible for the first two steps: pull and build21:08
bdxok21:08
kyrofaEverything else is part of snapcraft core21:08
bdxok21:08
kyrofaThere's a very simple agreement between plugins and snapcraft to do the handoff between build and stage21:09
kyrofaThat is: anything in parts/<partname>/install will end up in stage21:09
bdxok, and the stage gets mounted?21:09
bdxor stage is the last step executed before snap21:10
kyrofaNope. The stage step takes everything in every part's install dir and combines them into a single stage/ dir21:10
bdxok21:10
kyrofaSometimes you'll run into conflicts when that happens if multiple parts provide the same file, etc.21:10
bdxgot it21:10
kyrofaOnce stage has happened, the prime step takes stuff from each part's installdir AGAIN and combines it into the prime dir21:11
kyrofaOnce that has happened for all parts, the snap step runs mksquashfs on the prime dir and you're done21:11
kyrofaSo, bringing this full circle: ruby needs to end up in the part's installdir, or it won't end up in the snap21:11
bdxhttps://gist.github.com/jamesbeedy/3a8b4de1d3f38be4e551ef028df0ba9c#file-ruby-x-py-L3221:12
kyrofaThe plugin knows where the installdir is via `self.installdir`21:12
bdxneeds to be `self._ruby_dir = join(self.installdir, 'ruby')21:12
kyrofaNo, because then all the ruby SOURCE will end up in the snap-- you don't want that either21:12
kyrofaYou're fetching/unpacking/building ruby off to the side, I like that21:13
kyrofaBut you need to INSTALL it into the installdir21:13
bdxahh21:13
bdxnot the same dir where I built it21:13
kyrofaTake a look at the make plugin, how it uses DESTDIR21:13
kyrofaIndeed21:13
bdxotherwise it would just get discarded too21:13
bdxok21:13
kyrofaThat wouldn't happen anyway: by default ruby will install onto the system21:13
bdxyeah so I'm really confused about that lol21:13
bdx        self._ruby_dir = join(self.partdir, 'ruby')21:13
bdxoops21:14
bdxhttps://github.com/snapcore/snapcraft/blob/master/snapcraft/plugins/make.py#L72,L7421:14
kyrofaOh yeah.. not the simplest example. The cmake plugin then!21:14
kyrofa:P21:14
bdxso, self.sourcedir in cmake then?21:16
bdxhttps://github.com/snapcore/snapcraft/blob/master/snapcraft/plugins/cmake.py#L7321:17
kyrofaself.sourcedir is where the project your plugin will be building will be fetched21:17
bdxI need something similar to the _build_environment() then?21:17
kyrofaOh darn, no, cmake inherits from make, so still confusing21:17
bdxyeah...21:18
kyrofaScratch that plan. So by default, when you run ./configure, it prepares itself to install into /usr/bin, or /usr/local/bin, etc.21:18
* bdx sobs uncontrollably 21:19
kyrofa:P21:19
bdxtotally21:19
kyrofaIf you want it elsewhere, you have two options: either ./configure --prefix=elsewhere, and then `make install` puts it elsewhere21:19
kyrofaOr ./configure like normal, and when running `make install` actually run `make install DESTDIR=elsewhere`21:19
kyrofaI suggest trying the latter option first21:20
bdxyea, ok21:20
kyrofaWhere "elsewhere" is self.installdir21:20
bdxok, yeah this makes sense21:20
kyrofaSo now we're fetching and building ruby in a disposable place, but installing it into the snap so we can use it at build AND runtime21:21
bdxyes, I see that now21:21
bdxkyrofa: I've implemented those bits here https://gist.github.com/jamesbeedy/3a8b4de1d3f38be4e551ef028df0ba9c21:26
kyrofaYeah give that a shot, see if ruby ends up in prime21:26
kyrofaOh wait21:27
kyrofaI suggest moving -j arg to the `make`, `make install` probably doesn't need it21:27
kyrofaIt'll be slow21:27
bdxentirely21:27
bdxkyrofa: great progress21:40
bdxkyrofa: here is `$ snapcraft` <- http://paste.ubuntu.com/, here is what my directory tree looks like http://paste.ubuntu.com/24859583/21:42
bdxhttps://gist.github.com/jamesbeedy/3a8b4de1d3f38be4e551ef028df0ba9c21:46
bdxI'm not seeing the ruby binary anywhere21:46
kyrofabdx, testing...21:49
kyrofabdx, the DESTDIR line needs to be a `make install`21:53
bdxooho whooops21:54
kyrofaThat'll fix things. Although it looks like it uses usr/local. I suggest trying prefix=/ in the configure step to see if things end up in bin21:59
bdxyeah22:08
bdxkyrofa: https://gist.github.com/jamesbeedy/3a8b4de1d3f38be4e551ef028df0ba9c - getting close22:16
kyrofaLooking good!22:16
bdxhttp://paste.ubuntu.com/24860014/22:17
kyrofaIs that prime/bin/ ?22:17
bdxyea22:17
kyrofaNice, now for the challenging part: gems22:18
bdxkyrofa: after I run `sudo snap install --devmode ruby-test_0.1_amd64.snap`22:21
bdxshouldn't my new ruby bin from the snap show up when I run `whereis ruby`22:21
kyrofabdx, no, you need to declare it as an app if you want to just be able to run ruby out of it22:22
kyrofaIt won't work anyway though, as the environment isn't setup for it22:22
bdxkyrofa: I see, ok22:22
bdxkyrofa: I just want to make use of that ruby bin from within a snap22:23
bdxso I don't need to expose it as an app22:23
bdxthat is the idea I take it22:24
kyrofaIndeed: the goal of this plugin is not to package RUBY as a snap, but a ruby APPLICATION22:25
bdxI should make another function to call after _ruby_install() in the build step then?22:28
bdxpossibly `_gem_install()' and `_bundler_install()`?22:29
kyrofaExactly what I was thinking22:29
kyrofaStart with gems, just a list22:29
bdxI want bundler installed by default22:30
bdxshould I hard code that?22:30
kyrofaYou only need bundler if there's a Gamefile, right?22:30
bdxyeah22:30
kyrofaWow, sorry, getting tired22:30
kyrofaGemfile22:30
bdxyeah22:30
kyrofaSo yes, but bundler will be a little harder than just gems22:30
bdxso check for that first, if exists then use the _gem_install() helper22:30
bdxto install bundler22:31
bdxthen call `bundle install`22:31
kyrofaWell, I see two classes of people who might want to use this plugin. Those who have a quick Ruby script and no Gemfile, but knows they need gems, and larger projects that have an established Gemfile22:31
kyrofaI think it'd be pretty easy to support both, don't you think?22:31
bdxyeah22:31
kyrofaSo I'd start by adding a new option to the schema called "gems" that accepts a list of gem names, and then use your compiled ruby to install them22:32
bdxok22:32
kyrofaAfter we get that working, we can move to bundler22:32
kyrofaYou're going to need an env() function, by the way. Make sure you define at least RUBYLIB, GEM_HOME, and GEM_PATH22:33
bdxok22:34
bdxsomething along the lines of https://github.com/snapcore/snapcraft/blob/master/snapcraft/plugins/cmake.py#L8422:35
kyrofabdx, no, that's build-time only, you'll want it at runtime as well. Something like this: https://github.com/snapcore/snapcraft/blob/master/snapcraft/plugins/catkin.py#L20622:36
kyrofaBut not as complicated22:36
kyrofaThat function is part of the plugin API22:37
kyrofaJust return a list of environment variable definitions22:37
kyrofabdx, I'm sorry to desert you, but I've got to run for the day. I'll be back tomorrow, though :)22:37
bdxnp22:38
kyrofaGood work!22:38
bdxthank you for all your help today22:38
kyrofaAny time22:39

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