mup | PR snapd#4299 opened: osutil/user: replace our uses of os/user and filepath.Glob("/home/*") <Created by chipaca> <https://github.com/snapcore/snapd/pull/4299> | 09:57 |
---|---|---|
zyga-ubuntu | john, it's Saturday! | 09:57 |
sergiusens | says the one who noticed ;-) | 09:58 |
zyga-ubuntu | well | 09:59 |
zyga-ubuntu | haha, isn't it a bit early for you too? :) | 09:59 |
zyga-ubuntu | 10:55 | |
zyga-ubuntu | 10:55 | |
zyga-ubuntu | 10:56 | |
zyga-ubuntu | 10:56 | |
zyga-ubuntu | 10:56 | |
zyga-ubuntu | 10:56 | |
zyga-ubuntu | 10:56 | |
lundmar | 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 |
lundmar | enable* | 13:40 |
zyga-ubuntu | lundmar: that is not supported yet | 13:43 |
lundmar | darn :/ | 13:46 |
zyga-ubuntu | as a poor man's workaround embed man and your manual pages as a "man" command in your snap | 13:46 |
zyga-ubuntu | it's not perfect, we will get to properly integrated man pages, it's just not on the immediate roadmap | 13:46 |
lundmar | the man package is quite an unwnanted dependency sizewise :) | 13:47 |
zyga-ubuntu | lundmar: how big is "/usr/bin/man" itself? | 13:47 |
zyga-ubuntu | but sure, I get it | 13:47 |
zyga-ubuntu | just letting you know | 13:48 |
lundmar | 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:50 |
lundmar | also, your man command would override the systems man command which I think would be unfortunate and maybe cause other issues. | 13:51 |
lundmar | 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:53 |
lundmar | 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? | 13:54 |
lundmar | 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 |
lundmar | or is it fully isolated so that can't be done | 14:01 |
zyga-ubuntu | lundmar: no, that would be extremely dangerous in genral | 14:05 |
zyga-ubuntu | lundmar: we have a plan on how manual pages can be integrated | 14:06 |
zyga-ubuntu | lundmar: but it's not something that will happen overnight | 14:06 |
zyga-ubuntu | lundmar: there's confinement coming to man itself, so that it can process untrusted input | 14:06 |
zyga-ubuntu | lundmar: and there's a plan to pre-process the manual pages from snaps before they are exported to unconfined world | 14:06 |
zyga-ubuntu | lundmar: but both are still unscheduled (I think the man work is upstream) | 14:06 |
zyga-ubuntu | I'm going AFK, if you leave me messages I'll check them out late r:) | 14:07 |
lundmar | ok thanks for the info. Glad to know a solution is on its way. | 14:07 |
lundmar | Now, I need to figure out how this completion support works | 14:07 |
lundmar | 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 |
lundmar | tool* | 14:11 |
lundmar | If anyone can provide me an example snapcraft.yaml on how to enable autocompletion scripts that would be helpful. thanks. | 14:12 |
zyga-ubuntu | lundmar: there are some in snapcraft and snapd source code | 14:14 |
zyga-ubuntu | lundmar: you need a complete: or something similar key | 14:15 |
zyga-ubuntu | lundmar: grep for that in tests/ in snapd tree | 14:15 |
zyga-ubuntu | lundmar: there are examples in snapcraft that are more educational but I'm on the snapd side | 14:15 |
lundmar | zyga-ubuntu: yeah, I finally found that via google. I'm looking at it now. thanks. | 14:17 |
lundmar | I found it referenced by this guy: http://chipaca.com/post/160369439977/in-snap-tab-completion | 14:19 |
lundmar | 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? | 14:50 |
zyga-ubuntu | lundmar: yeah, chipaca implemeted it all :) | 15:04 |
zyga-ubuntu | lundmar: probably, I don't know | 15:04 |
lundmar | hehe, the prime directory gets cleaned out by snapcraft clean so that is definitely not the place to put it | 15:05 |
lundmar | 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:06 |
lundmar | 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:18 |
lundmar | it gets even worse when you then start adding stuff like snap/snap/gui/icon.png | 15:19 |
lundmar | I'm missing structure guys :) | 15:20 |
zyga-ubuntu | lundmar: snapcraft needs to know the root directory | 15:33 |
zyga-ubuntu | lundmar: and snapcraft integration needs to be automatic (for build systems) | 15:33 |
zyga-ubuntu | lundmar: so we pick either top-level/snapcraft.yaml or snap/snapcraft.yaml | 15:33 |
zyga-ubuntu | lundmar: for simplicity and consistency | 15:33 |
zyga-ubuntu | 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 |
zyga-ubuntu | lundmar: kyrofa, sergiusens or kalikiana can help you | 15:34 |
kalikiana | 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:36 |
* zyga-ubuntu makes some tea and returns to debugging snapd integration tets | 15:37 | |
zyga-ubuntu | *tests | 15:37 |
kalikiana | 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 |
lundmar | I guess my point os to make snapcraft init work more like git init which is a bit more intuitive. | 15:37 |
lundmar | is* | 15:38 |
kalikiana | lundmar: more intuitive in what respect? | 15:38 |
lundmar | kalikiana: mkdir tio; cd tio; snapcraft init | 15:38 |
lundmar | kalikiana: or simply snapcraft init tio; cd tio | 15:39 |
kalikiana | ah | 15:39 |
kalikiana | never noticed that | 15:39 |
kalikiana | but you're right | 15:39 |
lundmar | currently: snapcraft init; mv snap tio; cd tio | 15:39 |
lundmar | its a bit messy imho | 15:39 |
kalikiana | I guess I don't have a strong preference personally for that sort of detail | 15:40 |
lundmar | I'm sorry, I'm a stickler for details :) | 15:40 |
zyga-ubuntu | lundmar: maybe I don't understand your point fully but I always thought about snapcraft init as creating the debian/ directory | 15:40 |
zyga-ubuntu | packaging stays "there" | 15:40 |
lundmar | Imagine you start out by creating multiple snaps with different names, you will see my point ;) | 15:41 |
zyga-ubuntu | lundmar: I don't get it, can you explain please? | 15:41 |
zyga-ubuntu | mkdir foo; cd foo ; snapcraft init; # repeat for bar, etc | 15:41 |
zyga-ubuntu | is that what you mean? | 15:41 |
lundmar | or even simpler: snapcraft init tio; snapcraft init firefox; snapcraft init nano | 15:42 |
* zyga-ubuntu tries | 15:43 | |
lundmar | currently: snapcraft init; mv snap tio; snapcraft init firefox; mv snap firefox; snapcraft init; mv snap nano | 15:43 |
lundmar | the way I suggest is more flexible with fewer commands | 15:44 |
zyga-ubuntu | lundmar: snapcraft init tio doesn't work on 2.34 for me | 15:44 |
zyga-ubuntu | (probably out of date) | 15:44 |
lundmar | zyga-ubuntu: thats exactly my point ;) | 15:44 |
lundmar | it is not supported | 15:44 |
zyga-ubuntu | I see your point then :) | 15:45 |
lundmar | hehe | 15:45 |
zyga-ubuntu | kalikiana: is that something that fits your design? | 15:45 |
lundmar | if one is a git user the current way snapcraft init works catches your eye immediately :) | 15:46 |
zyga-ubuntu | well, I'm a git user but I rarely git init | 15:47 |
zyga-ubuntu | but I see your point | 15:47 |
lundmar | 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 |
lundmar | if* | 15:49 |
kalikiana | lundmar: I'd suggest you propose it in the forum (https://forum.snapcraft.io/) and we can see what other people think | 15:49 |
lundmar | kalikiana: i'll do that | 15:50 |
lundmar | hmm, can't I use my Ubuntu one SSO credentials to login to that forum? | 15:51 |
zyga-ubuntu | no, it's long overdue | 15:52 |
zyga-ubuntu | sorry | 15:52 |
lundmar | ok, it seems I can't | 15:52 |
lundmar | oh well, I'll create yet another account hehe | 15:52 |
lundmar | kalikiana: on another note, do you know where I should put the completion script file referenced by the new "completer:" key? | 15:54 |
lundmar | because I can't seem to find the right place, nor in any examples. | 15:55 |
lundmar | there is an example here: https://github.com/snapcore/snapd/blob/master/tests/lib/snaps/test-snapd-complexion/meta/snap.yaml | 15:55 |
lundmar | but it does not work for me | 15:56 |
kalikiana | lundmar: use `stage:\n - my-script-name` where the script is relative to the source of the part | 15:56 |
lundmar | ahh, thanks | 15:56 |
kalikiana | meta is assembled by snapcraft for you, so I'd recommend you consider it an implementation detail | 15:57 |
lundmar | kalikiana: would you happen to have an example anywhre using stage: ? | 16:00 |
lundmar | none of the snapd tests uses it | 16:00 |
kalikiana | lundmar: snapcraft itself uses it | 16:00 |
* lundmar is grepping snapd and snapcraft gits | 16:02 | |
lundmar | no matches :/ | 16:03 |
kalikiana | lundmar: https://github.com/snapcore/snapcraft/blob/master/snap/snapcraft.yaml#L26 | 16:03 |
lundmar | does the apps completer key reference a part? | 16:09 |
lundmar | so I have to create a part which include stage: to my completion script file | 16:09 |
kalikiana | yes | 16:14 |
lundmar | 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 |
lundmar | I tried this but it fails : https://gist.github.com/lundmar/ce6e3a654f9df61fb92f27e2c47c6682 | 16:24 |
lundmar | 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 |
lundmar | redundant* | 16:26 |
kalikiana | lundmar: where's the file located? you should be able to use the part relative to the part's extracted source | 16:35 |
kalikiana | the *script | 16:35 |
lundmar | kalikiana: it's parts/tio/build/src/bash-completion/tio | 16:37 |
lundmar | no, sorry, I meant parts/tio/install/share/bash-completion/completions/tio | 16:37 |
lundmar | I assume parts/tio is the staging area | 16:38 |
kalikiana | hold on, I'll try it here | 16:42 |
kalikiana | lundmar: remove the leading "install" from the completer path | 16:43 |
lundmar | kalikiana: darn, I almost had it right then hehe. Thanks! | 16:48 |
lundmar | I guess I'm one of the first actually using this new completion feature | 16:49 |
lundmar | kalikiana: https://forum.snapcraft.io/t/suggestion-lets-improve-snapcraft-init-command | 17:00 |
kalikiana | Awesome. Thanks for starting the conversion | 17:11 |
lundmar | no problem, I have another incoming regarding consolidating the temporory build directories | 17:15 |
lundmar | temporary* | 17:15 |
Syntist_ | Any update on theme issue? | 17:25 |
lundmar | kalikiana: https://forum.snapcraft.io/t/suggestion-lets-consolidated-temporary-build-directories-under-one-directory-build | 17:41 |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!