IRC logs for #buildstream for Wednesday, 2018-06-27

*** Prince781 has joined #buildstream00:34
*** Prince781 has quit IRC01:51
*** Prince781 has joined #buildstream01:51
*** Prince781 has quit IRC02:05
*** Prince781 has joined #buildstream02:11
gitlab-br-botbuildstream: merge request (135-expire-artifacts-in-local-cache->master: WIP: Resolve "Expire artifacts in local cache") #347 changed state ("opened"): https://gitlab.com/BuildStream/buildstream/merge_requests/34702:42
*** Prince781 has quit IRC02:47
*** Prince781 has joined #buildstream02:54
*** Prince781 has quit IRC05:30
*** Guest45103 is now known as ernestask[m]07:16
*** finn has joined #buildstream07:31
*** bochecha has joined #buildstream07:40
*** adds68 has joined #buildstream07:54
*** coldtom has joined #buildstream07:59
*** bethw has joined #buildstream08:02
*** Phil has joined #buildstream08:15
*** dominic has joined #buildstream08:30
*** benbrown has joined #buildstream08:30
*** jonathanmaw has joined #buildstream08:45
*** jmac has joined #buildstream08:56
*** Nexus has joined #buildstream09:16
*** toscalix has joined #buildstream11:42
*** toscalix has quit IRC11:47
*** noisecell has quit IRC12:16
*** noisecell has joined #buildstream12:30
*** noisecell has joined #buildstream12:30
*** krichter[m] has joined #buildstream12:35
*** noisecell has quit IRC12:41
*** noisecell has joined #buildstream12:41
*** pro[m] has joined #buildstream12:47
jennisHi guys, I'd like to discuss a potential optimisation: I've just tried to `track` an element which has a git source, I looked at the git repo and noticed that track was not updating the ref to the latest ref13:15
jennisFrom this, I then discovered the element itself did not specify a `track:` field13:16
jennisSo adding `track: master` to the element, I was then able to `bst track <element>` and this updated the ref13:16
jennisHowever, I thought perhaps we should define a built-in that automatically uses `track: master` for git sources?13:17
jennisI guess for now, I only require thoughts on whether I this is worth writing an issue about...13:17
jennison whether this*13:17
tlaterjennis: I find these days it's easier to create an issue and have it closed as not relevant ;p I for one think this might be n13:19
tlaterice for new users13:19
Philjennis, that sounds sensible. In fact, that was what I assumed it did.13:20
Philuntil I tried it and it didn't work13:20
jennis:p13:20
jennisI also think that this is potentially a nice optimisation for a newcomer to implement13:21
tlaterPhil, jennis: I believe the intention was to mimick git as closely as possible13:21
tlaterWhich doesn't set a default13:21
tlaterBut I also think 'track: master' makes sense :)13:22
noisecelljennis, as a curiosity if the ref is not in master but in any other branch how the element behaves?13:22
noisecellwhen you try to track it?13:22
jennisahh that's a good thought13:22
tlater(Currently tracking in that case does nothing)13:23
noisecellthen the assumption to set up master is wrong ^^13:23
noisecellthough13:23
jennismhm yeah, that's an odd usecase13:23
noisecellnot that odd...13:23
noisecellpeople can forget to add fields13:23
jennisWell for my proposal13:23
tlaternoisecell: I don't think it's wrong, per se13:23
tlaterYou can *still* set the branch to something else13:24
tlaterAnd if you don't want to track certain elements, --deps/--except is how that should be handled, not by setting an empty 'track'13:24
noisecelltlater, well, if you are changing the ref of that element then you are not building anymore that ref... which will be updated to master ref, if Im not mistaken?13:24
jennisMmhm I'm wondering whether it's possible to determine which branch the ref belongs to and track that as default13:25
tlaternoisecell: Yes, that is true, I don't think that's an issue, because yo u will either explicitly set it to another branch in that case, or explicitly except that element from your track13:25
noisecelltlater, you are missing that people can make mistakes and this will create a burden for them13:26
jennis^^ maybe we also implement a track: None option or something like that13:26
noisecellif you have loads of elements13:26
tlaterHm, I suppose that if you forget to set 'track: master' that's less of a burden13:26
tlaterYes, nevermind, I agree13:26
dominicit seems like it's already caused people issues13:26
tlaterdominic: Sort of, but currently what happens is "wait, why didn't that update?"13:27
tlaterIf we changed it, you'd lose the ref, and have to painstakingly backtrack what it was13:27
dominichmm13:27
PhilI guess at least as it is it's obvious something isn't right13:27
tlaterI think the current inconvenience is better than what the suggested change would cause13:27
noisecellmaybe add a warning, saying you haven't set a track, would be my suggestion13:27
tlaterA warning could help :)13:27
noisecellsnap :)13:27
tlaterjennis: track: None is not an option, because you may call a branch None13:28
jennisahh good point13:29
jennisI like the warning idea then13:29
* tlater has missed buildstream warnings before, but I suppose it's not too bad in this case13:29
jennisbut just to clarify, would this be a warning for "your element doesn't specify a track" or is it a warning for "we've tracked master by default"?13:30
tlaterjennis: Given that the latter is potentially destructive, we should stick with the former13:31
noisecelljennis, I would go for "your element doesn't specify a track, so no track is possible"13:31
jennisOk, that makes sense to me, thanks all13:31
jennisI'll write up an issue lter13:31
* tlater takes note that this time looks like a good time to discuss annoyances ;)13:32
noisecellheh13:32
noisecelltlater, did you have time to look at the proposal of adding or moving functionality to "bst artifact" ?13:33
jennisgit diff13:33
tlaternoisecell: I had a quick look at it. No strong opinions other than it looks nice.13:33
jenniswhoops lol13:33
* tlater has been taking most of his free time to work on the artifact cache, so hasn't really had time to spend on anything else13:34
noisecelltlater, thanks :)13:34
gitlab-br-botbuildstream: merge request (relative_workspaces->master: WIP: Patch for issue #191 support relative workspaces) #504 changed state ("opened"): https://gitlab.com/BuildStream/buildstream/merge_requests/50414:01
*** toscalix has joined #buildstream14:24
gitlab-br-botbuildstream: merge request (relative_workspaces->master: WIP: Patch for issue #191 support relative workspaces) #504 changed state ("opened"): https://gitlab.com/BuildStream/buildstream/merge_requests/50414:38
*** toscalix has quit IRC14:42
*** toscalix has joined #buildstream14:46
*** tristan has joined #buildstream15:16
tiagoHow do folks use print statements in buildstream? I fear mine are being swallowed15:30
jmacyou're adding print statements to the source code?15:31
tiagofor debugging purposes only15:32
jmacYou can do it if you pipe output to something else, e.g. 'bst build bootstrap.bst | tee bstlog'15:32
jmacThat stops it using fancy output15:33
jmacUsually it's better to use 'self.warn' if you are in an element/plugin or have access to one15:33
tiagoThanks. I saw that, but I am not on a plugin15:34
jonathanmawjmac: I think you can accomplish the same by using "--no-interactive"15:34
jonathanmaw(as an alternative to piping output)15:34
tristantiago, I sometimes do sys.stderr.write(), where are the prints coming from ?15:35
tiagoThat's one import away :) From sandbox.py15:36
tristanyeah, usually the import sys is directly above it when I do that heh15:37
tristanI think writing to stderr will do it from sandbox.py15:37
tristanthere is a way to do that with print() also, but I think it anyway means importing sys for sys.stderr15:38
jonathanmawtristan, I'm having some difficulty understanding the right way to ensure backward compatibility when changing the function signature for Source.fetch() and Source.track() (i.e. I've added an alias_override arg). Should I be using BST_FORMAT_VERSION to check whether the sources support the old API or a newer version?15:51
jonathanmawGoing by the description, I don't think it's quite right, because the versioning is meant to be per version of the plugin (but internal plugins are kept in sync with buildstream as a convenience), rather than something I can use so that buildstream is aware of what version the plugins are.15:52
*** bochecha has quit IRC16:01
*** bochecha has joined #buildstream16:01
*** Phil has quit IRC16:03
*** bochecha has quit IRC16:06
tristanjonathanmaw, nope, that's not how it works16:11
tristanjonathanmaw, or... unless maybe there is a python feature I dont know about16:12
tristanjonathanmaw, What I'd shoot for though is not do have to do that kind of conditional, and carefully grow the signature such that people calling the old way still get their expected results16:13
tristanwe do have some flexibility with mandatory args, optional args and keyword only args16:13
tristanalias_override huh16:13
tristanjonathanmaw, that sounds wrong, like as if we're passing a new parameter and expecting plugins to know what it means16:14
jonathanmawtristan, hrm, maybe I'm missing a python feature, then. I was getting TypeErrors because I was passing args into functions that weren't expecting them.16:14
tristanjonathanmaw, right, that might require a looser definition of the method16:15
tristanjonathanmaw, adding an optional or keyword_only argument should "work"16:16
tristanat that level16:16
tristanbut the expectation that plugins will treat the new parameter would be incorrect16:16
tristandid we eliminate the possibility of getting this to work seamlessly with the existing public API, via Source.resolve_url() ?16:17
jonathanmawtristan: I could get it working without changing the existing public API, but it involved some unpleasant hacks16:19
jonathanmawSo I've been trying to implement it in a nicer way based off a suggestion from valentind16:19
tristanjonathanmaw, unpleasant hacks sound alright to be honest16:19
tristanThe reinstantiation could be done fairly cleanly, maybe there are some ugly corner cases to that16:20
tristanbut... it doesnt break API16:20
tristanjonathanmaw, basically, we can teach plugins to do new things, and then the core has to accept that some plugins dont do those things16:21
tristanor, we can use the things that the plugin already does16:21
tiagoI was thinking to tackle issue 289. What's desirable to do here, check if there's a shell in the sandbox and abort with an appropriate error if not? Or just avoiding running the strip-commands if no install-commands were defined16:22
jonathanmawtristan: okay, I can have the branch that doesn't make API changes ready for review in a few minutes16:22
*** coldtom has quit IRC16:22
tristantiago, I think juergbi and I discussed it and came fairly close to a conclusion that we could have Sandbox raise an error when it's asked to run a command which it knows does not exist in the runtime16:23
tristantiago, there may be some gray area as to, whether we only do it for the shell, or if we expect a full path... probably better to use the sandbox PATH, only check the first thing in the sandbox argv16:24
tiagoHmm, if the command doesn't exist, the shell will already tell you about. In this case, wouldn't be better to just check for the existence of the shell?16:25
tristanjonathanmaw, what was the API changes you introduced and was there a plan for how existing plugins would behave while ignoring the new param ?16:25
tristanor, maybe you cannot add the param because the source implementations themselves override the signature with a fixed signature16:25
tristantiago, yes and no16:26
tristantiago, so under *no* circumstance would we be parsing the scripts and checking for more than one program16:27
tristantiago, i.e. if we ran the shell, then as you say, the shell will notify of anything else16:27
tristanbut if we don't run the shell, like if we run /bin/find directly with no shell... then there is no shell to tell us what's up16:28
tristantiago, the BuildElement runs a shell for it's "commands", not everything does16:28
tristan(or, there are ways to invoke things directly)16:28
tiagoOk :)16:28
jonathanmawtristan: The API changes in the API-changing branch are:16:33
jonathanmaw* A class called SourceDownloader now exists, and Source derives from it.16:33
jonathanmaw  - SourceDownloader now holds the fetch and track methods16:33
jonathanmaw  - SourceDownloader also has a get_alias method, so we don't need to intercept translate_url calls to figure out which aliases are being used.16:33
jonathanmaw    - By default it checks whether an original_url field exists, and extracts the alias from there.16:33
jonathanmaw* Source now has the get_source_downloaders method, which is expected to return a list of SourceDownloaders. For most sources (i.e. ones that only ever download from one URL, e.g. everything but git sources) this defaults to returning a list containing itself.16:33
jonathanmaw  - get_source_downloaders takes the alias_override as an arg, as the git source proves we need to fetch the repo before we can know what the submodules are.16:34
jonathanmaw* The fetch method has been extended from fetch(self) to fetch(self, alias_override=None)16:34
jonathanmaw* The track method has been extended from track(self) to track(self, alias_override=None)16:34
jonathanmaw(big paste ends here)16:35
tristanjonathanmaw, errrm, ok is sounds generally sane but, was it planned how existing, unmodified source implementations were going to work under this design ?16:41
tristanjonathanmaw, there may be a better way than reinstantiation (although I think the reinstantiation is a very nice way to avoid the API break and leverage something existing)16:42
jonathanmawtristan: I was labouring under the misapprehension that the unmodified source implementations would ignore the additional args and behave as normal16:43
tristanAhhhh16:44
tristanjonathanmaw, ok so in this view basically... unmodified plugins simply never make use of mirrors ?16:44
jonathanmawyep16:44
tristanbut still we put some of the business logic into the source implementations16:45
tristanwhich is... meh has it's ups and downs16:45
tristanjonathanmaw, your alternative approach is still possible, you just can't use a function argument to communicate it16:45
tristanthere are other ways for a function to obtain a named value16:46
tristanstill, there is the other side to look at... A.) The core has this nasty big loop which treats all plugins pretty equally and does some iterations over aliases and source reinstantiation16:47
tristanB.) The plugins each have to do something on their own16:47
tristanWith A, plugins remain more dumb, and the core can assert that the mirrors have been tried (it's executed a plugin code path for each mirror)16:48
jonathanmawtristan: ok, I'll tidy up my approach A branch and make sure it's in a MR16:51
tristanjonathanmaw, alright, I think A has got some clear advantages over B yes16:52
tristanAlso if there is policy and control about what order aliases get traversed16:53
tristanthen the core can also ensure it, without saying that "plugins might honor the order"16:53
gitlab-br-botbuildstream: merge request (328-support-for-downloading-sources-from-mirrors->master: Resolve "Support for downloading sources from mirrors") #404 changed state ("opened"): https://gitlab.com/BuildStream/buildstream/merge_requests/40416:59
jonathanmawtristan: ^ should be the MR in a state ready to review. the only changes I made after valentind looked it over was to add documentation and NEWS entries17:04
tristanjonathanmaw, nice I'll take a look at this today :)17:05
jonathanmawtristan: thanks17:05
tristanlet's see how horrible the hacks are and if we can improve them hehe :)17:06
*** Prince781 has joined #buildstream17:06
jonathanmawtristan: yep, part of it involves generating unique combinations of alias overrides for every alias that the source suspects, which had an extremely complicated algorithm until I actually understood what it did.17:07
jonathanmaws/suspects/expects/17:09
jonathanmawthe algorithm's now only slightly magical17:09
*** bochecha has joined #buildstream17:10
*** tristan has quit IRC17:13
*** jonathanmaw has quit IRC17:13
*** dominic has quit IRC17:15
*** bethw has quit IRC17:22
*** Prince781 has quit IRC18:45
jjardonmaybe of intesrest here: https://www.collabora.com/news-and-blog/blog/2018/06/27/introducing-debos/19:09
*** Prince781 has joined #buildstream19:23
*** bethw has joined #buildstream19:48
*** Prince781 has quit IRC19:59
*** Prince781 has joined #buildstream20:16
*** Prince781 has quit IRC21:12
*** bethw has quit IRC21:26
gitlab-br-botbuildstream: merge request (valentindavid/331_include->master: WIP: Add support for include in project.conf) #471 changed state ("opened"): https://gitlab.com/BuildStream/buildstream/merge_requests/47121:46
*** bochecha has quit IRC21:52

Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!