IRC logs for #buildstream for Tuesday, 2020-07-21

*** mohan43u has quit IRC04:49
*** mohan43u has joined #buildstream06:55
*** tristan has quit IRC07:41
*** tristan has joined #buildstream07:45
*** ChanServ sets mode: +o tristan07:45
tristanvalentind, I need to write up a proper commit message for !195407:57
tristanThis changes loader.py, _project.py, _includes.py and _frontend/widget.py but doesn't explain what has changed in all of these files :-S07:58
* tristan tries to parse " We need to process includes without options to load options included in separate files. "08:06
*** benschubert has joined #buildstream08:06
*** jonathanmaw has joined #buildstream08:08
tristanI think the goal is in fact to process the options before doing composition, which happens when merging includes08:08
tristanhrrrrm, internal _includes.py::Includes._include_file() returns this super funky 3-tuple, and doesnt even document what it is returning :-S08:11
*** santi has joined #buildstream08:44
*** jonathanmaw has quit IRC08:46
tristanOk so, looks like !1954 is interestingly _only_ broken for project.conf, but already works as expected for element yaml08:51
tristanI'm not particularly fond of _frontend/widget.py saying "if project.options:" <--- this makes it appear as if it were somehow acceptable to be printing the project options before they were resolved08:53
tristanvalentind, is there any reason we should have OptionPool.load_cli_values() have an 'ignore_unknown' option ?09:03
valentindYEs09:04
tristanIt looks like you added this in July 2018, well before we figured out that options need to be resolved in the context of the project they are defined in09:04
valentindBecause options might be defined in included files09:04
tristanI think that CLI values can only be specified for the toplevel project09:04
valentindYes, but it can be in an include file at top level.09:05
tristanotherwise we'd need an explicit semantic to ensure that we have correct specificity09:05
tristanOh, options themselves being defined in an included file :-S09:05
tristanvalentind, So we validate that on the second round for project.conf but not the first right ?09:06
tristanI suppose we have test cases for this09:06
tristan(undefined options specified by the cli)09:06
tristanWe must09:06
tristanvalentind, While I have you, what is the purpose of changing widget.py in !1954 ?09:07
tristanIf it's just defensive paranoia, it's misplaced; displaying the correct options in the heading is imperative of course (a stack trace is better here than a silent/incorrect success)09:08
valentindIf I remember correctly, it is that it is trying to use fields that are not yet defined.09:09
tristanThat said, I have it on my TODO list to fix the UI formatting of the heading (we have a horrible bug where the heading gets printed multiple times at startup instead of one coherent heading)09:09
tristanRight, that should not happen, if it does; that in itself is a bug which shouldn't really be worked around09:09
tristanAgain, the heading being printed too early (and especially multiple times (!)) is also a bug09:09
valentindWell, it looked to me the way widget intruded to those objects was a hack already.09:10
valentindAh maybe not in master.09:10
tristanIf the frontend is accessing non-public stuff, then public stuff needs crafting in the right places; there are still trace amounts of this nonsense in master (but less indeed)09:11
valentindIt is not too early, really. It is that it never needed to load those options.09:11
tristanNot something to care about for bst-1 branch I'd say though09:11
valentindThi happends when doing a "bst show" on a junction element. I think.09:11
tristanbst show doesnt print a heading afaik09:12
tristanno it doesnt, only the element list09:12
valentindRight. There are some commands when given just a junction element, it would fail.09:13
tristanUmmm09:13
valentindAnyway, that was caught by some test. So if you remove the hack, you can find where the problem is by running the tests.09:14
tristanSo you're saying that when we have a session which loads a junction element for the purpose of the session (like source track/fetch), we don't completely load the project; and we print a bogus heading in the UI ?09:14
valentindNot a bogus. Just missing project options. That were not used anyway by the junction because you cannot use options in junctions.09:15
tristanThat's a bogus heading I'm pretty sure09:15
*** jonathanmaw has joined #buildstream09:16
tristanUsed by the junction or not, it's still "the project settings" being printed, so we should ensure that the project(s) gets fully loaded after loading only a junction before the session starts09:16
tristanugh, that's a mess, test/format/junctions.py fails this because it's performing activities on cross-junction elements, so the toplevel project is not fully loaded in order to reach the target elements of interest09:21
tristanand this is failing *because* of the horribly buggy nature of printing multiple headings "on demand" as projects get loaded09:22
tristanProbably best to keep this hack in place first, then fix the headings to happen once after Stream says "Ok all is loaded", and remove the paranoid `if` after that09:23
tristanThe project.conf clones in _project.conf are a bit weird, lets try to understand that so that we can write something like " We need to process includes without options to load options included in separate files. "09:24
tristanvalentind, Do you have a more detailed explanation for that sentence on hand ?09:24
tristanI think what we're doing is cloning the toplevel project.conf and performing option processing on it once before applying includes to it09:25
valentindIt was exactly what we talked before about.09:32
valentindproject.conf might include files with "options:"09:32
valentindSo we need to first process includes ignoring option processing to be able to load the options.09:33
tristanHmmmm09:37
tristanSo that comment is unrelated to the patch09:38
valentindWhere is that?09:39
tristanvalentind, reading the code from that patch, I'm seeing "... freaky project_conf.clone() passing this around to a new self._load_options() function ..." with that comment above, thinking... that comment must explain this cloning that's going on09:39
tristanhttps://gitlab.com/BuildStream/buildstream/-/merge_requests/195409:39
tristanhttps://gitlab.com/BuildStream/buildstream/-/merge_requests/1954/diffs#5de28618ea7bb36c58e2b7dda21be3f35ffc64bd_697_69409:39
tristanI'm just trying to figure out what this is really doing so I can get a proper commit message and maybe at least comment on the code to make it clear what/why this is happening09:40
valentindIt is not the cloning.09:40
valentindThe comment is for the 3 lines. I put an empty line to delimitate it.09:41
tristanyeah, that cloning is what needs explaining I think09:41
valentindBecause it is modified by load_options and it will be an incomplete one.09:42
tristanI split up your test case to include an exact same test case (using parametrize()) where the include is done on an element09:42
tristanAnd when doing the include on an element, the test passes without the whole patch09:43
tristanWhich makes me wonder if there is a more clear way of doing this, like, can we load the options once and pass it alone to _include.py and have _include.py take care of resolving options ?09:44
valentindI would have to see the test to know what is missing.09:44
tristanI guess this is all mostly because we allow options to be declared in separate files09:44
tristanvalentind, I mean the same test from the exact same patch on 1954, it does 2 includes in project.conf and has a manual element.bst09:45
valentindI think to make it really clear we should abandon yaml.09:45
tristanI added a second test which is a replica, and moves the same include to the element.bst instead of project.conf, and none of this juggling of cloned nodes is needed09:46
tristantest passes out of the box09:46
tristanMaybe we need to also have a test for this with a junction element for good measure09:46
valentindMaybe it actually works to not clone. And there is not way to make a test that breaks. But I think it makes the code more fragile and a small modification could probably break it.09:48
valentindBut let me see.09:49
valentindtristan, Ah right, this is a yaml node.09:50
valentindYes, include will modify it.09:50
valentindtristan, So what do you pass instead of project_conf_for_options?09:51
valentindDo you pass project_conf_first_pass? If so, that might work maybe.09:52
valentindBut if you pass self._project_conf it does not.09:52
valentindThe failing test would also include some configuration (but not options) through a junction.09:52
valentindThen this configuration would totally disappear.09:52
valentindThis is because, at first pass, when seeing includes through junctions, this is just ignored but the '(?)' is still removed.09:53
tristanvalentind, The test you added does break without the patch, but not if you perform the test on an element instead of on the project.conf09:56
valentindThis should mostly fix project.conf includes. Not elements I think.09:57
tristani.e. element.bst files don't suffer this special casing09:57
valentindYes, it is expected that a (?) in the element would have not been affected by the bug this is trying to fix.10:01
valentindOnly from project.conf10:02
tristanWhoa interesting10:02
tristanWhen the element is a junction, the test breaks10:02
valentindBut junctions cannot use (?)10:03
valentindCan they?10:03
valentindAh yes.10:03
valentindThey cannot include, but can use (?)10:04
tristanOh they cannot ?10:04
* tristan doesn't see that anywhere in https://docs.buildstream.build/master/elements/junction.html, or recall it in any previous version of that document10:05
valentindI do think they can include. In theory they could, but they cannot include through other junctions. So I think the make it less confusing we just disabled includes on junctions.10:05
tristanBut junctions can use configuration which is inherited from adjacent junctions, I think they can use variables which are resolved via includes to other projects10:06
tristanThis is a strange limitation, how was this decided and where is it documented ?10:07
tristanhttps://docs.buildstream.build/master/format_intro.html#include also does not mention this10:08
tristanI think that's a bug too :-S10:08
valentindNo, it is a problem if we allow junctions to include through adjacent junctions. Otherwise if two junctions use each other, you can never complete them.10:10
tristanOf course10:10
tristanThat would be expected, and I would expect a coherent circular reference explanation to be reported there10:10
valentindThen after you have to make loading order quite complex, because it is not just the dependencies. It would also be the include graph.10:10
tristanIt already is10:11
tristanhttps://gitlab.com/BuildStream/buildstream/-/issues/1359 this was a bug where I overlooked this10:12
tristanincludes across junctions triggering loads was missed in my initial tests10:12
tristanWe discussed this last week actually10:12
valentindThat is projects. Not elements.10:13
valentindI am talking about adding (@) in a junction element.10:13
tristanRight, subproject loads get triggered by (A) Dependencies, (B) Plugin origins, (C) Element dependencies10:13
tristanRight10:13
valentindNot in the project.conf a junction is pointing to.10:13
tristanOkay10:13
tristanThings are already "quite complex", one thing that would make things clearly a bit less complex, would be to disallow declaring options outside of project.conf10:16
valentindI would be fine with it.10:16
tristanI'm not sure there is any justification for allowing that, project options and plugin origins should be restricted with project.conf10:16
tristanIncludes from junctions I think is fair game, most important is that we have the right error messages triggered when circular things happen or unresolvable scenarios arise10:17
tristanthat's pretty inline with what we already do10:18
tristan(with elements and variables)10:18
tristanbenschubert, any chance of landing https://gitlab.com/BuildStream/buildstream/-/merge_requests/1973 today ?10:19
benschuberttristan: I'll do a first round of review in 30-60 minutes, sorry for the delays, it's been quite busy lately10:23
tristan"To enable design management, you'll need to meet the requirements. If you need help, reach out to our support team for assistance."10:26
tristanWho needs that, what kind of crazy is gitlab trying to sell today :-S10:26
*** tristan has quit IRC10:41
*** tristan has joined #buildstream11:19
*** ChanServ sets mode: +o tristan11:19
*** radiofree has joined #buildstream11:32
radiofreehi, has anyone seen this type of error when running two simultaneous copies of bst (on different folders) https://gitlab.com/celduin/buildstream-bazel/abseil-hello-fork/-/jobs/64856831011:33
tristanconcurrent BuildStream on the same host hasn't been very well supported :-S11:34
radiofreelooks like an issue in the cas backend creating "/bst_cache/buildstream/logs/_casd"11:34
radiofreeit usually works fine for me when the /.cache/buildstream/ is already there, it's only when initialising it from scratch i see this type of thing11:35
tristanin the bst1 days, it was mostly working except for cache expiry, which had session related knowledge baked in (i.e. which elements will be required for this session, shall not be purged from the cache)11:35
radiofreei think i'll just move the cache somewhere persistent so i'm less likely to see it11:35
tristanfor bst2, I *think* it should be fixed with the new expiry approach11:35
tristanjuergbi, any thoughts on this ? can we say that concurrent bst shall be supported in bst2 ?11:36
tristaninteresting that this only happens when initially creating the cache11:37
radiofreei'll try and come up with an example *not* a bazel rules_buildstream, that happens to easily trigger it because i have two of them (one building an arm toolchain and one building an x86 toolchain), so bazel runs those jobs in parallel11:38
juergbicasd still uses a form of session expiry. not that easy to support concurrent sessions with a single cache directory11:38
juergbithat particular error can probably be fixed without a big issue, however, expiry is the main problem11:38
juergbiso until we fix that, I wouldn't recommend running two bst sessions at the same time11:39
radiofreeok!11:40
juergbiif you're sure expiry won't be triggered (no or very high quota and plenty of available disk space), it should work fine but in general it's not11:40
juergbia prerequisite would be to support buildstream using an already running casd instance11:41
tristanThat particular error looks like it only needs an `exists_ok=True` in os.makedirs()11:42
juergbiyes11:44
juergbiwe could add support for opting out of expiry, which should make concurrent sessions safe, however, I don't know whether that would actually be useful in practice11:46
juergbiradiofree: in your particular case, an option could be to build arm+x86 in a single bst session. however, that might not be what you want with regards to bazel integration11:47
radiofreewould a "bst show" or something be enough to spin up the cas? i could do that in the before section, but the point of the pipeline is to demonstrate a build so would rather not do the bst build outside of that11:50
radiofreeit's not 100%, this one passed https://gitlab.com/celduin/buildstream-bazel/abseil-hello-fork/-/jobs/648568307 and it is doing exactly the same thing (at least initially)11:51
tristanbst show should definitely work with a concurrent build session I would think, even on the same project11:51
radiofreei am trying to limit the bst build to be dependent on the cpu requirement though, which should fix it (i.e there's no point building an x86 toolchain for an arm build)11:51
tristanthis is something I've found myself doing a lot11:52
radiofreeok, will add that!11:52
tristanThat said, I'm also interested (not immensely but still) in concurrent local build sessions11:52
tristanMy usecase typically consists of (A) Running a build which will take all day with a limited number of cores allocated to it... (B) Testing changes to another project at the same time11:53
tristanI've done this before "at my own risk" knowing that I have enough space in my cache and knowing what could go wrong11:53
tristanbut it's certainly in the realm of use cases "that happen"11:54
radiofreethere's certainly appetite for that when using rules_buildstream in a bazel project (i.e define buildstream artifacts as bazel dependencies) since bazel will run off and run as many of them in parallel as it can (dependent on the number of --jobs)11:54
tristanhmmm yes, this looks very weird to me, running buildstream from bazel appears like the opposite of the use case I would imagine11:55
tristanI think of BuildStream as the orchestration tool and bazel as the build unit11:55
tristanstill would be interesting to make work11:55
radiofreethe usecase here is to build the toolchain you use to build everything else in the bazel monorepo (which could be an entire software stack) but bst in a known, reproducible, way, rather than relying on some random tarball from the internet/team-members laptop11:59
radiofreei wouldn't fancy sending the patch to gcc for "port gcc build to bazel"12:00
tristanbenschubert, updated patch with a bit of splitting12:02
tristanbenschubert, the only other thing really is the Variables.subst() signature change, we *could* separate that but it seems to be rather meaningless work, it also makes the rewrite patch subpar (looks like we're rewriting variables to have the same silly mistake in it)12:03
tristanin the bst-1 port, I've changed Variables.subst() to take a mandatory additional `Provenance` argument, which amounts to pretty much the same correction12:04
benschuberttristan: seems good thanks! Agreed, now seems a good compromise and already easier to review!12:07
tristanI think for this, it's better to just read _variables.pyx and glance over at and older copy for comparisons, than to observe a diff ;-)12:08
tristana diff would look horribly confusing :)12:08
tristans/over at and/over at a/12:08
tristanOf course, I've left out all of the micro-optimizations from the slower path in the name of brevity, I'll keep that branch around locally in case we want to revisit that some day12:10
*** jonathanmaw_ has joined #buildstream12:58
*** jonathanmaw has quit IRC12:59
benschuberttristan: seems good :)14:34
benschuberttristan: finally finished the review, sorry for the delay16:04
benschuberta few 'nit', feel free to ignore them16:04
benschubertlooks really good16:04
*** jonathanmaw_ has quit IRC17:17
*** santi has quit IRC18:06
*** benschubert has quit IRC20:07
*** mohan43u has quit IRC22:20
*** mohan43u has joined #buildstream22:26
*** mohan43u has quit IRC22:33

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