[09:57] PR snapd#4299 opened: osutil/user: replace our uses of os/user and filepath.Glob("/home/*") [09:57] john, it's Saturday! [09:58] says the one who noticed ;-) [09:59] well [09:59] haha, isn't it a bit early for you too? :) [10:55] [10:55] [10:56] [10:56] [10:56] [10:56] [10:56] [13:40] Hi. I'm creating a snap that includes some man pages but I can't find any documentation how to enables the man pages in snapcraft.yaml? [13:40] enable* [13:43] lundmar: that is not supported yet [13:46] darn :/ [13:46] as a poor man's workaround embed man and your manual pages as a "man" command in your snap [13:46] it's not perfect, we will get to properly integrated man pages, it's just not on the immediate roadmap [13:47] the man package is quite an unwnanted dependency sizewise :) [13:47] lundmar: how big is "/usr/bin/man" itself? [13:47] but sure, I get it [13:48] just letting you know [13:50] well, I assume the binary itself is not big but it comes with other files/dependencies I guess I would have to swing my rake at. [13:51] also, your man command would override the systems man command which I think would be unfortunate and maybe cause other issues. [13:53] supporting man pages via a snapcraft plug interface would be really useful. This is kind of the last step to get to first class support for commandline tools. [13:54] how about support for completion scripts? I reported it as an issue long ago and it seems it has been fixed since snap v2.28 but I just tested and it does not automatically pick up on the completion scripts. Do I need to add anything to snapcraft.yaml? [14:01] zyga-ubuntu: Can snaps update a users environment variables? In other words, can I create a snap that adds my man page path to the users MANPATH variable? [14:01] or is it fully isolated so that can't be done [14:05] lundmar: no, that would be extremely dangerous in genral [14:06] lundmar: we have a plan on how manual pages can be integrated [14:06] lundmar: but it's not something that will happen overnight [14:06] lundmar: there's confinement coming to man itself, so that it can process untrusted input [14:06] lundmar: and there's a plan to pre-process the manual pages from snaps before they are exported to unconfined world [14:06] lundmar: but both are still unscheduled (I think the man work is upstream) [14:07] I'm going AFK, if you leave me messages I'll check them out late r:) [14:07] ok thanks for the info. Glad to know a solution is on its way. [14:07] Now, I need to figure out how this completion support works [14:11] My snap package 'tio' (a serial TYY too) is running in to all the hard snapcraft issues. First it could not access serial ports (fixed now by serial-port plug), then no completion script feature, and now the man page feature he he [14:11] tool* [14:12] If anyone can provide me an example snapcraft.yaml on how to enable autocompletion scripts that would be helpful. thanks. [14:14] lundmar: there are some in snapcraft and snapd source code [14:15] lundmar: you need a complete: or something similar key [14:15] lundmar: grep for that in tests/ in snapd tree [14:15] lundmar: there are examples in snapcraft that are more educational but I'm on the snapd side [14:17] zyga-ubuntu: yeah, I finally found that via google. I'm looking at it now. thanks. [14:19] I found it referenced by this guy: http://chipaca.com/post/160369439977/in-snap-tab-completion [14:50] hmm, it seems to use the new "completer:" key I have to make a copy of my completion script and put it in some "prime" directory to make it succesfully build my snap. Seems a bit silly to make a copy when it actually gets installed. Is there a way I can reference the installed script instead? [15:04] lundmar: yeah, chipaca implemeted it all :) [15:04] lundmar: probably, I don't know [15:05] hehe, the prime directory gets cleaned out by snapcraft clean so that is definitely not the place to put it [15:06] I'm not liking all the temp directories that snapcraft creates. You guys should consider putting all of them in a single top "build" directory [15:18] Also, it seems odd to me that snapcraft init create snap/snapcraft.yaml. I think it would be better if it simply creates snapcraft.yaml in the current directory or a directory specified by the user, for example: snapcraft init tio would create tio/snapcraft.yaml [15:19] it gets even worse when you then start adding stuff like snap/snap/gui/icon.png [15:20] I'm missing structure guys :) [15:33] lundmar: snapcraft needs to know the root directory [15:33] lundmar: and snapcraft integration needs to be automatic (for build systems) [15:33] lundmar: so we pick either top-level/snapcraft.yaml or snap/snapcraft.yaml [15:33] lundmar: for simplicity and consistency [15:34] lundmar: as for the swarm of helper directories, yes, I agree and I _think_ this is something that's under control now, I'm just not sure how (again, mostly working under the hood in snapd) [15:34] lundmar: kyrofa, sergiusens or kalikiana can help you [15:36] lundmar: the preferred location these days is snap/snapcraft.yaml for the reason you mentioned, things like gui/icon.png also go in there and you don't need to scatter them all over your source tree [15:37] * zyga-ubuntu makes some tea and returns to debugging snapd integration tets [15:37] *tests [15:37] lundmar: regarding prime: you don't have to copy anything in there, it gets created during the build, so you can just reference in the yaml [15:37] I guess my point os to make snapcraft init work more like git init which is a bit more intuitive. [15:38] is* [15:38] lundmar: more intuitive in what respect? [15:38] kalikiana: mkdir tio; cd tio; snapcraft init [15:39] kalikiana: or simply snapcraft init tio; cd tio [15:39] ah [15:39] never noticed that [15:39] but you're right [15:39] currently: snapcraft init; mv snap tio; cd tio [15:39] its a bit messy imho [15:40] I guess I don't have a strong preference personally for that sort of detail [15:40] I'm sorry, I'm a stickler for details :) [15:40] lundmar: maybe I don't understand your point fully but I always thought about snapcraft init as creating the debian/ directory [15:40] packaging stays "there" [15:41] Imagine you start out by creating multiple snaps with different names, you will see my point ;) [15:41] lundmar: I don't get it, can you explain please? [15:41] mkdir foo; cd foo ; snapcraft init; # repeat for bar, etc [15:41] is that what you mean? [15:42] or even simpler: snapcraft init tio; snapcraft init firefox; snapcraft init nano [15:43] * zyga-ubuntu tries [15:43] currently: snapcraft init; mv snap tio; snapcraft init firefox; mv snap firefox; snapcraft init; mv snap nano [15:44] the way I suggest is more flexible with fewer commands [15:44] lundmar: snapcraft init tio doesn't work on 2.34 for me [15:44] (probably out of date) [15:44] zyga-ubuntu: thats exactly my point ;) [15:44] it is not supported [15:45] I see your point then :) [15:45] hehe [15:45] kalikiana: is that something that fits your design? [15:46] if one is a git user the current way snapcraft init works catches your eye immediately :) [15:47] well, I'm a git user but I rarely git init [15:47] but I see your point [15:49] I'm a big fan of structure so I would love it snapcraft worked something like this example: snapcraft init tio; cd tio; snapcraft; snapcraft build (the latter creates a build directory containing all the temp build dirs: stage, prime, parts, etc.) [15:49] if* [15:49] lundmar: I'd suggest you propose it in the forum (https://forum.snapcraft.io/) and we can see what other people think [15:50] kalikiana: i'll do that [15:51] hmm, can't I use my Ubuntu one SSO credentials to login to that forum? [15:52] no, it's long overdue [15:52] sorry [15:52] ok, it seems I can't [15:52] oh well, I'll create yet another account hehe [15:54] kalikiana: on another note, do you know where I should put the completion script file referenced by the new "completer:" key? [15:55] because I can't seem to find the right place, nor in any examples. [15:55] there is an example here: https://github.com/snapcore/snapd/blob/master/tests/lib/snaps/test-snapd-complexion/meta/snap.yaml [15:56] but it does not work for me [15:56] lundmar: use `stage:\n - my-script-name` where the script is relative to the source of the part [15:56] ahh, thanks [15:57] meta is assembled by snapcraft for you, so I'd recommend you consider it an implementation detail [16:00] kalikiana: would you happen to have an example anywhre using stage: ? [16:00] none of the snapd tests uses it [16:00] lundmar: snapcraft itself uses it [16:02] * lundmar is grepping snapd and snapcraft gits [16:03] no matches :/ [16:03] lundmar: https://github.com/snapcore/snapcraft/blob/master/snap/snapcraft.yaml#L26 [16:09] does the apps completer key reference a part? [16:09] so I have to create a part which include stage: to my completion script file [16:14] yes [16:24] hmm, there must be a way to avaoid creating two staging areas. I mean, my snap is already staging all my source files including my autocompletion script. I just need to find a way to reference what is already created [16:24] I tried this but it fails : https://gist.github.com/lundmar/ce6e3a654f9df61fb92f27e2c47c6682 [16:26] I really want to avoid extracting the completion script from my .tar.xz and putting it somewhere else for snap to use. It would be redundanct [16:26] redundant* [16:35] lundmar: where's the file located? you should be able to use the part relative to the part's extracted source [16:35] the *script [16:37] kalikiana: it's parts/tio/build/src/bash-completion/tio [16:37] no, sorry, I meant parts/tio/install/share/bash-completion/completions/tio [16:38] I assume parts/tio is the staging area [16:42] hold on, I'll try it here [16:43] lundmar: remove the leading "install" from the completer path [16:48] kalikiana: darn, I almost had it right then hehe. Thanks! [16:49] I guess I'm one of the first actually using this new completion feature [17:00] kalikiana: https://forum.snapcraft.io/t/suggestion-lets-improve-snapcraft-init-command [17:11] Awesome. Thanks for starting the conversion [17:15] no problem, I have another incoming regarding consolidating the temporory build directories [17:15] temporary* [17:25] Any update on theme issue? [17:41] kalikiana: https://forum.snapcraft.io/t/suggestion-lets-consolidated-temporary-build-directories-under-one-directory-build