/srv/irclogs.ubuntu.com/2017/11/25/#snappy.txt

mupPR 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-ubuntujohn, it's Saturday!09:57
sergiusenssays the one who noticed ;-)09:58
zyga-ubuntuwell09:59
zyga-ubuntuhaha, 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
lundmarHi. 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
lundmarenable*13:40
zyga-ubuntulundmar: that is not supported yet13:43
lundmardarn :/13:46
zyga-ubuntuas a poor man's workaround embed man and your manual pages as a "man" command in your snap13:46
zyga-ubuntuit's not perfect, we will get to properly integrated man pages, it's just not on the immediate roadmap13:46
lundmarthe man package is quite an unwnanted dependency sizewise :)13:47
zyga-ubuntulundmar: how big is "/usr/bin/man" itself?13:47
zyga-ubuntubut sure, I get it13:47
zyga-ubuntujust letting you know13:48
lundmarwell, 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
lundmaralso, your man command would override the systems man command which I think would be unfortunate and maybe cause other issues.13:51
lundmarsupporting 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
lundmarhow 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
lundmarzyga-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
lundmaror is it fully isolated so that can't be done14:01
zyga-ubuntulundmar: no, that would be extremely dangerous in genral14:05
zyga-ubuntulundmar: we have a plan on how manual pages can be integrated14:06
zyga-ubuntulundmar: but it's not something that will happen overnight14:06
zyga-ubuntulundmar: there's confinement coming to man itself, so that it can process untrusted input14:06
zyga-ubuntulundmar: and there's a plan to pre-process the manual pages from snaps before they are exported to unconfined world14:06
zyga-ubuntulundmar: but both are still unscheduled (I think the man work is upstream)14:06
zyga-ubuntuI'm going AFK, if you leave me messages I'll check them out late r:)14:07
lundmarok thanks for the info. Glad to know a solution is on its way.14:07
lundmarNow, I need to figure out how this completion support works14:07
lundmarMy 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 he14:11
lundmartool*14:11
lundmarIf anyone can provide me an example snapcraft.yaml on how to enable autocompletion scripts that would be helpful. thanks.14:12
zyga-ubuntulundmar: there are some in snapcraft and snapd source code14:14
zyga-ubuntulundmar: you need a complete: or something similar key14:15
zyga-ubuntulundmar: grep for that in tests/ in snapd tree14:15
zyga-ubuntulundmar: there are examples in snapcraft that are more educational but I'm on the snapd side14:15
lundmarzyga-ubuntu: yeah, I finally found that via google. I'm looking at it now. thanks.14:17
lundmarI found it referenced by this guy: http://chipaca.com/post/160369439977/in-snap-tab-completion14:19
lundmarhmm, 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-ubuntulundmar: yeah, chipaca implemeted it all :)15:04
zyga-ubuntulundmar: probably, I don't know15:04
lundmarhehe, the prime directory gets cleaned out by snapcraft clean so that is definitely not the place to put it15:05
lundmarI'm not liking all the temp directories that snapcraft creates. You guys should consider putting all of them in a single top "build" directory15:06
lundmarAlso, 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.yaml15:18
lundmarit gets even worse when you then start adding stuff like snap/snap/gui/icon.png15:19
lundmarI'm missing structure guys :)15:20
zyga-ubuntulundmar: snapcraft needs to know the root directory15:33
zyga-ubuntulundmar: and snapcraft integration needs to be automatic (for build systems)15:33
zyga-ubuntulundmar: so we pick either top-level/snapcraft.yaml or snap/snapcraft.yaml15:33
zyga-ubuntulundmar: for simplicity and consistency15:33
zyga-ubuntulundmar: 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-ubuntulundmar: kyrofa, sergiusens or kalikiana can help you15:34
kalikianalundmar: 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 tree15:36
* zyga-ubuntu makes some tea and returns to debugging snapd integration tets15:37
zyga-ubuntu*tests15:37
kalikianalundmar: regarding prime: you don't have to copy anything in there, it gets created during the build, so you can just reference in the yaml15:37
lundmarI guess my point os to make snapcraft init work more like git init which is a bit more intuitive.15:37
lundmaris*15:38
kalikianalundmar: more intuitive in what respect?15:38
lundmarkalikiana: mkdir tio; cd tio; snapcraft init15:38
lundmarkalikiana: or simply snapcraft init tio; cd tio15:39
kalikianaah15:39
kalikiananever noticed that15:39
kalikianabut you're right15:39
lundmarcurrently: snapcraft init; mv snap tio; cd tio15:39
lundmarits a bit messy imho15:39
kalikianaI guess I don't have a strong preference personally for that sort of detail15:40
lundmarI'm sorry, I'm a stickler for details :)15:40
zyga-ubuntulundmar: maybe I don't understand your point fully but I always thought about snapcraft init as creating the debian/ directory15:40
zyga-ubuntupackaging stays "there"15:40
lundmarImagine you start out by creating multiple snaps with different names, you will see my point ;)15:41
zyga-ubuntulundmar: I don't get it, can you explain please?15:41
zyga-ubuntumkdir foo; cd foo ; snapcraft init; # repeat for bar, etc15:41
zyga-ubuntuis that what you mean?15:41
lundmaror even simpler: snapcraft init tio; snapcraft init firefox; snapcraft init nano15:42
* zyga-ubuntu tries15:43
lundmarcurrently: snapcraft init; mv snap tio; snapcraft init firefox; mv snap firefox; snapcraft init; mv snap nano15:43
lundmarthe way I suggest is more flexible with fewer commands15:44
zyga-ubuntulundmar: snapcraft init tio doesn't work on 2.34 for me15:44
zyga-ubuntu(probably out of date)15:44
lundmarzyga-ubuntu: thats exactly my point ;)15:44
lundmarit is not supported15:44
zyga-ubuntuI see your point then :)15:45
lundmarhehe15:45
zyga-ubuntukalikiana: is that something that fits your design?15:45
lundmarif one is a git user the current way snapcraft init works catches your eye immediately :)15:46
zyga-ubuntuwell, I'm a git user but I rarely git init15:47
zyga-ubuntubut I see your point15:47
lundmarI'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
lundmarif*15:49
kalikianalundmar: I'd suggest you propose it in the forum (https://forum.snapcraft.io/) and we can see what other people think15:49
lundmarkalikiana: i'll do that15:50
lundmarhmm, can't I use my Ubuntu one SSO credentials to login to that forum?15:51
zyga-ubuntuno, it's long overdue15:52
zyga-ubuntusorry15:52
lundmarok, it seems I can't15:52
lundmaroh well, I'll create yet another account hehe15:52
lundmarkalikiana: on another note, do you know where I should put the completion script file referenced by the new "completer:" key?15:54
lundmarbecause I can't seem to find the right place, nor in any examples.15:55
lundmarthere is an example here: https://github.com/snapcore/snapd/blob/master/tests/lib/snaps/test-snapd-complexion/meta/snap.yaml15:55
lundmarbut it does not work for me15:56
kalikianalundmar: use `stage:\n - my-script-name` where the script is relative to the source of the part15:56
lundmarahh, thanks15:56
kalikianameta is assembled by snapcraft for you, so I'd recommend you consider it an implementation detail15:57
lundmarkalikiana: would you happen to have an example anywhre using stage: ?16:00
lundmarnone of the snapd tests uses it16:00
kalikianalundmar: snapcraft itself uses it16:00
* lundmar is grepping snapd and snapcraft gits16:02
lundmarno matches :/16:03
kalikianalundmar: https://github.com/snapcore/snapcraft/blob/master/snap/snapcraft.yaml#L2616:03
lundmardoes the apps completer key reference a part?16:09
lundmarso I have to create a part which include stage: to my completion script file16:09
kalikianayes16:14
lundmarhmm, 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 created16:24
lundmarI tried this but it fails : https://gist.github.com/lundmar/ce6e3a654f9df61fb92f27e2c47c668216:24
lundmarI really want to avoid extracting the completion script from my .tar.xz and putting it somewhere else for snap to use. It would be redundanct16:26
lundmarredundant*16:26
kalikianalundmar: where's the file located? you should be able to use the part relative to the part's extracted source16:35
kalikianathe *script16:35
lundmarkalikiana: it's parts/tio/build/src/bash-completion/tio16:37
lundmarno, sorry, I meant  parts/tio/install/share/bash-completion/completions/tio16:37
lundmarI assume parts/tio is the staging area16:38
kalikianahold on, I'll try it here16:42
kalikianalundmar: remove the leading "install" from the completer path16:43
lundmarkalikiana: darn, I almost had it right then hehe. Thanks!16:48
lundmarI guess I'm one of the first actually using this new completion feature16:49
lundmarkalikiana: https://forum.snapcraft.io/t/suggestion-lets-improve-snapcraft-init-command17:00
kalikianaAwesome. Thanks for starting the conversion17:11
lundmarno problem, I have another incoming regarding consolidating the temporory build directories17:15
lundmartemporary*17:15
Syntist_Any update on theme issue?17:25
lundmarkalikiana: https://forum.snapcraft.io/t/suggestion-lets-consolidated-temporary-build-directories-under-one-directory-build17:41

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