IRC logs for #buildstream for Wednesday, 2017-02-22

*** tristan has quit IRC04:53
*** tristan has joined #buildstream05:21
*** ChanServ sets mode: +o tristan05:21
tristanironfoot, it's not committed yet, but I believe I found the best solution09:45
tristanjuergbi, I might ask you for a little audit if you have a moment... my theory fwiw; is that we dont need to perform many topological sorts throughout the build process, if direct dependencies of every given element is sorted once at load time09:47
ironfoottristan: :)09:54
*** ssam2 has joined #buildstream10:11
tristanironfoot, do you recall which element specifically had problems ? usbutils ?10:19
tristanAlso, what should I check here... ldd script yeah10:19
ironfootldd script for bash detection in glibc, yes10:19
ironfootif that goes ok, linux-api-headers should atleast start building10:20
tristanhas #! /usr/bin/bash now :)10:20
* ironfoot wonders if /bin -> /usr/bin symlink will be present in the staging area10:21
tristanironfoot, it is10:22
ironfootgreat10:22
tristanironfoot, I just did bst shell --run build-essential.bst10:22
tristanand all of this, was about ensuring that both fhs-dirs occurrences are staged before anything else10:22
tristanthe symlinks it puts in place must be there before other things get staged10:22
tristanso they must depend on fhs-dirs10:23
ironfootah, I see why you were looking at the dependencies order yesterday10:24
tristanright, well first I sorted out symlinks based on code I wrote this weekend for ybd10:24
tristanbut then I got circumstances where staging was not in dependency order10:25
tristane2fsprogs passed this time...10:30
ironfootthat was already fixed :P10:33
tristanyeah10:34
tristanironfoot, alright pushed new buildstream master and new changes to build-essential branch of buildstream-tests to convert on top of10:36
tristanThis is the wild sort: https://gitlab.com/tristanvb/buildstream/blob/master/buildstream/_loader.py#L622 .. for which my theory is, that the generator function Element.dependencies()...10:37
tristanFound here: https://gitlab.com/tristanvb/buildstream/blob/master/buildstream/element.py#L10910:38
tristanWill always report dependencies in correct build & stage order10:38
tristanAnd I hope that with this, Element.dependencies() can be used to somewhat simplify the juergbi's original planner code here: https://gitlab.com/tristanvb/buildstream/blob/master/buildstream/_pipeline.py#L4410:39
tristanjuergbi, any thoughts on any of this stuff ?10:39
juergbiwill take a look in a bit10:39
tristanironfoot, ok so an autoconverted foundation.bst builds... except for groff10:55
tristanthat is fixed by setting the max-jobs variable to 1 in groff.bst10:55
tristanhowever that also needs a buildstream change, because I want notparallel: True to control that10:55
tristandifference is that max-jobs is autoresolved and does not effect cache keys10:56
ironfooti forgot about auto converting max-jobs, etc11:05
tristanironfoot, no worry, I'm making a patch so if you see max-jobs: 1, make it notparallel: True11:06
ironfootcool11:07
tristanthis sed presents a problematic regex: http://git.baserock.org/cgit/baserock/baserock/definitions.git/tree/strata/tools/zip.morph11:44
tristanironfoot, and now buildstream master supports notparallel correctly, i.e. see: https://people.gnome.org/~tvb/buildstreamdocs/elements/autotools.html#module-autotools for reference11:46
tristanit's valid on any build element actually, but only relevant to those elements which have parallelization support11:47
ironfoottristan: regarding the sed is because defs2bst didn't handle it?11:48
tristan ironfoot right, defs2bst handled it, but I believe it did the wrong thing11:48
tristanI'm not sure what $$PREFIX is supposed to mean, but it ends up as $%{prefix}11:49
tristanSo have to figure out what that means, I suspect it's escape sequence ?11:49
ironfootyou could ask jmacs in #baserock if needed11:49
ssam2escaping $ inside the Makefile ?11:50
tristanSo if so, its intended to place $PREFIX and $DESTDIR variables into the makefile11:50
tristanand it relies on PREFIX and DESTDIR being in the environment11:50
tristanI think the solution is to just also handle $$PREFIX and $$DESTDIR, will be harmless to sed the expanded variable directly into the makefile11:51
ironfootI'd think so, yes11:51
tristanwhile that is true, the substitution might not _always_ be true, but I think we can assume this is corner case enough for the definitions repos we know11:52
ironfooti wonder if others are relying in those variables being in the environment11:56
ironfootin which case: would it be sensible to add these 2 variables to all the bst files during the conversion?11:58
ironfoot(instead of replacing the vars?)11:58
tristanironfoot, I would much rather not if we can avoid it11:59
tristanalthough it is possible11:59
tristanit's a better approach to avoid dirtying the environment11:59
ironfooti would prefer to avoid it, yes, but i'm not sure we will be able to trust the conversion otherwise12:00
tristanironfoot, in other words, yes it may work better as a conversion, but the output quality of that conversion encourages not so great behavior12:00
ironfoottotally agree12:00
tristanI'd say, lets take the current approach, and if it's wrong for a handful of definitions out of hundreds, we'll mention it in the porting guide or such12:01
ironfootbetter to fix a few broken things afterwards than stay with all that garbage12:01
tristanyes12:01
tristanThere will be other things to note in the porting guide besides this, i.e. the build will fail on running integration commands of modules like gdm12:02
tristanwhich try to assign arbitrary uids12:02
tristanthose should be easily portable to something else12:02
tristan(also we'll want to support encoding of static dev nodes somehow)12:03
tristanOr... say: you're out of luck, run bst as root12:03
tristanbut rather not12:03
ironfoothehe, I've been running bst as root all the time12:04
ironfootis it not needed?12:04
tristanironfoot, not at all no :)12:04
tristanhahaha12:05
tristanhahahahahaha12:05
ironfoot:P12:05
tristanYeah, stop doing that !12:05
tristan:)12:05
ironfootwell, running in docker means root all the time12:05
tristanyeah Ok12:05
tristananyway it should not be needed12:05
tristanand if we want to setup CI for definitions building with bst, better to setup a docker with a regular user12:06
ironfootbut i believe that bwrap failed if i wasnt running docker as `--privileged`12:06
tristanto catch the cases of definitions which require root12:06
tristanhmmm, that is possible12:06
tristanironfoot, it needs to be allowed to create a user namespace pretty much12:06
tristan(disclaimer: I dont know the details of how docker works, really unfamiliar with docker)12:07
ironfoot"When the operator executes docker run --privileged, Docker will enable to access to all devices on the host"12:07
ironfootit looks like you can have fine grain control over the privileges you want to give to your docker container, that's handy12:08
tristanyes12:08
ironfootdon't worry, I'll be the bst in docker guy12:08
tristansure, It will be useful for gitlab-ish thingies12:09
tristanbut practically speaking, we do our own containerization with bwrap12:09
ironfootyeah, this is only for users like me that use an OS that doesn't have python 3.512:11
ironfootor that don't really like to install software in their laptops12:12
*** xjuan has joined #buildstream12:22
tristanxjuan, interestingly I ended up ditching the tsort13:07
tristanxjuan, in favor of sorting direct element dependencies once at load time13:07
tristanNow, I'm pondering what would happen if we were to use a fuse layer that implements copy-on-write hardlinks :)13:09
* tristan wonders if he could do that in python13:09
tristanor with a low dependency13:09
* ssam2 hopes the answer isn't "terrible performance"13:10
tristanssam2, I doubt it, hopefully it would only effect performance in the off chance that a build writes to a linked file in the sandbox13:12
ssam2i guess if it's only open() calls that go thru the fuse layer it shouldn't be too bad...13:17
ssam2although there are still huge amounts of calls to open() from a configure script13:18
tristanindeed13:21
tristanwe'd have to try it, but it would be an elegant solution to the staging / integration problem13:21
*** tristan has quit IRC13:55
*** tristan has joined #buildstream14:15
*** ChanServ sets mode: +o tristan14:16
tristanironfoot, this seems to be getting quite far, fwiw: https://gitlab.com/tristanvb/defs2bst/tree/pedro-changes15:11
ironfootyay15:12
ironfootif we could sort the dump :P15:15
tristanironfoot, there is prior art for that...15:16
tristanironfoot, I think YBD even also has a dumper15:16
tristansince the latest commits15:16
ironfootone day :P15:16
tristanleeming's spec2def has one15:16
tristanit's easy enough to copy/paste and give it a list of keys you want ordered15:17
* leeming grasps context15:18
leemingspec2def isn't public afaik. I asked for it to be open sourced.. but some commit history _might_ need cleaning15:18
leemingwe talking about sorted key dumps for yaml?15:20
ironfootyup, but that can wait15:28
*** ssam2 has quit IRC15:47
*** ssam2 has joined #buildstream15:49
tristanironfoot, https://paste.gnome.org/p1be1td51 :)16:28
tristangetting there16:28
tristanI dont understand why wpa_supplicant.bst doesnt build16:28
tristanit may be the sandbox running is not handling the scripts properly. but, I doubt that because glibc.bst works and also does the same16:28
ironfootlooks great16:29
tristanfor some reason, cat > file << EOF .... EOF, has the last EOF in the file it creates (for wpa_supplicant)16:29
ironfootI just hit groff build issue16:29
tristanOh !16:29
tristanI have an idea16:29
tristanironfoot, you wont hit groff issue using master buildstream and the defs2bst branch I linked above16:30
ironfootthe bst file looks as expected, although the "True" is quoted. Is that ok?16:31
* tristan pushes fix to buildstream for wpa_supplicant case, all commands run in sandbox should have trailing \n16:32
ironfootright, the version of bst didn't have the nonparallel fix16:33
tristanironfoot, either is OK, but conversion is prettier if we encode True16:33
tristanI think it's my mistake16:33
tristanI think I converted it stringified, but it can be dumped as bool16:33
* ironfoot continues validating tristan's success16:33
ironfootgah, re-building core :P16:35
tristangood, I have an error up at mesa, which I suspect is a side-effect of not having explicit \n at the end of commands run in the shell16:42
tristanhttp://pastebin.com/raw/r7hiGUJk16:45
tristanweird16:45
tristanbut I think if you have last buildstream commit and are rebuilding core, you may not get that error16:45
tristanironfoot, and next on the conversion list, is system-integration commands -> public: bst: integration-commands16:47
tristanlike this: https://people.gnome.org/~tvb/buildstreamdocs/format.html#public16:47
ironfooti don't get the "bst" domain16:49
ironfootthings just executed when buildstream uses the element?16:50
tristan"bst" domain is the domain in which BuildStream searches for public data exposed on elements16:50
tristanpublic data is something that an element is allowed to read off of any other element that it depends on16:51
tristanironfoot, for integration commands, we currently run them after staging, and before building16:51
tristan(hence the need for something like a fuse layer that does copy-on-write hardlinks)16:51
tristan(or, we can have an error pop up and nuke the tainted artifact extract)16:52
tristanironfoot, at the base of the stack for instance, ldconfig is an integration command16:52
ironfootyep16:53
tristanat higher levels, they may update font caches, pixbuf loaders, or even tinker with systemd symlinks16:53
tristanor sysvinit symlinks :)16:53
ironfootin some cases, things like "ca-certificates" integration commands don't need to run every time16:53
ironfootwhat i'm saying is that the system-integration-commands is something a bit different to these ones16:54
tristanironfoot, I realize that, but unless it turns out to be a serious performance hit, I dont really care17:02
ironfootyup17:02
tristanwe can add something different in a deployment element and do optimizations after an auto-convert, too17:02
ironfootso my other question, what other options there will be in "public" other than "bst"17:02
ironfoot(just want to understand multiple use-cases)17:03
tristanironfoot, that all depends on the plugins which use them :)17:03
tristanSo plugins in the pipeline can use extra decorated data in their domain17:03
tristanone example will be rpm metadata for packaging17:03
tristananother might be flatpak metadata17:03
* ironfoot nods17:03
tristanssam2, fwiw, I realized that performance of fusepy is thankfully not an issue at all :)17:04
ssam2nice17:04
tristanssam2, because you only need that for the rootfs that is outside the build directory17:04
tristanconfigure scripts operate on data you've checked out17:05
tristan(so it will need a separate mount, something to figure out in the sandbox code)17:05
ssam2i mean, configure scripts shouldn't touch anything on the source tree, I quite like that Morph had a read only mount that enforced that17:05
ssam2hmm, a total tie!17:05
ssam2total lie! You mean checked out from Git17:06
tristanyou mean outside the source tree17:06
tristanconfigure scripts only touch stuff inside the source tree17:06
ssam2yeah17:06
tristanssam2, I think we will do the read-only mount _also_17:06
ssam2good17:06
tristancopy-on-write hardlinks is for the stage of running integration commands before running the build17:06
ssam2that makes sense17:06
ssam2I think we tried unionfs-fuse for that a couple of years ago17:07
ssam2which worked pretty well, patches for Morph are still around17:07
tristannice17:08
ssam2oh, and overlayfs17:08
ssam2which is now pretty common17:08
ssam2you can store an OSTree commit + the overlayfs backing store17:08
tristanwhatever it is, my concern is that it's easily obtainable17:08
ssam2sure. Well all these options are Linux-only unfortunately17:08
tristanso I thought a python layer like fusepy, uses ffi to access the C interface of fuse directly17:08
tristanyes17:09
tristanssam2, right now the one sandbox implementation we have is linux only17:09
tristanbut I'd like to keep those restrictions in the sandbox implementations17:09
tristanfor building on windows, it may not be an issue with WSL17:09
ssam2overlayfs is built into the kernel since 3.18 so that may be easiest to obtain17:10
tristanbut I think it would be very sweet, if the sandbox for windows itself automatically used the WSL layer17:10
ssam2right, why not17:11
tristanmight not be easy17:11
tristanI would like that, but I have a feeling WSL is restricted to using a vetted ubuntu thingy17:11
tristannot entirely sure if we can shove whatever runtime we want in there17:11
ssam2well, the issue is whether they implement all the necessary syscalls right?17:11
tristanthat too17:12
ssam2unless they're signing the ubuntu image that's allowed to run somehow, but it seems a bit of a GPL violation if so17:12
tristanbut as they are running ubuntu stuff, I am hopeful that it stresses their syscall interface quite a bit17:12
tristanworst case we say: Install this WSL thing and run buildstream inside it17:12
tristanssam2, also has to do with filesys, we probably need a dedicated quota17:13
* tristan hasnt looked deeply into that WSL stuff yet, obviously17:13
paulsher1oodbuild first, world domination can wait? :)17:14
tristanyes17:14
tristanpaulsher1ood, https://paste.gnome.org/p1be1td51 ... and chugging along :)17:15
ironfootworld domination plans being developed between builds :P17:15
* paulsher1ood wants to see elapsed times17:15
tristandidnt save that build log17:16
paulsher1oodnm17:16
tristanand have to clean up UI, it's cluttered especially with messages about staging each dependency17:16
tristanthats extra-extra verbose mode I guess17:16
tristansuper-duper-verbose, I dont know, probably just yank it, keep it only in the saved logs17:16
tristanthats just the output of `bst show gnome.bst`, it shows only what is cached, what is ready to build, and what is waiting to build17:18
tristanso it gives a picture at least of what we managed to build so far :)17:18
ironfootaround 2/3 of gnome.bst17:23
tristanya know we have an opening for anyone who wants to write Source implementations, so *cough* dont let me hold everyone back !17:26
tristanhehehe17:26
* tristan opens the proverbial floodgates17:26
ironfootto write Source implementations?17:27
tristannod17:27
ironfootwhat's that17:27
tristanhttps://people.gnome.org/~tvb/buildstreamdocs/buildstream.source.html#module-buildstream.source17:27
tristanironfoot, currently we only have git, local and ostree17:27
tristanbarely enough to only do baserock definitions17:27
ironfootaahh i get it17:27
tristanwe're going to need implementations for tarballs and other vcses17:28
ironfootnod17:28
tristanbefore we can convert flatpak json17:28
ironfootwhat is supported by the tool that currently builds these flatpaks?17:29
tristanhttps://paste.gnome.org/peyhl5e1h/egzwlk/raw17:30
tristanlooks like only git,bzr and tarballs17:30
tristanand "file"17:30
tristanwhich is like our "local"17:31
tristanothers "script" and "patch" can be converted with "local" as well17:31
ironfoothm.. source-patch17:31
ironfootis that what i think it is?17:32
tristanpatches just need to be a "local" source and have a pre-configure-command17:32
tristanironfoot, look at a flatpak json for reference, you'll see what I mean17:32
tristansome of those flatpak-builder sources have side effects17:33
ironfootclever17:33
tristanlike running a script or applying a patch17:33
ironfootsources will have to run in order then17:33
tristannot necessarily17:33
tristanpatches and scripts must be applied in the order specified in flatpak json17:34
ironfootapologies, I mixed concepts in my  head17:34
tristanyeah, can get confusing :)17:34
tristananyway, should be easy enough to convert17:34
tristanbiggest hurdle is investigating everything flatpak-builder does, but I've made provisions for it to be close enough17:35
tristan(the integration commands running before builds being one of those)17:35
*** ssam2 has quit IRC18:41
*** tristan has quit IRC20:24
*** xjuan has quit IRC21:23

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