IRC logs for #buildstream for Thursday, 2020-01-09

*** narispo has quit IRC00:06
*** narispo has joined #buildstream00:08
*** narispo has quit IRC02:25
*** narispo has joined #buildstream02:25
*** narispo has quit IRC05:00
*** narispo has joined #buildstream05:03
*** narispo has quit IRC06:18
*** narispo has joined #buildstream06:19
*** narispo has quit IRC06:23
*** narispo has joined #buildstream06:28
*** narispo has quit IRC06:39
*** narispo has joined #buildstream06:40
*** narispo has quit IRC07:36
*** traveltissues has joined #buildstream07:42
*** narispo has joined #buildstream08:00
*** ikerperez has joined #buildstream08:32
*** paulsherwood has joined #buildstream08:51
*** paulsherwood has joined #buildstream08:51
*** paulsher1ood has joined #buildstream09:36
*** tiagogomes has joined #buildstream09:48
coldtomlooks like buildstream master can't be installed using the command in the docs? `pip3 install --user -e .` fails, i think due to https://github.com/pypa/pip/issues/643409:52
benschubertcoldtom: ah, --user and -e are incompatible if I recall correctly? Or is is --target and -e?09:56
coldtomi think it's pep517 with build-backend and -e which is broken09:59
coldtomat least, --user -e works for 1.410:01
*** tme5 has joined #buildstream10:03
*** phildawson has joined #buildstream10:10
benschubertI always run pip install -e buildstream, not sure what version of pip I have though10:22
juergbiit might no longer work since cython, don't remember exactly10:25
juergbipip install -e with venv works fine, though10:25
* coldtom does a bit more digging10:25
tpollard-e doesn't work for me10:28
tpollardpip 19.3.1, python 3.710:28
*** douglaswinship has joined #buildstream10:29
*** jonathanmaw has joined #buildstream10:29
coldtomyeah, seems to be only --user which causes it to break, looks like the --user gets passed to a python invocation somewhere10:32
tpollardsetup.py 'error: option --user not recognized', works fine without -e though10:33
juergbiyes, --user and -e are incompatible with our current setup. don't remember what broke it10:34
juergbiI think there was a bit of discussion about this on IRC when it broke and the conclusion was that our recommendation should anyway be to use venv, where --user is not needed and -e works10:34
tpollardsounds reasonable for development10:35
tme5fielding suggestions: if I'm merging tag tracking, it will need a different config name to 'track-tags' as that's already in use11:06
tme5'track-latest-tag' ?11:07
coldtom'track-latest-tag' sounds good to me, or perhaps 'auto-update-tags' or something similar11:14
tme5the latter sounds more like an alternative name for the current track-tags behaviour11:18
tme5i think 'track-latest-tag' is ok too, just kind of sounds like it's an extra option to track-tags11:19
tlater[m]Grmbl grmbl11:28
tlater[m]Stupid automake11:28
tlater[m]Why does your mirror never work :(11:28
tme5is there a reason why hard-coded Git committer and author dates are part of the test env?11:35
tlater[m]tme5: Where exactly?11:36
tme5testing/_utils/site.py11:36
tpollardI presume so the git tests work correctly on systems where a user hasn't been configured?11:37
tme5but why the dates?11:37
tlater[m]tme5: Reproducibility, so the commits always end up being the same11:37
tlater[m]We test making commits11:38
tlater[m]And we assert that the commits end up right11:38
tme5commits don't need to be hard-coded though, there is repo.latest_commit11:38
tlater[m]tme5: Which uses that11:39
tlater[m]It looks like it's used so that junction shas end up the same every time11:40
tme5ah, which test suite?11:41
tlater[m]`testing/_utils/junction.py` configures junctions with git11:41
tlater[m]So anything that uses a junction will be affected by that11:41
tme5there is no hard-coding of refs here though right?11:42
tlater[m]tme5: It will always generate the same ref11:43
tme5_SimpleGit.create returns the commit by latest_commit11:43
tme5but why is that required?11:43
tlater[m]Presumably element definitions will reference specific refs11:43
tlater[m]It makes it easier to write tests that track in specific ways.11:43
tlater[m]Sure, you can work around that11:44
tlater[m]But I don't see how reproducibility in our test suite hurts11:44
tme5the reason I ran into this is because i'm testing a feature which compares several branches by their latest commit date and it was messing that up11:45
tlater[m]tme5: Ah, you'll need that if you scrub tags and stuff, I suppose11:46
tlater[m]Well, I think we could use API for specifying dates on commits.11:47
tlater[m]A little hard to implement from a plugin testing point...11:47
tme5i've added that already11:48
tme5but it requires more mucking around with instance variables11:48
tlater[m]Why would it? Could it not just be a kwarg on one or two methods?11:49
tme5(repo.Git.env)11:49
tme5yeah it's not difficult, it's just not as simple as --date to git commit because that only changes the author date and I am wanting to change the committer date11:49
tlater[m]Right11:50
tlater[m]Any reason you can't use the author date for your tests?11:50
tme5because the relevant functionality ought (at least i think) to compare committer dates11:51
tlater[m]Well, fair enough11:51
tme5thanks for the help with the rationale11:53
gitlab-br-bottpollard closed issue #1205 (Improve messaging around state of junction elements) on buildstream https://gitlab.com/BuildStream/buildstream/issues/120512:18
gitlab-br-bottpollard merged MR !1764 (tpollard/showjunction->master: _frontend/widget.py: show_pipeline() Don't show buildable for junction) on buildstream https://gitlab.com/BuildStream/buildstream/merge_requests/176412:18
benschuberttpollard: ^ nice one :)12:24
tpollarddo you have any opinion on !1788 juergbi?12:40
gitlab-br-botMR !1788: scheduler.py: Handle exceptions that are caught under the event loop https://gitlab.com/BuildStream/buildstream/merge_requests/178812:40
juergbitpollard: let me take a look12:41
juergbitpollard: in what scenario is context.get("exception") set/unset?12:45
juergbiI would have expected us to trigger a BUG message in any exception case12:46
tpollardthe docs don't really specify12:46
tpollardwhich is annoying12:47
tpollard'context is a dict object containing the following keys (new keys may be introduced in future Python versions)' with exception being optional12:47
tpollardBUG should be raised regardless though12:48
juergbiah, by the app handler12:48
tpollardyep12:48
tpollardbut if there's no exception object it won't halt, just message12:49
juergbitpollard: wouldn't it make sense to create an exception object if there isn't one?12:50
juergbiand then follow the first path12:50
juergbithat way it will halt etc.12:50
tpollardI don't see an issue with doing that, but would be more confident if I knew the condition in which the exception wasn't given12:55
juergbisure, that would definitely be good to know. however, if we don't know more, reducing the number of exception code paths makes sense to me12:58
juergbioverall it seems odd that we have to call excepthook() directly but I don't know of a better alternative12:59
juergbiand I expect it to work. I assume you've tested it with that revert12:59
tpollardone one hand I'd like async to not do any handling once it's passed the exception to a custom handler12:59
juergbitesting in the test suite is probably not easily possible12:59
tpollardbut I do get that it might be a legitimate error if a custom handler ends up raising an exception itself13:00
juergbiI guess the expectation from asyncio is that the loop is owned by something like our App object13:01
juergbiand thus the App would directly set the exception handler13:02
tpollardcould we monkey patch the buildstream instance (say, with the example I gave in the MR) for the test case?13:02
juergbicould be possible but not sure whether we can easily do it in a robust way13:03
juergbialso need to make sure other tests are not affected13:03
tpollardI'll update it to generate an exception in the optional case13:08
tpollardjuergbi: although that leaves us with having to infer what type of error it should be13:23
tpollardin consistencybug.py we just raise a generic Exception()13:30
tpollardjuergbi: I'd go with creating a new scheduler error type or a generic exception, what do you think?13:42
*** narispo has quit IRC13:57
*** narispo has joined #buildstream13:58
*** traveltissues has quit IRC14:37
tme5Just pushed to !1774. Any comments welcome :) It is incomplete but it can be considered finished for the functionality implemented so far.14:55
gitlab-br-botMR !1774: WIP: Merge 'git_tag' functionality into 'git' source https://gitlab.com/BuildStream/buildstream/merge_requests/177414:55
gitlab-br-bottpollard closed issue #1084 (stack trace with python 3.7 when exiting client with `^C`) on buildstream https://gitlab.com/BuildStream/buildstream/issues/108415:09
juergbitpollard: as we don't even know when this can happen and we essentially need the exception just as a container for the message, a generic exception is ok, imo15:19
*** narispo has quit IRC15:26
*** narispo has joined #buildstream15:26
*** narispo has quit IRC15:29
tme5fielding more suggestions: the 'match' and 'exclude' options ought to be copied over from git_tag too, but they need to be renamed15:42
coldtomtag-match, tag-exclude?15:42
tme5seeing as they are only relevant when 'track-latest-tag' is set, I considered making them sub-options of that15:43
tme5so you can write `track-latest-tag: True` or `track-latest-tag: match: - ... exclude: - ...` (newlines left to imagination)15:43
tme5tlater[m], the other day you discussed with me loading a config key as either one or two types. Do you know how to do that without catching the private API LoadError exception?15:51
tme5*either one of two15:52
tlater[m]I did not know LoadError was private API15:52
tlater[m]But I believe it to be a generic BstError15:52
tlater[m]So you can definitelly catch it as a BstError, in the worst case15:52
tlater[m]If it is private API we should make it public though. If it can be thrown from public API methods, it should not be private15:53
tme5it is buildstream._exceptions.LoadError, so i assumed it's private? is that what _ means?15:53
tlater[m]Yep15:54
tme5BstError is also private15:54
tlater[m]I've not written many plugins myself, so I rarely face that problem; don't know the API surface that well.15:54
tlater[m]Yep15:54
tlater[m]I'd say, mailing list post complaining about LoadError being private15:54
coldtomI believe that they are public at the `buildstream` level though, aren't they?15:54
tlater[m]Is the way to handle this15:55
tlater[m]coldtom: Any module that starts with _ is private15:55
*** narispo has joined #buildstream15:55
tlater[m]"private" in BuildStream terminology means "only use this within buildstream"15:55
tlater[m]If you're writing an external plugin, we don't guarantee that anything you access through a _ will stay there15:55
coldtomah, my brain broke and thought it'd seen BstError used in plugins before, but ofc it was ElementError or SourceError15:55
tpollardplugin.py has public api that can raise LoadError15:57
tlater[m]Yeah, that's definitely an oversight15:57
tlater[m]We should make LoadError public, or wrapper that15:57
*** narispo has quit IRC15:57
gitlab-br-bottmewett opened issue #1248 (Some public API functions can raise private LoadError exception) on buildstream https://gitlab.com/BuildStream/buildstream/issues/124816:09
*** phildawson_ has joined #buildstream16:31
*** phildawson has quit IRC16:33
tme5i suppose I ought to have added my recurse submodule change to the changelog?16:58
tpollardin NEWS yep17:00
tpollardeasily missed though17:00
tme5alright, i'll add that in a separate MR some time17:21
benschuberttme5: ^ any reason why you would need catching LoadError?17:23
tme5i'm trying to allow a config option to be one of two types17:24
tpollardjuergbi: updated it with a generic exception17:24
benschuberttme5: https://buildstream.gitlab.io/buildstream/buildstream.node.html#buildstream.node.MappingNode.get_node is that not enough? Or do you have other requirements?17:25
benschubertI'm happy improving the node api to extend it if needed17:25
tme5do I then just check the class type of the returned value?17:26
benschubertyup17:26
tme5what if I have further requirements, like that the scalar is a bool, or a sequence that is a str list?17:27
benschubert(unless you have a better idea for this, but since it can be two different types, not sure what else can be done?)17:27
benschubertyou can do:17:28
benschubertnode = mapping.get_node("key", allowed_types=[ScalarNode,SequenceNode])17:28
benschubertif type(node) is ScalarNode:17:28
benschubert   value = node.as_bool()17:28
benschubertellse:17:28
benschubert  value = node.as_str_list()17:28
benschubertAnd it would throw if it is misformed17:28
tme5ah, yeah that would work i think, thanks17:30
tme5though i still think exceptions thrown by public API functions should be public17:30
benschubertThe reason for this one not to be public, is that we don't want plugins to start catching and throwing their custom errors, that way we can ensure that all errors of bst file formats are consistent :)17:35
tme5that seems sensible17:43
tme5although, it won't stop people in the wild from just putting the methods in try-except blocks anyway17:44
benschubertThat's correct17:45
tlater[m]benschubert: Are we trying to prevent others from implementing BstError?17:45
benschubertAs it won't prevent them from changing any parts of BuildStream, it's python so we have to live with that. I just believe that the 'official' stance should be restrictive and guiding enough so that most users get a good experience :)17:46
tlater[m]Or is this about custom LoadErrors?17:46
benschuberttlater[m]: correct, BstError is a BuildStream exception, not something for plugins, they have ElementError and SourceError17:46
benschuberttlater[m]: correct17:46
tlater[m]Ah, yes, ok.17:46
tlater[m]I'd like to see those exceptions wrappered into Element/SourceErrors17:46
tlater[m]Because then plugins can use them properly17:46
tlater[m]Because even if they aren't part of public API, they are still being thrown from public API17:47
benschubertElement and Source errors are for plugins to extend and implement, not really to catch :)17:47
tlater[m]And it's hard to work with that if you can't catch those exceptions17:47
benschubertWhy? All the methods should be there to be able to work with them consistenly _unless_ they have a format error17:48
benschubertand that's not for plugins to handle, that's for BuildStream17:48
tlater[m]Plugins may still want to handle format errors17:49
tlater[m]For reasons like the above, or version deprecation or such17:49
benschubertWhy? In which case?17:49
tlater[m]Even if it's just modifying the message BuildStream sends17:49
tlater[m]I imagine for example that a plugin may have a "git_tag" option in one version17:49
benschubertFor reasons like above they have apis to get without exception for this17:49
tlater[m]But then two versions down that is deprecated17:49
benschubertand for the other, you can always Node.get_(..., default=...)  and act on the default to say it's deprecated17:50
tlater[m]Hmm17:50
tlater[m]Well, I still don't like that we're essentially leaving plugin authors with exceptions they can't handle.17:50
benschubertWell, there are many that could go wrong, techinically even segfaults if the cython code is not correct17:50
benschubertplugin authors are not meant to handle most exceptions17:51
tlater[m]Is there any way we can make more obvious that this is the goal?17:51
tlater[m]It definitely goes against normal python coding flow17:51
benschubertnot necessarily, many libraries do the same17:51
benschuberthttps://buildstream.gitlab.io/buildstream/buildstream.node.html#node-parsed-yaml-configuration last paragraph tries to convey this17:52
benschubertnot sure how to make it clearer17:52
tme5say "do not catch errors thrown by these functions!" :P17:52
tlater[m]Yep17:52
tme5or "you should not"17:52
benschubertfair , I'll happily review a PR on this or update it when I've got time :)17:53
tlater[m]"Exceptions thrown by these methods are not expected to be handled by plugins; the relevant exceptions are private API"17:53
tlater[m]Might also be handy to note in a plugin writing doc17:53
tlater[m]Not sure we have one17:54
*** tme5 has quit IRC17:56
gitlab-br-bottlater opened MR !1791 (tlater/node-exceptions->master: node.pyx: Add note on node exceptions in plugins) on buildstream https://gitlab.com/BuildStream/buildstream/merge_requests/179118:02
*** slaf_ has joined #buildstream18:21
*** slaf_ has joined #buildstream18:21
*** slaf_ has joined #buildstream18:22
*** slaf_ has joined #buildstream18:22
*** slaf has quit IRC18:23
*** slaf_ is now known as slaf18:23
*** phildawson_ has quit IRC18:36
*** phildawson_ has joined #buildstream18:37
*** tiagogomes has quit IRC18:38
*** jonathanmaw has quit IRC18:47
*** phildawson_ has quit IRC19:34

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