IRC logs for #buildstream for Monday, 2017-06-05

*** tristan has joined #buildstream05:04
*** ChanServ sets mode: +o tristan05:05
*** tiagogomes has joined #buildstream08:37
*** tiagogomes has quit IRC08:46
*** jonathanmaw has joined #buildstream08:46
*** tiagogomes has joined #buildstream08:48
jonathanmawtristan: I have merge requests at https://gitlab.com/BuildStream/buildstream-tests/merge_requests/3 and https://gitlab.com/BuildStream/buildstream/merge_requests/2209:53
jonathanmawthey seem to be correct, to the limit of my ability to test09:53
jonathanmaw(gnome-system is bootable with those changes, initramfs-gz seems to be an initramfs)09:53
tristanjonathanmaw, I'll take a look...09:58
tristanI have been having a lot of trouble with ostree lately :'(09:58
tristanwrote up here: https://mail.gnome.org/archives/ostree-list/2017-June/msg00011.html09:59
tristanbuildstream-tests patch looks much better yes :)10:05
tristanjonathanmaw, I thought we would move all that parsing stuff to the concrete 'script' element itself no ?10:10
jonathanmawtristan: I understood it as splitting it out into helper methods, so derived classes could choose what to include10:12
jonathanmawI could move parse_layout into the derived scriptelement class without causing duplication work for myself10:13
tristanjonathanmaw, rather I want the base ScriptElement to provide API to make all script-like elements implementable, and have a powerful 'script' element which leverages all of these features10:16
tristanSo for instance... the x86image element would call some API to setup the layout in the way that it needs, and the all purpose 'script' element would parse some yaml10:17
tristanthe concrete elements might call some function to append grouped commands10:18
jonathanmawtristan: I'm not sure what you mean by "the all purpose 'script' element would parse some yaml"10:21
tristanIt would implement configure() and understand some configuration loaded from yaml, which it would use to exercise all of the API provided by the base abstract ScriptElement class10:22
tristanjonathanmaw, So basically, this "layout" section in YAML anyway is only ever going to appear in that all purpose script element plugin named 'script'10:23
tristanThat YAML configuration is user facing API10:23
tristanThe ScriptElement API is plugin-author facing API10:24
jonathanmawso instead of X86Image writing directly to self.layout, the base scriptelement should be providing methods to set the layout appropriately.10:25
tristanSo we probably want functions like ScriptElement.layout_add(Element, destination, scope)10:26
tristanAnd ScriptElement.add_commands(group_name, command_list)10:26
tristanI didnt notice that but yes10:26
tristanAnd that should probably be ScriptElement.__layout10:27
jonathanmawtristan: and instead of settting command_domains in the derived element to identify how the commands are set, that's added by functions called in configure10:27
jonathanmawok10:27
*** tristan has quit IRC11:05
*** tristan has joined #buildstream12:05
jonathanmawtristan: having mulled over your suggestions for layout_add and add_commands, I have some questions.12:16
jonathanmaw1) in layout_add, what is "scope"?12:16
jonathanmaw2) It would be simpler to have add_commands take the node, and the group name, because the logic for running the substitutions on the commands isn't trivial12:18
jonathanmawok, maybe the second one was more of an observation than a question12:20
jonathanmawi.e. if I made commands an OrderedDict, then inserting commands under that API would be trivial, but also wouldn't be saving plugin authors much effort12:26
jonathanmaw(e.g. they still have to collect the pre- and post- commands themselves, and do all the substitutions12:26
jonathanmaw)12:26
tristanjonathanmaw, 1.) That is a good question, I threw it in there because, you should be allowed to stage only all the dependencies of self as Scope.BUILD, but perhaps the API is cleaner if that is just the behavior when layout_add() is never called12:29
jonathanmawok12:30
tristan2.) Still I would prefer if that is not a property of the ScriptElement abstract class12:30
jonathanmawok, so there should be convenience functions as well to pull in pre- and post-, and substitute them.12:31
tristanMaybe, if it's that much, we could have an "array of strings parse with substitution" convenience somewhere, if that is common12:31
tristanA convenience function could be fine for that yes, maybe have 2, one for loading the array of substed strings, and another for the pre-/post- thing, if that really is needed12:32
tristanIt's certainly nice to save lines of code, but sometimes there is a limit to that, though; e.g. when you are only saving one or two lines of code and the expense is that it's more difficult to figure out what the code is doing, then I usually prefer verbosity12:33
tristanI'm not sure what the pre-/post- thing would look like off the top of my head, and how much sense it would make or how readable the code using that function would be12:34
tristanjonathanmaw, So yeah OrderedDict is a decent data type to store the ordered, named command lists privately on ScriptElement12:36
tristanBut12:36
tristanI feel that a set_commands(ordered_dict_of_commands) is not a friendly API for plugin authors12:37
tristanrather, adding commands on a per named-list basis is more comprehensive12:37
jonathanmawtristan: I was thinking set_commands(node, groupname) for the method which does the substitution and collecting prefixes prefix12:38
jonathanmaws/prefix$//12:38
tristanUmmm12:39
jonathanmawbut yes, using an OrderedDict internally, and taking the order to run command groups from the order they're added, using add_commands(groupname, commands) works for me12:40
tristanOk so right now we have substitution stuff on Element12:41
tristanWhich is because the element owns the variables (and so is not common with Sources)12:41
tristanWe have node_subst_list_element(node, member_name, indices)12:41
tristanSeems to me a natural extension (wrapper) to that would be Element.node_subst_list() (which expects the list to be a list of strings)12:42
tristanThis leaves pre-/post- logic as an (appropriately IMO) separate concept12:43
jonathanmawok12:44
tristanOne need only iterate over the possible names, and do commands = self.node_subst_list(config_node, name) and then self.add_commands(name, commands)12:44
tristanensuring of course that the names one iterates over are in the order that those names should be executed12:44
* tristan notes that the 'indices' param of that is a bit annoying/confusing, but necessary in order to support lists of lists12:46
tristanpossibly that will never be used, though :-/12:46
tristanOk so I've determined that the issue I'm seeing (finally I understand that it depends on how I use ostree, whether hardlinks are really enabled) is due to https://gitlab.com/BuildStream/buildstream/issues/1913:55
tristanSo it's not a bug with debian, but rather I'm munging some files because hardlinks13:55
tristanand looking at https://www.stavros.io/posts/python-fuse-filesystem/ as a plausible solution for creating the sandbox with copy-on-write hardlink experience13:56
*** xjuan has joined #buildstream13:58
tristanOk this is gonna be tricky but nice, I'll have to run a process to do the fuse thing whenever sandboxing in; and that process needs to terminate with the build process if ever it's terminated14:06
tristancan be done with a contextmanager API... with fused_build_directory(real_directory) as fused_directory:14:06
tristanthen bwrap mounts the fused directory instead... but; should not be necessary for the /buildstream directory in the case that we're staging sources in there and not artifacts14:07
tristana bit wild14:08
tristanmaybe first try the whole thing over fuse and dont bother distinguishing for the source directory unless performance is effected, but I suspect it would be14:08
tristanlong time no see xjuan :)14:10
tristanxjuan, you better come to GUADEC this year :)14:10
tristanhaha14:10
xjuanhey tristan14:13
xjuanI think so14:14
tristanI'm counting on YOU !14:14
tristanhehe14:14
tristanxjuan, I promise an especially good whiskey this year :)14:15
xjuanI am waiting for my sponsorship to be approved14:15
xjuanfor some reason flights are crazy expensive this time of the year14:16
tristancan't find an excuse to get your company to pay ?14:16
tristanwell, I think you will make it some way or another :)14:16
*** persia has quit IRC14:17
xjuan$2200 compared to 1400 early this year14:17
xjuanI think we spent most of the travel budget for this year14:18
tristanouch14:18
xjuanbut I am pretty sure GNOME will sponsor me14:18
tristanyeah I think sor14:18
* tristan has to run, after 11pm here...14:18
* tristan will literally run :)14:18
xjuan:)14:18
xjuanok see you later!14:19
*** tristan has quit IRC14:21
*** persia has joined #buildstream14:22
*** tristan has joined #buildstream14:48
jonathanmawhrm, looks like I'm going to need a bigger HDD to work on buildstream. I've got 145G, and 98G is being used by ~/.cache/buildstream14:52
ironfootor a script  to clean the cache in a clever way?14:55
*** jude has quit IRC15:15
*** jude has joined #buildstream15:38
gitlab-br-botbuildstream: merge request (jonathan/enhance-script-element->master: Jonathan/enhance script element) #22 changed state ("opened"): https://gitlab.com/BuildStream/buildstream/merge_requests/2215:49
jonathanmawtristan: ^15:49
jonathanmawthat ought to be closer to your expectations.15:50
jonathanmawand of course I forgot to run setup.py test on it beforehand...15:51
gitlab-br-botbuildstream: merge request (jonathan/enhance-script-element->master: Jonathan/enhance script element) #22 changed state ("opened"): https://gitlab.com/BuildStream/buildstream/merge_requests/2215:55
jonathanmawmuch better :)15:56
*** jonathanmaw has quit IRC16:02
*** jude has quit IRC17:03
*** jude has joined #buildstream17:17
*** jude has quit IRC17:24
*** tristan has quit IRC20:12
*** xjuan has quit IRC20:44

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