IRC logs for #buildstream for Sunday, 2018-03-25

*** toscalix has quit IRC02:03
*** tristan has joined #buildstream07:13
tristanjuergbi, around ?07:37
juergbitristan: yes07:37
tristanSo one thing which was missed in jmac's branch I want to add to that before landing and tying up a release, is that the new SandboxConfig fails to contribute to an element's cache key07:39
tristanI was writing up a quick patch to add on top for that... and I just wondered whether we should A.) Retain compatibility of cache key algorithm for this, in the case of default sandbox config... or B.) Just bump the artifact version and have a nicer cache key calculation, without any branching07:40
tristanjuergbi, What I'm thinking is also... we have already added 'execution-environment' to the element cache key - with the thought in mind that we would eventually delegate this to sandboxes07:41
tristanSo I'm thinking, add SandboxConfig.get_unique_key() and move over the os/arch stuff to SandboxConfig07:42
juergbiright, that makes sense07:43
juergbidon't know how painful cache key changes are for the average user07:43
tristanI guess I could retain compatibility with an added if in SandboxConfig.get_unique_key(), very low cost if07:43
tristanYeah ok I'll roll with that for now and not bump the artifact version07:44
* tristan hopes that os.uname() already returns a cached value from python07:45
juergbii.e., keep calling it execution-environment?07:45
tristanyeah if we keep calling it execution-environment in the unique key dict, it doesnt break anything07:45
tristanwhile being just... a bit unattractive hehe07:45
juergbiwell, it's not really a bad fit07:45
juergbiwe may need to think about canonical arch names but not an issue now07:47
tristanright, that doesnt change with this branch07:48
tristanjuergbi, any preference of adding _get_cache_key() over _get_unique_key() to SandboxConfig ?07:55
tristanjuergbi, I sort of prefer _get_unique_key() and let the hashing algo run only once07:56
tristan(or less times)07:56
tristanHrrrrmmmmm08:01
juergbitristan: you want to individually hash the execution environment dict?08:01
juergbithat would change the cache key, though08:01
tristangood point08:01
tristanin fact, i exactly *dont* want to do that08:01
tristanjust that I see project and context are doing that (with nothing to say, on top of it)08:02
tristananyway08:02
tristanMy Hrrrrmmmmm, is deb source; this does something weird08:02
juergbiproject/context: conceptually it makes sense avoiding recalculating the hash all the time08:03
juergbibut it's indeed pointless right now08:03
tristanRight, ah good point they are less plentiful than sandbox configs, which are per element08:03
tristanSo, deb source is not doing try/except in preflight for `import arpy`08:04
tristanand reporting a sensible SourceError at preflight08:04
tristanalso, the test case is not conditionalized on HAVE_ARPY08:04
tristanwithout that; BuildStream grows a sort-of hard dependency on arpy, which is wrong08:04
* tristan will open an issue for that and install arpy locally in the meanwhile08:05
tristanlooks like at *least* it wont explode at load time when running a pipeline that doesnt use the deb source08:07
tristana bit strange that it doesnt explode, but seems not to08:07
gitlab-br-botbuildstream: issue #317 ("New deb source arpy dependency is too hard") changed state ("opened") https://gitlab.com/BuildStream/buildstream/issues/31708:13
tristaneh, maybe I'll just take care of #317 now, deb source addition also missing from NEWS, I wanna make a release today and rather not with the arpy hard dep08:34
juergbitristan: doesn't the ImportError handler in the plugin loader already take care of this?08:38
juergbiError loading pipeline: Failed to load Source plugin 'deb': No module named 'arpy'08:38
juergbidoesn't look like a bad error message to me08:38
juergbiI forgot about conditionalizing the tests08:40
gitlab-br-botbuildstream: issue #318 ("Cache key test is incomplete") changed state ("opened") https://gitlab.com/BuildStream/buildstream/issues/31808:41
tristanjuergbi, relying on that would be... weird honestly - if that is what the user is seeing, the user is seeing something incorrect which needs fixing.08:42
juergbiI don't see the issue in this error message, tbh08:43
tristanjuergbi, i.e. an unhandled exception (an exception which has not been transformed to a BstError), is a bug, and the user should see a stack trace, either directly on the terminal, or in a BUG message08:43
juergbiarpy is a hard dependency of the deb source plugin, so why can't we bail out at plugin load time?08:43
tristanWe could bail out at load time, but it would be better to not do so with an unhandled exception08:44
juergbiit may not have been intentional that the exception is handled but i don't see an issue with the end effect08:44
tristanjuergbi, I dont disagree, however if there is ambiguity in the policy around this, that is more of a problem to me08:46
tristanI dont think we have precedent for plugins which blind import something that is not covered by BuildStream's hard dependencies08:46
juergbiostree with unix backend?08:47
tristanDoes that happen ?08:47
tristanThat would be a bug, I think08:47
tristanDo we see a stack trace for it ?08:47
juergbiI haven't tried08:48
juergbibut theoretically, you can use the unix backend on linux08:48
juergbiwith an element that has an ostree source08:48
tristanNot legally08:48
juergbiok but ostree could theoretically be available on other systems08:48
tristanThat is a hack we have for tests in the absence of a non-linux testing platform08:48
juergbior you could simply attempt to build a project that uses an ostree source on a non-linux system08:49
juergbierror message should make sense then as well08:49
tristanjuergbi, Ok well - if we have policy that python imports at toplevel can bail out at plugin load time, so be it08:50
tristanThis should be explicitly handled somewhere, which I figure it must be if you are not seeing a stack trace08:50
juergbithe plugin loader catches ImportError08:50
juergbiplugincontext.py:load_plugin08:51
tristanload_plugin() has except there yes08:51
tristanjust looked at that08:51
juergbimaybe it was only meant for import error of the plugin itself08:51
juergbihowever, I don't see any harm using it for dependencies the same way08:52
tristanto be honest, that except has a long history, and I feel that represents more of an unhandled error, than an informative message telling the user how to rectify the problem which BuildStream encountered08:52
tristanWhile could allow it as a matter of robustness, it seems nicer to have a more explicit error for plugin dependencies08:53
tristanA programmer, especially one familiar with python, might understand: Error loading pipeline: Failed to load Source plugin 'deb': No module named 'arpy'08:54
juergbiok, fair enough08:54
juergbitheoretically, we should also fix ostree, then08:54
juergbiotherwise attempting to use it on non-linux you get:08:54
juergbiError loading pipeline: Failed to load Source plugin 'ostree': No module named 'gi'08:55
tristanIndeed08:55
tristanThere are other options, like policy of conditional installation of plugins, but that seems unreasonable08:55
tristanI.e. that would be a nightmare for distros eventually packaging BuildStream08:55
juergbiand we should probably change the ImportError handler to only catch the error if it fails to load the plugin itself08:55
juergbia distro might move the plugin to a separate distro package08:56
juergbiprobably better not to, though08:56
tristanYeah that's what I mean, it would be: A.) Just as difficult for us to handle this at install time as to fail gracefully as a matter of policy... B.) Much more unneeded work downstream08:57
juergbiI'm wondering whether we could provide a more sensible error message in plugincontext08:59
juergbiI don't really like the idea of forcing plugins to not have any 3rd party imports at the top leve08:59
tristanI dont think that I expected that error to be raised due to a missing dependency09:00
tristanrather, it may happen for a syntax error09:00
tristannot sure what conditions can cause that import error to occur09:00
juergbisure, but maybe we can figure out the reason for the import error and provide suitable error message or BUG as appropriate09:01
juergbito make plugin author life slightly simpler09:01
tristanRight, we might turn that into raising another unhandled error `from e`, which is more informative to the plugin author09:02
juergbidon't know how much of a concern this is in practice, were just some random thoughts09:02
tristanif they get a stack trace09:02
juergbifor something like syntax error, yes09:03
tristanI added all of those PluginErrors to test for our loading of invalid plugins09:03
juergbiand for import error of dependency (if we can detect that), we could supply a user-friendlier message how to install the missing dependency and not burden the plugin author having to do this themselves09:03
tristanI.e. AttributeError and TypeError below, come with some test cases of badly written plugins09:04
tristanIt may be that we just want to make PluginError no longer inherit from BstError09:04
juergbiright, that's nice09:04
tristanIt adds some informative context of what BuildStream saw, and still gives the plugin author the full trace09:04
tristanRight, we could enhance that error a bit...09:05
tristanjuergbi, except that for ostree we probably want something better hehe09:06
juergbiyes, gi is trickier :/09:06
juergbiso maybe it's not worth it after all, at least for now09:06
juergbibtw: ModuleNotFoundError is a subclass of ImportError, so we could have some distinction here. and there is a name attribute so that we could check whether the name is the plugin itself or a dependency09:07
tristanThe ImportError will provide some interesting members we could use to do something generic and helpful, like "This plugin failed to import module `foo`, please install it with pip or using your distribution package manager"09:07
juergbiyes, that's what I was thinking09:07
juergbinot really urgent, though09:08
tristanWe wouldnt be able to really distinguish this for say... a package of plugins which imports something like _downloadablefilesource.py from .09:08
juergbiwell, there is a path attribute, not sure how that's populated09:08
tristanbut eh...09:08
juergbianyway09:08
tristanyeah, that's going a bit too far anyway09:08
juergbithe urgent thing is to add the missing test skip09:08
juergbiimo, improving the error message for people actually using deb is not a release blocker09:09
juergbii.e., we could consider fixing that in a more generic way later09:09
juergbiup to you09:09
gitlab-br-botbuildstream: merge request (jmac/build-uid-2->master: Sandbox configuration key to specify uid/gid for sandbox) #318 changed state ("merged"): https://gitlab.com/BuildStream/buildstream/merge_requests/31809:11
tristanjuergbi, Agree09:11
tristanthat it's not a release blocker09:11
juergbiare you already handling the test skip or shall I?09:11
tristanI hadn't gotten to it yet :)09:12
tristanwas just adding a cache key test for build-uid / build-gid09:12
tristannow merged that part...09:12
tristanjuergbi, I dont mind doing it, it's trivial09:12
juergbiindeed, as you like09:13
tristanjuergbi, but if you do it, I'll try to draft something from our conversation regarding plugin load errors09:13
juergbiok, i'll handle this, then09:13
juergbitristan: do you want to keep #317 open for error message improvement or track that separately?09:21
gitlab-br-botbuildstream: merge request (juerg/arpy->master: Skip deb tests if arpy is not available) #338 changed state ("opened"): https://gitlab.com/BuildStream/buildstream/merge_requests/33809:26
tristanjuergbi, lets track that separately09:35
tristanstrange, it looks as though that test case never even needed `import arpy` in the first place09:37
* tristan wonders why the linter didnt catch that09:37
gitlab-br-botbuildstream: issue #317 ("New deb source arpy dependency is too hard") changed state ("closed") https://gitlab.com/BuildStream/buildstream/issues/31709:38
gitlab-br-botbuildstream: issue #317 ("New deb source arpy dependency is too hard") changed state ("closed") https://gitlab.com/BuildStream/buildstream/issues/31709:38
gitlab-br-botbuildstream: merge request (juerg/arpy->master: Skip deb tests if arpy is not available) #338 changed state ("merged"): https://gitlab.com/BuildStream/buildstream/merge_requests/33809:38
juergbiwe still haven't enabled unused import linter, unfortunately09:38
juergbihopefully we can do this soon09:38
juergbidon't know whether jennis is pjlanning to work on this or not09:38
tristanah09:39
tristanIssue tracker is getting biggish... but it would be nice to have an issue for such todo items09:40
tristanwhenever landing something that needs future work09:40
juergbiindeed, let me open one09:40
gitlab-br-botbuildstream: issue #319 ("Improve error handling at plugin load time") changed state ("opened") https://gitlab.com/BuildStream/buildstream/issues/31909:48
* tristan missed out on listing plugins which could do better... such as deb and ostree09:50
tristanI'll rectify that in #319 now...09:50
gitlab-br-botbuildstream: merge request (juerg/imports->master: Remove unused imports and enable unused-import checker) #339 changed state ("opened"): https://gitlab.com/BuildStream/buildstream/merge_requests/33909:58
tristanjuergbi, nice !10:00
tristanoh docs broke with that ?10:01
tristanhttps://gitlab.com/BuildStream/buildstream/-/jobs/5928732110:01
tristanI think that is easy to fix10:02
tristanjuergbi, that just needs an update to doc/source/invoking.rst10:04
gitlab-br-botbuildstream: issue #320 ("pylint: Enable arguments-differ checker") changed state ("opened") https://gitlab.com/BuildStream/buildstream/issues/32010:04
juergbioh, right, let me fix that10:04
gitlab-br-botbuildstream: merge request (juerg/imports->master: Remove unused imports and enable unused-import checker) #339 changed state ("opened"): https://gitlab.com/BuildStream/buildstream/merge_requests/33910:06
tristanmeh, technically it can be imported directly from buildstream._frontend (we do that for the main entry point, it's in __init__.py), but I dont particularly care enough10:09
tristanjuergbi, if you feel pedantic enough to want to change that... you can, but I really dont mind10:10
tristanotherwise merge10:10
juergbiah, right. can also be done in runcli.py10:11
juergbii'll quickly fix that up10:11
* tristan has a NEWS update for deb, and adding the deb source to docs index; pending10:14
tristanI'll wait for your thing to merge and rebase on top of that first10:14
gitlab-br-botbuildstream: merge request (juerg/imports->master: Remove unused imports and enable unused-import checker) #339 changed state ("opened"): https://gitlab.com/BuildStream/buildstream/merge_requests/33910:14
juergbita10:14
*** valentind has joined #buildstream10:15
tristanjuergbi, any missing NEWS items you would add ?10:22
tristanI think the big things, now that I've added deb, are all accounted for10:22
juergbipylint is probably too internal to be NEWS-worthy10:23
* tristan was thinking that10:23
tristanDid we land the element specific build dirs ? it's something that... nobody will notice, though :)10:24
tristanuntil it becomes useful in a user visible feature10:24
gitlab-br-botbuildstream: merge request (juerg/imports->master: Remove unused imports and enable unused-import checker) #339 changed state ("merged"): https://gitlab.com/BuildStream/buildstream/merge_requests/33910:24
juergbitristan: not landed yet, but should be ready for re-review10:24
juergbi!31010:24
tristanah10:25
juergbibtw: I'm wondering whether we should hold off the release due to #31610:25
juergbidifficult without a reproducer, though10:25
tristanthat is annoying10:25
juergbiinteresting that it happened for compose element. i thought it would be a workspace issue10:26
tristanand workaroundable with --strict10:26
tristanI dont want to hold off on the release for that, it has been around for the greater part of 1.1.1 I think10:26
juergbiyes. if it doesn't happen frequently, it may not be too bad for a devel snapshot10:26
tristanwe just started hitting it10:27
tristanTo me it's making a clean slate for the next sprint, I'm going to focus more on flatpaky stuff10:27
juergbiok10:27
*** ChanServ sets mode: +o tristan10:40
*** tristan changes topic to "/BuildStream 1.1.2 is out ! | https://gitlab.com/BuildStream/buildstream | Docs: https://buildstream.gitlab.io/buildstream | IRC logs: https://irclogs.baserock.org/buildstream | Roadmap: https://wiki.gnome.org/Projects/BuildStream/Roadmap"10:40
*** tristan has quit IRC12:25
*** tristan has joined #buildstream12:30
*** milloni has joined #buildstream13:29
*** milloni has quit IRC13:32
*** milloni has joined #buildstream13:34
*** milloni has quit IRC13:39
*** milloni has joined #buildstream13:43
*** Prince781 has joined #buildstream13:58
*** Prince781 has quit IRC14:19
*** Prince781 has joined #buildstream14:21
*** Prince781 has quit IRC14:45
*** mohan43u has quit IRC15:39
*** mohan43u has joined #buildstream15:39
*** Prince781 has joined #buildstream16:50
*** tristan has quit IRC19:56

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