IRC logs for #buildstream for Friday, 2020-06-19

*** benschubert has quit IRC00:09
*** mohan43u has quit IRC02:30
*** mohan43u has joined #buildstream02:30
*** tristan_ has quit IRC05:20
*** tristan_ has joined #buildstream05:38
*** ChanServ sets mode: +o tristan_05:38
*** benschubert has joined #buildstream07:22
*** hasebastian has joined #buildstream07:58
*** santi has joined #buildstream08:42
*** hasebastian has quit IRC09:44
tristan_juergbi, benschubert ... at this point, I'm only adding documentation to !190110:19
tristan_Implementation and tests all in place10:20
tristan_valentind, I expect I will find time to focus on your include related MRs this weekend, can you remind me which ones those are ?10:28
valentind!1951 and !195410:29
valentindMmh, we do not have a bot.10:29
tristan_Yeah10:36
tristan_it's on vacation10:36
tristan_furlough10:36
*** tristan_ is now known as tristan11:09
tristanOk, https://gitlab.com/BuildStream/buildstream/-/merge_requests/1901/ <-- no longer WIP, ready for review :)11:19
tristanjuergbi, please when you get a chance11:19
juergbita, will review11:20
tristangah, looks like I have a crash generating the examples11:23
tristanAnyway, that is rather unrelated to the branch, I will fix it, but please don't let that block any review :)11:24
tristanunfortunately, it means I cannot link to a preview of the reference manual changes until that is fixed11:24
tristanif this is an example about junction coalescing, I would prefer to remove it completely, and re-add other examples in a later commit11:25
* tristan wants to add a whole chapter to the user manual discussing reconciliation of conflicting junctions in one go11:25
tristanIf that's alright11:25
tristanjuergbi, benschubert... anyone want to do the honors of closing https://gitlab.com/BuildStream/buildstream/-/merge_requests/1613 ?11:40
tristanbenschubert, from our conversation about pickle jobbers, I think my reading of your statements is that that issue should be closed.11:41
*** tristan has quit IRC11:48
*** tristan has joined #buildstream11:52
*** ChanServ sets mode: +o tristan11:52
tristanHmmm, actually there is no bug in the examples11:53
tristanjuergbi, we seem to still have casd race conditions, I'm seeing "IsADirectoryError: [Errno 21] Is a directory: 'cas-tmpdir1bvRoF'"11:53
tristanin https://gitlab.com/BuildStream/buildstream/-/jobs/602819791 when building docs11:54
tristanhttps://buildstream.gitlab.io/-/buildstream/-/jobs/602869360/artifacts/public/elements/junction.html <-- new Junction docs12:15
tristanhttps://buildstream.gitlab.io/-/buildstream/-/jobs/602869360/artifacts/public/format_project.html#project-junctions <-- New junctions related project.conf docs12:15
*** benschubert has quit IRC12:20
*** hasebastian has joined #buildstream12:24
*** hasebastian has quit IRC13:54
*** hasebastian has joined #buildstream13:55
douglaswinshipin the 1.9x plugin API, is there a method for changing a file's permissions?15:43
douglaswinshipI'm trying to update a plugin to work in 1.93.415:43
douglaswinshipAnd there's a line in the original version of the plugin. "os.chmod(filename, 0o755)"15:44
douglaswinshipIt's the only one I can't see how to update.15:44
douglaswinshipI don't see any directory method that addresses file permissions, in https://docs.buildstream.build/master/buildstream.storage.directory.html15:44
WSalmonumm, i think you can only set the exicute bit15:46
WSalmonthe "underlying filesystem" has effectively changed so im not sure how easy that is going to be todo15:47
WSalmonjuergbi, ^15:47
juergbidouglaswinship: WSalmon is correct in that currently only the executable bit is stored at all. is it the executable bit you want to set/clear or do you need something else?15:48
juergbibased on the chmod line, I assume setting the executable bit is what you need15:48
juergbithat's unfortunately indeed not supported yet by the Directory API15:49
douglaswinshipjuergbi: unfortunately, I don't know what the original requirement is. So all i know is that 0o755 would be acceptable. I don't know which bits are actually essential. In the mean time though, if the executable bit(s) are the only ones I can set, then I might as well set those.15:50
juergbithe only way would be to use import_single_file() to import an executable from the filesystem (can be a temp file) that has mode 075515:50
douglaswinshiphow would I set the executable bit(s)15:50
douglaswinshiphrmmmm, interesting.15:50
douglaswinshipHow would I create the temp file in the first place. Just use the standard temp-file functions?15:51
juergbiyes, NamedTemporaryFile should work15:51
juergbi(there are also buildstream utils helpers for temp files but they are not public)15:52
juergbihm, actually, there might be another option15:52
WSalmondouglaswinship, do you have a link to the plugin, i would gues that its just the exercute bit thats important, juergbi is it really not part of the API, surely thats a oversite? can we just add it?15:52
douglaswinshipAnd then use import_single_file? Interesting. I assumed that import-file would only work for files that were already inside the project directory. Like when using a 'local' source.15:52
WSalmonif this fix is easy then lets do that for now, but would like to do this properly sooner rather than later15:53
juergbidouglaswinship: you can use os.fchmod(f.fileno(), 0o755), see https://gitlab.com/BuildStream/bst-plugins-experimental/-/blob/master/src/bst_plugins_experimental/elements/dpkg_deploy.py#L27415:53
douglaswinshipWSalmon: it's in the collect_initial_scripts plugin15:54
douglaswinshiphttps://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/blob/master/plugins/elements/collect_initial_scripts.py#L5015:54
WSalmonah ok so it looks like https://gitlab.com/BuildStream/bst-plugins-experimental/-/blob/master/src/bst_plugins_experimental/elements/dpkg_deploy.py#L272 this patten should be fine for what you want15:55
WSalmonbut im still curious as to why the plugin api wont let use simple add exicute15:55
douglaswinshipWell that looks like it'll fix the issue.15:57
douglaswinshipIt's odd though. Isn't that bypassing the whole 'virtual' part of the virtual directory, and reaching down into the underlying system? I'm surprised it works.15:57
douglaswinshipIt does work though. The element builds :)15:59
WSalmondouglaswinship, no, debiandir is a virtual dir and when you do debiandir.open_file you are making a speceal thing that is not a file in a realdiretory called debiandir15:59
douglaswinshipbut there's a real file somewhere, right? That must be what os.chmod is operating on?16:00
juergbiyes, the files are real, it's just the directory that is virtual16:01
juergbiand files can't be modified after creation16:01
juergbi(but can be replaced)16:01
douglaswinshipbut by getting the fileno() output, doesn't that mean we're getting information about the underlying file?16:01
douglaswinshipThat's what I meant about undermining the 'virtual' part of the virtual directory api16:02
juergbiyes, we probably should think about whether we actually want to keep allowing that16:02
douglaswinshipgood idea16:02
juergbihowever, as it's only available in a limited context, it should be safe16:02
WSalmonjuergbi, i presume this work with RE? i presume after the plugin has done its stuff then casd will notice the execution bit?16:03
juergbithe newly written file won't actually be in the directory until the end of the context manager is reached16:03
douglaswinshipbut as WSalmon says, I guess we should wait until we've implemented a chmod function of our own, before we close it out.16:03
juergbiWSalmon: yes, with buildbox-run we anyway use the same code path for local and remote execution in this regard16:03
WSalmonah yes so you are doing the chmod in side `with debiandir.open_file(script, mode="w") as f:` i see16:04
WSalmon:d16:04
WSalmon:D16:05
WSalmonthanks juergbi16:05
juergbiWSalmon: we should still add a function to change the executable bit. have to think about what API makes most sense, keeping in mind that we probably want to support additional permission bits in the future16:05
WSalmon`keeping in mind that we probably want to support additional permission bits in the future` you know me too well! hehe16:05
WSalmon+116:05
*** santi has quit IRC17:45
*** hasebastian has quit IRC18:03
tristanDo we really want plugins to be manipulating file attributes using python code at all ?18:04
tristanMy thoughts were that, we just want to preserve as much as possible of what happened in a sandbox, and add some requirements APIs (sandbox config extensions) asserting required attributes18:05
tristanletting chmod or whatever do the work inside a sandbox18:05
tristanWhile on the one hand, allowing a directory API to go and modify attributes appears to be harmless (at least for permission bits), it's a short stride from attributes to content, and we certainly don't want python code in plugins to modify/create content in artifacts (because the python code itself is not safe and guaranteed deterministic, like a sandbox is protected)18:07
tristanBut on the other hand, when we get to xattrs, people can be recording meaningful (and parsable) data in those attributes, and that strays into the 'content' territory too18:08
*** xjuan has joined #buildstream20:10
*** xjuan has quit IRC22:47

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