IRC logs for #buildstream for Thursday, 2017-06-15

*** tristan has joined #buildstream05:31
*** tristan has quit IRC05:43
*** tristan has joined #buildstream06:28
*** ChanServ sets mode: +o tristan06:28
*** jude has joined #buildstream07:17
*** franred has joined #buildstream08:08
*** tlater has joined #buildstream08:09
*** franred is now known as noisecell08:09
*** tlater has quit IRC08:31
*** tlater has joined #buildstream08:32
*** jonathanmaw has joined #buildstream08:45
*** ssam2 has joined #buildstream09:10
*** Chris has quit IRC09:15
*** tlater has quit IRC09:29
tristanssam2, ok regarding that comment, I am thinking that there should be an invariant: If a Source is in an Consistency.INCONSISTENT state (i.e. it has no ref), then ->fetch() will never be called on it09:47
ssam2seems fair09:47
tristanI think it was my mistake to put that comment in _pipeline.py: Pipeline.build()09:48
tristaninstead of just asserting that first09:48
tristanWhat would be the right human language for a source which has no ref ?09:49
tristanfor an error message09:49
ssam2it depends on the source09:50
ssam2'tar' is a weird case I think09:50
tristanYeah thats what I mean09:50
tristanwell, tar is indeed a weird case09:50
ssam2probably OK to just say 'try running `bst track` to set the ref fields'09:50
tristanbut lets ignore that09:50
tristan"Exact versions are missing for the the following elements, try running `bst track` on these elements first:"09:51
tristanThat is the real meaning, ignoring the fact that tar is weird09:51
ssam2yeah sounds good to me09:51
tristanssam2, while I'm at it... I have something else... right now in `bst fetch` I just filter out inconsistent sources10:03
tristanI think it would be better to make the same assertion there10:03
tristanThoughts ?10:03
tristanAlso I'm going to add the --track option to `bst fetch` (like `bst build`, it can be done in one go)10:04
tristanAlso... I was thinking of that --sever option (we need a better name), it will be interesting for other purposes (especially track)10:07
tristanWill be interesting to be able to express branches of the build graph to chop off... for track this means "I want to build the latest of my high level stuff, but I dont want to rebuild the whole damn runtime"10:07
ssam2yes indeed10:12
ssam2that will be good for people switching from jhbuild I think10:13
gitlab-br-botpush on buildstream@master (by Tristan Van Berkom): 3 commits (last: setup.py: Added comment about OSTree.YEAR_VERSION & OSTree.RELEASE_VERSION) https://gitlab.com/BuildStream/buildstream/commit/0ea7c45f5fea46f1ecf606fdf4090069fb2662b810:21
tristanssam2, alright assertions of consistency is there...10:21
tristanIf you can check your MR and put only what is still needed, that would be great :)10:22
ssam2will do10:22
tristanAlso now `bst fetch --track` exists :)10:22
gitlab-br-botbuildstream: merge request (sam/traceback-fixes->master: Replace a few tracebacks with actual error messages) #24 changed state ("opened"): https://gitlab.com/BuildStream/buildstream/merge_requests/2410:38
gitlab-br-botpush on buildstream@master (by Tristan Van Berkom): 2 commits (last: import.py: Raise an error when no files are found) https://gitlab.com/BuildStream/buildstream/commit/2620bfe2a15abcfdb15f4e70d8ddb1e943a2d97f10:44
gitlab-br-botbuildstream: merge request (sam/traceback-fixes->master: Replace a few tracebacks with actual error messages) #24 changed state ("merged"): https://gitlab.com/BuildStream/buildstream/merge_requests/2410:45
gitlab-br-botpush on buildstream@master (by Tristan Van Berkom): 1 commit (last: scriptelement.py: Fixing some fallout in scriptelement) https://gitlab.com/BuildStream/buildstream/commit/b076d2e88518a225767844e06f30e9dbaca8301510:55
*** ssam2 has quit IRC11:00
jonathanmawtristan: I think https://gitlab.com/BuildStream/buildstream/commit/b076d2e88518a225767844e06f30e9dbaca83015 might give you trouble11:06
jonathanmawIf you want to instantiate it with __layout = [], doing it in the class definition means that every element instantiated from it will start with that array11:07
jonathanmawputting it in  the init method would probably be better11:07
jonathanmawI remember tripping up on something similar before11:07
*** ssam2 has joined #buildstream11:16
tristanjonathanmaw, I added a note to layout_add() about that11:23
tristanjonathanmaw, since you already do 'if not self.__layout: ... self.__layout = []' it shouldnt be an issue11:23
tristan(i.e. you are not appending to a mutable class data)11:23
jonathanmawaha11:23
tristan(you create a new instance level list)11:23
tristansince empty list is falsy, the rest need not change11:24
tristananyway, yeah... mutable things in python are tricky11:24
tristanfor instance, watch out for mutable keyword argument default values11:25
tristanthey are not instantiated on a per call basis but global data for program lifetime (ouch)11:25
ssam2is important host tools from a tarball something that we want to support ?12:23
ssam2i've hit a few issues, most seriously 'Error staging source: [Errno 1] Operation not permitted'12:23
ssam2am trying to import Alpine Linux as a base to avoid dealing with multiple GBs of GNOME SDK every time I want to run a build12:23
ssam2i could always put it in an OSTree repo outside of BuildStream, but since they provide binary tarballs I figured I'd try that first12:24
ssam2hmm, I guess the issue will be that my user doesn't have permission to extract a tarfile with stuff owned by root12:25
tristanssam2, the org.freedesktop.BaseRuntime and BaseSdk should not be that large really12:25
ssam2ah yeah it's the FreeDesktop one12:25
tristanit's just the output of the base runtime yocto build12:25
tristannot the GNOME SDL12:25
tristanK12:25
tristanHmm12:25
ssam2i'm still having to wait around quite a bit though, and most of it is unneeded since i'm just building a toolchain12:25
tristannot sure how big that really is but it's supposed to only be the compiler, runtime and some tools12:26
tristanIn any case, you should be able to use a tarball as a source for an import element, to answer more directly12:27
tristanssam2, if you can untar the tarball, then buildstream should be able to12:27
ssam2right, the issue is that I can't12:27
ssam2which I guess isn't buildstream's problem12:27
tristanif you cant, then buildstream cant12:27
tristanright12:27
ssam2in terms of freedesktop SDK ... i started a build there with my changes stashed, i'm on 1:38 of staging sources for base-platform.bst and base-sdk.bst and still waiting for anything to build12:28
tristanssam2, honestly though, tarballs are supposed to be doable to some most extent as regular user, it will normally untar as active user if you are not root, etc12:28
ssam2yeah... i think this might have device nodes or something weird12:28
ssam2i'll write a script to put it in an ostree repo, or at least make a more sane tarball12:28
tristanyeah that we wont support, if it has xattrs then maybe we can strip them along the way12:29
tristanssam2, of *staging* ?12:29
ssam2yeah12:29
tristannot of fetching ?12:29
ssam2no, staging12:29
tristanssam2, odd really, you seem to be the winner of the slowest harddisk award12:29
ssam2that wouldn't surprise me, this laptop is quite old12:30
tristanssam2, so what I might also check... is `stat -c "%h"` on the files in ~/.cache/buildstream/artifacts/extract/...12:30
tristanssam2, do you have bleeding edge ostree ?12:30
ssam2not bleeding edge12:30
tristanI'm not *entirely* certain, I think you really should have hardlink checkouts with buildstream as-of-this-week and any version of ostree12:31
tristanbecause bare-user repository + user-mode checkout should give you that12:31
tristanssam2, actually wait...12:32
ssam2`stat -c "%h"` is showing 1 link for everything12:32
tristanyou are staging the source not the artifact, so that you can cache an artifact for later use... right ?12:32
ssam2which seems wrong..12:32
tristanssam2, yes that does seem wrong12:32
tristanssam2, maybe you did not wipe your artifact cache since the changes12:32
ssam2i didn't12:32
ssam2it seemed to be in bare-user mode already12:33
ssam2but will try that12:33
tristanssam2, check the ostree/config file12:33
tristanit's like a git config ini12:33
ssam2yes, mode=bare-user12:33
tristanwill tell you that it is archive-z2 if it's from before my fixes12:33
tristanhmmm12:33
tristanstrange12:33
ssam2i can try wiping it though, I need to go eat anyway :-)12:33
tristanOk do that12:34
tristanssam2, I think that staging an ostree import will still take time, as it will uncompress things to stage initially12:34
tristanssam2, and once you have it as an artifact, it should be hardlinks all the way12:34
*** tlater has joined #buildstream12:35
ssam2ohh, what might have happened is that i've changed cache keys12:35
ssam2quite likely with the host-arch stuff12:35
ssam2so it'll be re-importing it from the sources/ repo12:35
tristanThat part of staging the source ostree will take much more time yes12:36
tristanwhich is one reason it will be great to have artifact sharing... so nobody has to almost ever do that :)12:37
tristanIt could be that we should be using bare-user repositories for the ostree source, too... but in that case it seems to make sense to use compression12:37
ssam2still not entirely sure why you can't pull everything into the one repo12:38
ssam2but we've discussed that before12:38
tristanIt's not that it's not technically possible, it's that it's a horrible thing to do to the code, and artifact shares should mostly solve it anyway12:40
tristanssam2, if you can make every Source implementation mirror directly into ostree instead of separate git,tar,bzr,etc mirrors, then yes, lets do it :)12:41
tristanactually even then, lets not do it12:41
ssam2I suppose you're right that it's only needed when building from scratch12:42
tristanbecause then what happens when we port to environments which dont have ostree... ugh, what a mess it would be12:42
tristansources are just not artifacts, they are different12:42
ssam2hmm, that raises an interesting other point12:42
ssam2of how to get host tools into systems that don't have ostree12:43
ssam2I guess tarballs is the only way12:43
tristanRight: You cannot use an ostree source on a system that doesnt have ostree12:43
tristanJust like you cannot use tarball sources on systems that cant use tar12:43
tristanssam2, you do it with something else, tarballs is one way12:43
gitlab-br-botbuildstream: merge request (sam/tar-base-dir-fix->master: tar.py: Consider the 'base-dir' as part of the unique key) #25 changed state ("opened"): https://gitlab.com/BuildStream/buildstream/merge_requests/2512:54
tristanssam2, ah good point12:55
ssam2that stumped me for a minute or two :-)12:56
tristannot sure I agree with the reasoning in the comment/commit message, but setting base-dir will certainly effect what is staged, so it should be considered :)12:56
ssam2yeah i should probably have not written anything12:57
tristanssam2, anyway the default '*' should work for almost everything we care about; it's rare that you have dangerous tarballs which start with files directly in '.'12:57
ssam2that's true for source tarballs12:57
tristananyway I hit the merge button12:57
ssam2but not for binary things12:57
ssam2thanks12:57
ssam2going to go eat lunch rather than try and arrange any more words into meaningful orders :-)12:58
tristanssam2, not sure I agree: Its true for binary tarballs created by wreckless people12:58
tristanwho think that sort of thing is just okay :)12:58
gitlab-br-botpush on buildstream@master (by Tristan Van Berkom): 1 commit (last: tar.py: Consider the 'base-dir' as part of the unique key) https://gitlab.com/BuildStream/buildstream/commit/c7a75c038b5b03c899a709bf9d106f2e217e9c7112:58
gitlab-br-botbuildstream: merge request (sam/tar-base-dir-fix->master: tar.py: Consider the 'base-dir' as part of the unique key) #25 changed state ("merged"): https://gitlab.com/BuildStream/buildstream/merge_requests/2512:58
tlaterHow do I determine what elements are build elements? element.get_kind() doesn't seem to be what I'm looking for, and I'd like to avoid introspection.13:39
tristantlater, you dont13:45
tristanI mean, you *can*, but that wouldnt be good, instead you dont13:46
tlaterHow do I check which objects do implement my write_script interface then? Letting them throw ImplError feels like it might cause issues13:46
tristantlater, yeah I'm not sure... I have a similar conundrum with `bst shell` I havent decided how to solve yet13:50
tristanI have two options, 1: construct a fake sandbox to pass to configure_sandbox() and/or stage() and then handle ImplError - sucks for the core but better/smaller API surface for plugins13:51
tristan2: Add some kind of can_shell() method, cleaner for the core but means one more superfluous method a plugin must implement13:51
tristanI'm a bit torn about this13:51
tlaterI prefer 2, personally13:51
tristanAt least for shell, I dont need to error out early really; so I can do 1 and just fail gracefully13:52
tristanI honestly prefer 1, if at all feasible13:52
tlaterWhy is the fake sandbox necessary?13:53
tristanFor an element to be shell-able, we need to know that it implements configure_sandbox, stage and assemble separately; launching a shell is the first two without the third13:53
tristanthose methods take a sandbox and do stuff13:53
tristanIf I constructed a fake sandbox and tried to catch ImplError, then I could determine whether it's possible without going further13:54
tristanBut, for shell it's not all that important to handle it early13:54
tlaterGotcha, I didn't know some elements don't implement it13:54
tristanI can just catch it at that time13:54
tristanYeah, well some elements just implement assemble(), originally there was only assemble() but this became problematic for shelling13:55
tlaterThis could work for the source_bundle too13:55
tlaterI don't see why the error would need to be caught too early13:55
tlaterAlthough it does waste some time...13:55
tristanIndeed, it's not a huge process if you generate the scripts before staging the sources13:56
tristantlater, we make attempts to error early in regular operations which use the scheduler, cause it sucks to be building 500 modules for 3 hours and then find out that you screwed up, and could have been told at launch time :)13:56
tlaterYeah, that does seem like a pain13:57
tristanI suppose as long as you generate the scripts before you stage the sources to some output place (which could also take a long time), that's pretty fine13:57
tlaterThe ImplError should never actually show up for the source_bundle command though, should it?13:57
tristaneven if it were 500 modules, you can generate all the scripts in probably less than a second13:58
tristanYou would have to explicitly trap it and raise something more appropriate13:58
tristantlater, to clarify; stack traces should never reach the user13:58
tlaterNo, but I mean, if I for example try: `bst source_bundle busybox.bst some_dir113:59
tristanSo when it's code in _pipeline.py, it can be self.message(... MessageType.ERROR ...)13:59
tristanalso, please dashes no underscores :)14:00
tristanheh14:00
tlaterOh, I'll have to fiddle with click then... But yeah, that does look neater14:00
tlaterEither way, what's the expected behaviour of trying to bundle a stack target? Should it create a bundle containing all dependencies, with scripts to build those, or throw an error because a stack target is not a build element?14:01
tristanright, dont add huge code to main.py, let it call into the pipeline and do highlevel operations there14:01
tristantlater, I dont know, it depends on how your surrounding stuff is going to work14:02
tristantlater, I'm ok if it generates a noop14:02
tristanin any case it will be a serialized build script, so the order of pipeline.dependencies() should be correct14:03
tlaterCould I then just ignore ImplError?14:04
tlaterWait, no, because that may be thrown elsewhere. Hm :/14:04
tristantlater, say you start with an Pipeline.source_bundle() internal API... and it has a try: with a loop over the dependencies to generate these scripts14:05
tristantlater, the except ImplError: of that try is where you self.message(... MessageType.ERROR ...) and early return14:06
tlaterThe problem is that if I then try to bundle something like busybox, I would expect to get a bundle with all dependencies, and not an error. This implementation would always error then.14:07
tristanSorry ?14:26
tristantlater, I dont follow14:26
tristantlater, AHHHH, ok that's what the --sever conversation was about14:26
tristanBut I need a better name for that option14:26
tristanI want to have it also for `bst track`14:26
tristantlater, i.e. someone could run `bst track --deps all --sever base-deps.bst gnome.bst`... and then they would be expressing a pipeline of "All of gnome.bst's dependencies, except for base-deps.bst and what that depends on, as long as those deps are not common with other things that gnome.bst depends on"14:28
tristanThat would let me say, upgrade to new source references for my highlevel stuff, except keep the same baseline versions14:29
tristantlater, for `bst source-bundle` you would probably need to use that to eliminate the base imports, actually you would want that to eliminate the entire gnu-toolchain.bst part14:29
tristanSo anyway in real life, people will cross build gnu-toolchain.bst and produce an artifact for a foreign architecture, then they would run `bst source-bundle --sever gnu-toolchain.bst element-providing-buildstream-and-its-deps.bst`14:30
tristanTo give you a build script that gets you from a base runtime on that arch -> to a system that can run buildstream14:31
tristanso you _need_ to be able to address a part of a pipeline14:31
tristanbut I dont like the word --sever14:31
tristanmaybe --chop14:31
tlater--except?14:32
ssam2--start-from ... but that's misleading because you start *after*14:32
tristan--except sounds nice yeah14:32
ssam2i like --except14:32
tristan--start-from is misleading because it implies its a serial build model, and that it can only be specified once14:32
tristan--except may be specified multiple times14:32
tlaterI implemented --all from build because of consistency, too, should that affect --except?14:33
tristanAnother approach for handling ImplError is to fire a MessageType.WARNING and just keep going, excluding that element entirely (and also marking that element for exclusion of it's sources being wrapped)14:33
tristanBut seems not all that useful anyway14:34
tristanI think --except overrides, but --all from `bst build` I think is nonsensical in this context14:35
tristanbecause `bst build` will reason about the build plan depending on what is in the cache14:35
tristanand what was already built as a build-only dependency of something already cache will be discarded from the plan14:36
tristan(unless --all is specified)14:36
tlaterYeah, that doesn't make much sense. --all could be used to toggle warnings, but that should probably be named something else then.14:36
tristanI think you probably want the --deps options from `bst show`, excepting for the 'plan' option14:37
tristanand --except effects the pipeline after that selection14:37
tristanthat gives most flexibility anyway14:38
tristanwithout offering the `--deps plan` which just makes no sense for source-bundle14:38
tristandamn ninja just doesnt work in the sandbox14:38
tlaterYup, that seems right. Hadn't seen --deps yet.14:39
tristanbeen trying to strace the crap out of this and looking at ugly C++ code for hours https://github.com/ninja-build/ninja/issues/128814:39
ssam2nasty14:43
tristanI think I found the nasty14:51
tristanThis baby is used to find if a file exists: https://github.com/ninja-build/ninja/blob/master/src/disk_interface.cc#L7214:54
tristanby checking the mtime here: https://github.com/ninja-build/ninja/blob/master/src/disk_interface.cc#L6114:54
tristanThat mtime (which is 0 for /usr/bin/glib-mkenums), gets compared with -1 in https://github.com/ninja-build/ninja/blob/master/src/graph.cc#L3014:55
tristanhmmm, have to hunt down exists()14:56
* tristan gotta run14:56
tristanAHA !14:57
tristanmtime != 0 == exists !!!!14:57
tristanNOT TRUE !14:57
ssam2d'oh15:03
ssam2yeah that's a silly assumption15:03
ssam2does BuildStream set mtime to 0 then ? might make sense to set it to a fixed non-zero value instead, in case other things do that15:03
*** tristan has quit IRC15:04
*** tristan has joined #buildstream15:14
*** tristan has quit IRC15:16
*** tristan has joined #buildstream15:16
*** ChanServ sets mode: +o tristan15:16
*** jonathanmaw has quit IRC16:02
*** noisecell has quit IRC16:42
*** tiagogomes has quit IRC16:44
*** jude has quit IRC17:24
*** tlater has quit IRC17:29
ssam2any thoughts on why GCC builds would die from out of memory inside BuildStream ?17:40
ssam2it's partly a GCC bloat/design issue17:40
ssam2but I can build it on this laptop outside BuildStream, so there must be something else making it worse17:40
ssam2it says `MAKEFLAGS=-j4` which should be OK17:40
ssam2ah, maybe Firefox using even more memory than usual17:41
* ssam2 needs to set up a build VM to avoid this crap17:41
ssam2one last try17:41
tristanstrange17:43
tristanssam2, there shouldnt be any memory restrictions in the sandbox, maybe it's firefox indeed17:43
tristanlet me know if you identify anything17:44
tristanfwiw the issue I hunted down was a dup of https://github.com/ninja-build/ninja/issues/112017:45
*** ssam2 has quit IRC18:56

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