IRC logs for #buildstream for Thursday, 2017-08-31

*** laurenceurhegyi has joined #buildstream00:29
gitlab-br-botpush on buildstream@format-version (by Tristan Van Berkom): 7 commits (last: element.py: Changing artifact version API) https://gitlab.com/BuildStream/buildstream/commit/2b0ba33947b920d0a91bf8391a2b00ec73d6009603:00
*** tristan has quit IRC03:03
*** jude has joined #buildstream04:18
*** tristan has joined #buildstream04:52
*** jude has quit IRC06:02
*** tristan has quit IRC06:33
*** jude has joined #buildstream07:05
*** bochecha has joined #buildstream07:35
*** jonathanmaw has joined #buildstream08:18
*** ssam2 has joined #buildstream09:00
*** tlater has joined #buildstream09:08
gitlab-br-botbuildstream: issue #80 ("Awkward to recover after manually deleting workspace dir") changed state ("opened") https://gitlab.com/BuildStream/buildstream/issues/8009:51
*** jude has quit IRC10:37
*** jude has joined #buildstream10:42
gitlab-br-botpush on buildstream@cross_platform (by Tristan Maat): 1 commit (last: _sandboxchroot.py: Fix --rbind issues) https://gitlab.com/BuildStream/buildstream/commit/06472332af11dfc381ef0ef6cd49fb62d0076b4212:24
gitlab-br-botbuildstream: merge request (cross_platform->master: WIP: Cross platform) #81 changed state ("opened"): https://gitlab.com/BuildStream/buildstream/merge_requests/8112:24
*** tlater has quit IRC12:30
*** jude has quit IRC12:43
*** jude has joined #buildstream12:45
*** bochecha has quit IRC12:59
*** bochecha has joined #buildstream13:00
*** bochecha has quit IRC13:03
*** bochecha has joined #buildstream13:04
*** bochecha has quit IRC13:09
*** bochecha has joined #buildstream13:09
*** bochecha has quit IRC13:25
*** bochecha has joined #buildstream13:25
*** bochecha has quit IRC13:28
*** bochecha_ has joined #buildstream13:28
*** bochecha_ has joined #buildstream13:29
gitlab-br-botpush on buildstream@cross_platform (by Tristan Maat): 1 commit (last: _sandboxchroot.py: Fix --rbind issues) https://gitlab.com/BuildStream/buildstream/commit/e42ecad09ba06b0848e81cb5ec7600ec2296ad5b14:35
gitlab-br-botbuildstream: merge request (cross_platform->master: WIP: Cross platform) #81 changed state ("opened"): https://gitlab.com/BuildStream/buildstream/merge_requests/8114:35
*** jude has quit IRC14:35
*** tlater has joined #buildstream14:38
gitlab-br-botbuildstream: issue #81 ("Non-empty read-only directories not handled during 'bst build' and others") changed state ("opened") https://gitlab.com/BuildStream/buildstream/issues/8114:40
*** jude has joined #buildstream15:15
*** tristan has joined #buildstream15:21
tristanbochecha_, sorry I would have enjoyed to hand off the compose feature to you but I had already been thinking of it and had started when I saw your message15:25
tristan:)15:25
tristanalso I had to change public API for it and wasnt sure how that was going to go15:26
tristanregarding directory names in split rules, it's a bit sticky; you can have it one way or the other but not both I think (either you can specify a directory inclusively; or just a directory)15:27
tristanI did think of that before and didnt find something easy; maaybe making some exception about how the dir is specified (like trailing / or not) would do ?15:28
tristanrpm spec files have more complex directives around files, we should also consider whether we're going to need more data around this or not15:29
tristantlater, ok so lets talk about what to do with cross platform and staging files15:30
tlaterListening :)15:31
tristanI dont like the conclusions we came to on the post-guadec friday; I was frankly exhausted those last days15:31
tristanSo to summarize the issue... this has to do with the platform's choice of using hardlinks or forcing direct copies in the absence of fuse15:32
tristanWhen fuse is not usable... we cant use hardlink staging for anything that will appear in a writable volume in the sandbox15:33
tristanbecause we cant provide the copy-on-write15:33
tristanOur conclusion was to tie read/write-ness of volumes to the sandbox lifetime15:34
tristanSo that the platform can make one choice, and doesnt start staging hardlinks only to find later that it needs copies15:35
tristanThe problem with that plan though, is that if we change that then performance suffers on the linux case15:35
tristanbecause fuse is always running; so even during builds shared libraries and data from the runtime is being loaded and accessed through a single threaded python fuse layer15:36
tristanSo to fix that there are two approaches I can see since my head got screwed on this morning...15:37
tristan  o Dont remove the existing sandbox for root-read-only-ness, but add something sandbox-lifetime configuration which states that "In this sandbox, root will be read-write at least once"15:38
tristan  o Dont change API at all, but deduplicate hardlinks from the artifact cache the first time that the sandbox has been "run" with root read-write15:40
tristantlater, so far does that make sense ?15:40
tlaterYes, though those still have the issue that not only root can be read-write15:40
tristanRoot is only special in that it can be read-write or read-only15:41
tristantlater, so you haven't dealt with that part yet right ?15:41
tlaterNot yet, no15:42
tlaterBecause /buildstream/{install,build} will always have to be RW15:42
tristanNot true15:42
tlaterUnless we don't build anything, I guess?15:43
tristanall the directories which were marked to be read-write via the sandbox need to be read-write, currently15:43
tlaterAh, right, so I could just add a flag to sandbox.mark_directory that says whether or not to mount read write15:44
tristanI.e. Sandbox.mark_directory()15:44
tristanHmmm15:44
tristantlater, that sounds about right yes15:45
tlaterAnd then whenever anything is staged check whether it lands in a subdirectory of that or root15:45
tristanI can see there is a tricky bit of finding the relation of paths15:45
bochecha_tristan: basing the recursivity on whether the trailing / was specified or not seems like it might be a bit too much magic, and could lead to confusion :-/15:45
tristantlater, if you need to come up with a function for that, it would be nice to have utils.path_is_ancestor()15:47
bochecha_tristan: but maybe BuildStream could grow a syntax for specifying options with paths? e.g /path/to/folder (just the folder) vs /path/to/folder:recursive (the folder and its contents) ?15:47
bochecha_tristan: or dir:/path/to/folder (just the folder) vs /path/to/folder (the folder and its content) ?15:47
tristantlater, for instance; I guess you will be receiving platform->stage_artifact() with a path, and you will need to lookup that location and see what volume it lands on15:47
tristantlater, according to the mappings declared by Sandbox.mark_directory()15:48
bochecha_the second one borrows from rpm's `%dir /path/to/folder`, but the first one has the advantage of being compatible with the existing version15:48
tlatertristan: There's probably a standard algorithm for that, I think I know how to get there now.15:48
tlaterI was confused between marked and staged directories, for some reason I thought they were the same thing.15:49
tristantlater, right okay, and I wanted to ask you; what is the strategy for determining if an element is going to write outside of marked directories ?15:50
tristantlater, I guess that is the crux of it right; it's not so much that root is read-write, it's more that the plugin needs to write outside of marked dirs15:50
tlaterThe user needs to know how their element is built - it should not write outside15:50
tlaterOr, if it should, the user needs to explicitly state that root needs to be read-write15:51
tristanof course, this is partly a matter of policy yes15:51
tristanYes15:51
tristanBut then there is this icky thing about integration commands15:51
tlaterThat's why we had no-integrate, right?15:52
tristanSo we know that it's going to be more expensive to have read-write root, in which case it is desirable to determine before hand *if* any integration commands should be run15:52
tristantlater, I was going to get to that15:52
tristanactually I was hoping to ditch it15:52
tristanno-integrate is one of the more undesirable outcomes of that friday meeting, it means users will create projects differently on different platforms in a fundamental way15:54
tristanwhich kind of kills the opportunity for nice cross platform compatible projects15:54
tristantlater, we should be able to replace that no-integrate fairly easily I think by reading the element's public data as soon as we're creating a sandbox that builds against it15:56
tristanjust check if there are any integration commands basically ?15:56
tristanintegration is already like, first class citizen15:56
tlatertristan: I guess if integration commands can be delayed anyway, there's no need to disable them; you just don't define them in the first place?15:59
tlaterThat would make elements a lot less flexible, though - I think I don't quite follow16:00
tristantlater, thats basically what I was thinking, I think you would have to use compose elements here and there at checkpoints and integrate once16:00
tristanwell16:01
tristanIts required either way that you make these checkpoints16:01
tristantlater, if you are going to "integrate later", you cant do it at just one place but not store the integration result16:01
tristanthings that depend on it further; will also need to integrate16:02
tristanso compose elements could carry the integration data forward16:02
tlaterRight, I understand16:02
tristantlater, so that is *in the case that we dont have /some/ fuse equivalent solution on the platform*16:02
tristanAnd no weird API is introduced16:03
tristanWhich means that if we later find a solution; things will just magically improve for users and no projects will have to change16:03
tlaterYup, I like that solution16:03
tristanIn the case that we *do* add API, it looks like we still have the same limitations16:03
tlaterIn terms of the two approaches to managing read-onlyness, which one do you prefer?16:09
tristanbochecha_, so basically we need syntax for expressing a 'mask of files' such that it can be matched against file lists; in other words we dont ever want the split-rules to gain syntax about what to *do* with these files, I guess this means chances are very low that anything else will be required16:09
bochecha_tristan: I'm not sure I understand16:10
tristantlater, the first is cleaner I think; I dont particularly like the idea of hardlinking all files and then another pass of copy/move16:11
tristanbochecha_, well I was considering that a flexible format permits for more metadata in the future, but is bulkier and more verbose16:11
tristanI mean, if it ends up that you need to add more YAML to say this path is recursive, it's not really saving you anything over just having 2 path matches16:12
tristanwhich is why I thought *maybe* trailing / could indicate that...16:13
tristannot really nice approach either, though16:13
tristanbut maybe nicer to the user16:13
tristanssam2 ran a lot of pipelines today16:16
ssam2did i ?16:16
* tristan hands ssam2 the gitlab pipelines award of the day16:16
bochecha_tristan: indeed16:17
ssam2tristan, you mean in baserock definitions ? i did run many pipelines there recently16:17
tristanssam2, oops no I had wrong window open, looking at baserock16:17
bochecha_tristan: in the grand scheme of things, it's not really that bad to have to specify both the folder and the glob for its contents16:17
tristanhaha16:17
ssam2i hope I can keep the award16:17
tristanbochecha_, haha... sticky issue :)16:17
bochecha_it would be nicer to be able to specify the folder recursively, but maybe it's not that important if it's too complex16:17
tristancomplex in terms of format, it wont really hurt the codebase16:18
tristanI think, well... maaaybe years later I'll palmface about adding a trailing / detection there16:19
*** waltervargas[m] has quit IRC16:25
*** jjardon[m] has quit IRC16:25
*** mrmcq2u[m] has quit IRC16:25
*** cgmcintyre[m] has quit IRC16:25
*** mattiasb has quit IRC16:25
*** ptomato[m] has quit IRC16:25
*** ptomato[m] has joined #buildstream16:26
bochecha_tristan: you did add it?16:29
tristanbochecha_, no no16:29
bochecha_ok, I thought I had misunderstood this whole conversation :)16:30
tristanwas just reflecting16:30
tristan:)16:30
bochecha_in any case, don't worry too much about it, it's not that big an issue, I'm sure there's much more important to do in BuildStream16:30
bochecha_overall I'm super happy about it, having to add a few lines in my project.conf won't prevent me from sleeping :)16:30
tristan:)16:31
tristanI'm also thinking of new general format features16:31
tristanwrt dictionary / array composition16:32
tristancurrently the engine decides whether arrays are appended or replace source arrays when compositing16:32
tristanand prepend is never an option16:32
tristanBut I was thinking maybe a << >> == kinda notation might let the user decide instead16:33
tristanmaybe scratch ==, something like foo: would mean "replace this array", and then you might have foo>>: "append to this array" or foo<<: "prepend to this array"16:34
tristanThat would let you decide if you wanted to override the split-rules entirely or just augment them16:34
tristan(and would allow stuff like prepending commands to 'build-commands' in build elements)16:35
gitlab-br-botpush on buildstream@master (by Tristan Van Berkom): 7 commits (last: element.py: Changing artifact version API) https://gitlab.com/BuildStream/buildstream/commit/2b0ba33947b920d0a91bf8391a2b00ec73d6009616:39
tristanAlright the versions have landed !16:39
tristanNow we have all kinds of versions yay \o/16:39
tlatertristan: Python has a way to confirm ancestors:16:51
tlatertest = pathlib.Path('/home/tlater/Documents')16:51
tlaterif pathlib.Path('/home') is in test.parents:16:51
tlater     # something16:51
tlaterI think that's simple enough that there's no need for a util function16:52
tristantlater, nice17:01
bochecha_+1 on using pathlib, it's a pretty great module17:09
bochecha_be careful about the minimum Python versions, though17:10
bochecha_it gets new functions every Python release, so you might end up using something that's only in e.g Python 3.617:10
tristanwe're with 3.417:11
tristanyeah :)17:11
bochecha_like path.write_text() and path.write_bytes() which were added in python 3.5, and are just amazing as they completely remove the need from opening the file (with, etc...)17:11
bochecha_Path.parents was in 3.4 though, so you're good :)17:11
tlaterbochecha_: Thanks for the reminder :)17:12
* bochecha_ loves pathlib17:12
* tlater wishes I'd known about it last year17:12
tristanthe old glob implementation was with PurePath.match()17:14
*** tlater has quit IRC17:14
tristanI think it's a bit of a shame that python's glob module is hardwired to the os interface for walking files17:15
bochecha_tristan: what do you mean?17:15
tristanpathlib was the only thing close17:15
tristanI mean you cant use `import glob` for globbing a list of files17:15
tristanor paths in a tarball17:15
bochecha_oh17:16
tristanit just calls into os listdir and walk and such17:16
bochecha_yeah, I see what you mean17:16
bochecha_you have to use fnmatch on each element of the list -_-17:16
bochecha_that's pretty terrible, yeah17:16
tristanwe do something a bit more exotic but yeah17:16
tristanI think it's from fnmatch we took the code to convert to regex and additionally support globstar (**)17:17
tristanthen at least we compile a regex inclusive of all your globs17:18
bochecha_and all my globs are belong to buildstream17:18
tristanbut yeah, I think glob is a bit more optimized, manages to skip directories17:18
tristanhaha17:18
tristanyes, regex is eating peoples globs17:19
bochecha_stop eating my globs!17:19
bochecha_a long time ago, I had sent a patch to Python upstream about supporting « {foo,bar} » expansion in fnmatch17:19
bochecha_but then folks started wondering whether that should be in fnmatch or glob or shutil or ...17:20
bochecha_and eventually nothing was decided, so I just gave up17:20
tristanI wanted that, can we have it ? :)17:20
*** jonathanmaw has quit IRC17:23
*** ssam2 has quit IRC17:27
*** jude has quit IRC17:28
bochecha_tristan: http://bugs.python.org/issue958417:28
tristanbochecha_, ah that one is in glob though17:31
bochecha_tristan: no, my patch was in fnmatch17:31
bochecha_tristan: that's the ticket I had opened 7 years ago :)17:31
tristanhttp://bugs.python.org/file21001/0001-Curly-brace-expansion-in-glob.patch17:32
tristananyway there is expand_braces() which uses a regex so it's a starting point17:33
bochecha_tristan: look at my initial comment, the initial patch was for fnmatch17:33
bochecha_but then I was asked to change it, then it changed again, then... then I lost interest17:33
tristanyeah17:34
bochecha_do read the whole conversation, because it's very possible the last patch I posted had some issues someone reported, but I never fixed17:34
tristanbut the history of patches got lost there ?17:34
tristanI cant find the old obsolete ones17:34
bochecha_yeah17:36
bochecha_I think RT loses old patches when they are marked obsolete17:36
bochecha_or maybe not, but the UI is so confusing that even though they might still be there, they can't be found :D17:37
tristanbochecha_, I think if you created the issue and attached the patch after, we'd have it in the history17:38
tristanthe history appears to lose the initial entry17:38
tristananyway17:39
gitlab-br-botbuildstream: issue #82 ("Store artifact manifests in metadata") changed state ("opened") https://gitlab.com/BuildStream/buildstream/issues/8217:46
*** cgmcintyre[m] has joined #buildstream17:57
*** mrmcq2u[m] has joined #buildstream17:57
*** mattiasb has joined #buildstream17:57
*** waltervargas[m] has joined #buildstream17:57
*** jjardon[m] has joined #buildstream17:57
*** jude has joined #buildstream17:57
gitlab-br-botbuildstream: issue #69 ("Core and Plugin format revisioning") changed state ("closed") https://gitlab.com/BuildStream/buildstream/issues/6918:05

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