IRC logs for #buildstream for Wednesday, 2020-09-23

*** tristan has quit IRC02:21
*** tristan has joined #buildstream02:44
*** ChanServ sets mode: +o tristan02:44
juergbitomaz: based on the log it seems to be using build tools from /cross/x86_64-unknown-linux-gnu. the default include path of that compiler might be something in /cross and not /usr/include06:24
juergbiif you need more details, #freedesktop-sdk is probably a better place to ask06:25
tristanSo a Digest is a remote_execution_pb2.Digest ? Couldn't we have a toplevel __init__.py somewhere where we can import important types which we interface with from the core ?06:52
* tristan is enjoying mypy06:53
juergbithe toplevel __init__.py would be public, though07:16
juergbitristan: I've discovered an interesting bug (I think) with the filter plugin07:17
juergbiif `pass_integration` is set, it assumes the underlying element is always available in the cache when integrate() is called on the filter07:18
juergbieven though the underlying element is a build-only dependency07:18
juergbias it calls integrate on the underlying element, which attempts to get public data07:19
juergbiI think the proper solution is to copy the integration-commands from the underlying element into the filter element at assemble time07:20
juergbitristan: does this make sense to you or am I missing something?07:20
juergbi(and stop overriding core Element.integrate() in Filter)07:21
tristanInteresting07:23
tristanIs that the simplest way for a filter element to behave in the way people wanted it to behave ?07:24
tristanAs I recall, a filter is mostly a "pass-through" element, commands are routed to the element it filters07:24
tristanIn the dependency graph the filtered element is build-only indeed, but for anything to work, it would seem imperative that the filter element be present07:25
tristanMaybe not it's artifact07:25
tristanjuergbi, You are either missing something, or it is a larger problem than just this.07:26
tristanWe're talking about public data here07:27
juergbitristan: redirect/pass-through is only used for track and workspace commands07:27
juergbiin all other cases it acts as standalone element07:27
tristanWe're talking about inheriting public data from the filtered element... that is an element which is out of scope for a reverse dependency07:28
juergbiI see the issue for bst artifact checkout with the default runtime dependency selection07:28
tristanOk no it's not more complex than this07:28
tristanI think that; it's public data we should be thinking about: Not integration commands specifically07:28
tristanjuergbi, I was worried, and maybe it's still a relevant worry ? ... that if build-only dependencies are not present, is there data we could be missing ?07:29
tristanOnce an element has been built, we no longer need the artifact in some cases, in those cases, is it still possible to need the public data ?07:29
tristanI think, hope not: No.07:29
juergbisame here07:30
juergbimy branch with explicit cache queries would definitely detect such issues if there are more07:31
juergbiregarding just integration commands vs. all public data: right now we only have a pass-integration flag in the filter element07:32
juergbimaybe that needs to be extended/generalized? not sure07:32
juergbihowever, this can be considered afterwards. I think we can retain the current behavior and just fix the cache issue by copying integration-commands in Filter.assemble()07:33
juergbithat said, maybe it is worth thinking about the whole thing before07:34
tristanIt's a bit of a tough call, maybe it needs to be granular indeed07:38
tristanI can imagine you want to filter an element, and maybe redefine split domains at the same time07:38
tristanjuergbi, I would certainly be happy with your suggested fix in advance of anything else though07:38
tristanWhat's the story with SourceRef anyway ?07:39
juergbiok, will try to fix this and write a test for it07:39
tristanHow come it doesnt have _SourceRef if it's gonna be private ?07:39
* tristan overlooks this shortcoming for now07:40
tristanMaybe it's a good idea to make SourceRef a strong type in the API I don't know07:40
juergbiit is indeed already used in public API07:40
juergbie.g. return type of Source.get_ref()07:40
tristanBut allowing plugins to reach into the guts of buildstream to import it from buildstream.types, _only_ so that they can run mypy, is not good07:41
tristanExactly07:41
tristanit's either a thing or it's not, though07:41
juergbiis this also rather a historic definition?07:41
tristanit's in the mypy decorations and that's it, I don't know if that makes it public, or if the mypy decorations need to be fixed07:41
tristanUmmm, definition of what ?07:42
tristanThe ref ?07:42
juergbicould it just be Dict[str, Any] ?07:42
tristanIt can really be any of the Union afaict07:43
juergbioh, the definition is even incorrect, afaict. plain `str` is also used by plugins despite not being allowed07:43
tristanIndeed07:43
tristangood point07:43
juergbicould it be a Node instead?07:43
juergbithat might be problematic to construct, I suppose07:44
juergbibut conceptually that's pretty much what it needs to be, isn't it?07:44
tristanA Node ?07:48
tristanWell07:48
tristanThat depends07:48
tristanAre we happy enough with mutable public data ?07:48
tristanI don't know, what is your feeling about that ? Can we trust it ? ...07:48
tristanTrying to think realistically about how much we can corner plugins and disallow them from manipulating data07:49
tristanPeople *are* composing lists and dicts and blobs of data in public data, passing them on to other plugins, which consume these and "do stuff" with them07:49
tristanAll of this is outside of the sandbox07:49
tristanNow that we've sealed off runtime dependencies07:50
tristanAnother point, is that we still don't have an assert afaics, ensuring that Element.get_public_data() is *never* called outside of Element.{stage,prepare,prepare_sandbox,assemble}()07:51
tristanI.e. "build time": the only time when an element can be sure that public data is prepared and ready07:51
tristanAll bets are off if you call Element.get_public_data() inside Element.configure_dependencies() or Element.preflight() or Element.get_unique_key()07:52
tristanAnd all of that is because public data decided to be mutable.07:52
tristanjuergbi, If public data becomes immutable; I would say we remove all that side of Node API, and as such, a unique key is certainly not a Node (as a Node would really be a readonly YAML configuration loading mechanism)07:53
gitlab-br-bottristanvb opened MR !2072 (tristan/remove-bst-key-requires-stage->master: source.py: Remove BST_KEY_REQUIRES_STAGE) on buildstream https://gitlab.com/BuildStream/buildstream/-/merge_requests/207207:54
juergbiI don't think these two aspects are that related. ideally a ref is indeed an immutable object. however, dicts are also mutable, so not as different07:54
tristanWell07:55
juergbimaking public data immutable would fix the filter issue, though, afaict07:55
juergbias then get_public_data() would not require the artifact to be available07:55
tristanIt would require a Node to support from_dict() and such at least07:55
tristanWhich is just a hoop for a plugin to jump through, if they already have a dict (or 2 hoops if they have an 'str')07:56
juergbiyes, Node as ref type might indeed not be the best choice but I think this discussion is separate from public data07:56
tristanI think that was 2 discussions ago07:56
tristanOh no sorry got mixed up07:56
tristanSure, it's separate from public data, I do feel that public data being immutable (or more accurately read-only) is more of a cause for it to be an inappropriate choice07:57
tristanbut that's just... meh, I think make SourceRef public would be acceptable too07:57
tristanJust the current definition is a mess for SourceRef07:58
tristanit says it's private, omits it's underscore, neglects to be imported in toplevel __init__.py (the public API source of truth), doesnt have a docstring, yet plugins access it in violation of it's privateness07:59
tristanjust a mess :)07:59
tristanAnyway, !2072 might pass tests, it's a nice little refactor (that we discussed yesterday)07:59
tristanI found a single context manager was more effective than 2 APIs08:00
tristanWith self._cache_directory() as directory:  ... put stuff in directory, and directory._get_digest() ...08:00
tristanWith self._cache_directory(digest=self._digest):  as cached_directory:  ... directory.import_files(cached_directory) ...08:01
juergbitristan: the _is_trackable call needs to be removed from trackqueue, afaict08:03
juergbithe context manager lgtm08:03
juergbiI'm not happy about the duplication between local and workspace but it's not that much, and I definitely like the reduction of conditionals in core code08:06
juergbiwondering whether a common base class to LocalSource and WorkspaceSource would be worth it08:07
juergbiprobably not08:07
tristanoops, was just thinking that as I stepped out to smoke (_is_trackable())08:08
*** santi has joined #buildstream08:44
gitlab-br-bottristanvb opened (was WIP) MR !2068 (tristan/fix-overnight-tests->master: .gitlab-ci.yml: Use ported plugins and fdsdk for overnight tests) on buildstream https://gitlab.com/BuildStream/buildstream/-/merge_requests/206808:52
gitlab-br-bottristanvb approved MR !2068 (tristan/fix-overnight-tests->master: .gitlab-ci.yml: Use ported plugins and fdsdk for overnight tests) on buildstream https://gitlab.com/BuildStream/buildstream/-/merge_requests/206808:52
tristanDamn, the refactor is failing integration tests for workspaces... lets see08:58
* tristan hoped he could get this little refactor out of the way in a matter of an hour or two...08:59
gitlab-br-bottcanabrava opened issue #1396 (Add a way to force a local build) on buildstream https://gitlab.com/BuildStream/buildstream/-/issues/139609:08
gitlab-br-botjuergbi opened MR !2073 (juerg/filter-pass-integration->master: filter.py: Combine integration commands in assemble()) on buildstream https://gitlab.com/BuildStream/buildstream/-/merge_requests/207309:48
tristanjuergbi, I'm having a hard time with this strange side effect of the patch: It seems that files are staged without write permission (at least where workspaces are involved), any clue what could result in staged files missing their permissions ?10:02
tristanInterestingly, FileBasedDirectory says "if executable: os.chmod(very verbose version of 755)", without any "else: os.chmod(verbose version of 644)"10:07
tristanAh, I get it10:13
tristanThe way it was working before, it kept using the real stage method when opening a workspace10:13
tristanStill, this seems to indicate a deeper problem: that writable bits are getting lost somewhere while importing files into cas and then exporting them to FileBasedDirectory10:14
juergbiwe don't currently store writable bits10:28
juergbithis should be considered as part of #3810:28
gitlab-br-botIssue #38: Lost file metadata in artifacts and images https://gitlab.com/BuildStream/buildstream/-/issues/3810:28
gitlab-br-botmarge-bot123 merged MR !2068 (tristan/fix-overnight-tests->master: .gitlab-ci.yml: Use ported plugins and fdsdk for overnight tests) on buildstream https://gitlab.com/BuildStream/buildstream/-/merge_requests/206810:28
juergbiindividual permission bits don't really make sense without the rest, imo (except for the executable bit)10:28
tristanjuergbi, if we don't consider them, then I believe they are either 0644 or 075510:29
tristanNot read-only10:29
juergbiI think we should indeed export them as one of those two, yes. or rather, 0666/0777 & ~UMASK10:30
tristanSurely, at build time, we don't stage files and build with -r--r--r--10:30
tristanthat sounds prone to failure, all read-only files10:30
juergbiat build time that would be dealt with by buildbox. we just hand the CAS tree without those extra permission bits10:31
juergbihowever, for the non-FUSE case where we use hardlinks, they will have to be read-only10:31
tristanjuergbi, Not & ~UMASK I think, unless umask is hardcoded in BuildStream (or BuildBox) of course10:31
tristanI recall adding tests to ensure that file permissions were not susceptible to host umask10:32
juergbias part of the build we definitely want it to be as deterministic as possible10:32
tristanAt workspace checkout perhaps host umask makes sense10:32
juergbihowever, for bst artifact checkout umask can make sense10:32
tristanthat too10:33
juergbibtw: buildbox-fuse always sets the mode to 0644 or 075510:33
juergbii.e., builds with buildbox-fuse should be identical to what we had before buildbox10:33
juergbihowever, without fuse it's not really possible, unfortunately10:34
tristanjuergbi, anyway I've updated !2072 by restoring the old behavior for local source workspace open, with a FIXME comment10:34
gitlab-br-botMR !2072: source.py: Remove BST_KEY_REQUIRES_STAGE https://gitlab.com/BuildStream/buildstream/-/merge_requests/207210:34
tristanjuergbi, I think it just seems odd to me that (A) cache in CAS... (B) Checkout to local FS, results in read-only files for regular files10:36
tristanI think that it would make sense to tack on that extra else clause in FileBasedDirectory(), assuming that is the thing that is only used for artifact checkout and workspace open10:36
juergbiyes, I thought for checkout (with copies, not hardlinks) we create 0644/0755 files (or possibly umask-based)10:37
tristanI guess not workspace open for other things either, but it *should* think, you should be able to open a workspace on sources in the CAS which you never downloaded10:37
tristanjuergbi, if artifact checkout is implemented as `FileBasedDirectory(external_directory=checkout_dir).import_files(the artifact files)`, then we'll have read-only files10:38
* tristan is at the end... will be running now...10:38
juergbiit uses export_files()10:39
juergbiwhich uses safe_copy with copystat=False10:40
juergbithat should result in creation of writable files10:40
tristansounds strange... no time to try to figure out the justification of having both import_files and export_files (at surface value, looks like only one of those should be needed, just use the right abstraction to import *to*, differing implementations here could be a source of bugs)10:42
* tristan escapes...10:42
*** tristan has quit IRC10:45
robjhhi gang, anyone have any idea which piece of the buildstream puzzle is broken here? https://gitlab.com/CodethinkLabs/lorry/lorry-buildstream/-/jobs/75342088814:18
robjhlooks like its more remote cache issues?14:18
juergbirobjh: the NOT_FOUND message is wrapped in an UNKNOWN error for some reason. not sure whether that's due to a bug in buildstream (1.4) or a server issue14:38
juergbiI don't recall seeing "Exception iterating responses: <_MultiThreadedRendezvous" before14:39
robjhwell, apparently the cache server has a failing ssd. i dont know what the nature of the failures is, but I think its probably not worthwhile to try and diagnose this while the hardware is faulty14:45
robjhi do think it would be more sensible for buildstream to treat failing to retrieve from the cache as if it were a cache miss instead of outright failing though14:46
tomazhey, if I'm on xterm or gnome-terminal or whatever terminal, how can I determine if I'm on a buildstream shell or the local shell? (programatically)15:01
juergbirobjh: we discussed yesterday that it would make sense to fall back from pull to build even for unexpected failures as long as we still mark the pull job as failed (not skipped) in that case15:01
tomazI'm doing some tests and I need to be able to say "I'm on my local bash", "I'm on my bst bash"15:02
juergbiin interactive mode, it would be up to the user ('continue' would trigger the fallback to local build)15:02
juergbiotherwise it would depend on the --on-error setting15:02
juergbitomaz: hm, not sure whether there is a clean way to do this. could potentially check mounts or the PID tree but I don't know a good check off the top of my head15:04
tomazjuergbi: cool, thanks. :)15:14
juergbitomaz: ah, actually, the hostname could be an option15:14
juergbiin master with buildbox-run-bubblewrap the hostname is always `buildbox`15:15
juergbiand iirc, in buildstream 1 it was always `buildstream`15:15
tomazah, that's perfect, thanks.15:27
tomaz<315:27
*** WSalmon has quit IRC17:13
*** WSalmon has joined #buildstream17:14
*** santi has quit IRC17:41
*** benschubert has joined #buildstream18:06
*** tomaz has quit IRC19:20
*** lchlan has quit IRC20:50
*** jjardon has quit IRC20:50
*** benschubert has quit IRC20:50
*** jward has quit IRC20:50
*** lchlan has joined #buildstream20:50
*** benschubert has joined #buildstream20:51
*** jjardon has joined #buildstream20:52
*** ChanServ sets mode: +o jjardon20:52
*** jjardon has quit IRC20:53
*** jjardon has joined #buildstream20:53
*** ChanServ sets mode: +o jjardon20:53
*** jward has joined #buildstream20:53
*** benschubert has quit IRC22:04
*** benschubert has joined #buildstream22:04
*** benschubert has quit IRC22:49
*** jjardon has quit IRC22:49
*** lchlan has quit IRC22:49
*** jjardon has joined #buildstream22:53
*** ChanServ sets mode: +o jjardon22:53
*** benschubert has joined #buildstream22:53
*** jjardon has quit IRC22:54
*** lchlan has joined #buildstream22:54
*** jjardon has joined #buildstream22:54
*** ChanServ sets mode: +o jjardon22:54

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