IRC logs for #buildstream for Friday, 2017-06-09

*** tristan has joined #buildstream06:57
*** jonathanmaw has joined #buildstream07:43
*** ChanServ sets mode: +o tristan08:12
*** tristan has quit IRC08:16
*** tristan has joined #buildstream08:56
jonathanmawmorning tristan, I'm having trouble when using the debian ostree and debian packages, mostly it seems to be because they overlap with the buildstream elements in unfortunate ways09:01
jonathanmaw(especially because a lot of debian stuff has selinux, and buildstream doesn't)09:01
jonathanmawI think for the sake of my own sanity, I'm going to have to go back and do it all properly from source.09:01
*** ssam2 has joined #buildstream09:05
tristanbuildstream does not have or not have selinux09:05
jonathanmaw?09:06
tristanjonathanmaw, Not sure what you mean, are you trying the debian ostree base and then building *baserock* on top of that ??09:06
tristanjonathanmaw, I think you only need the debian base, and the element that you want to build using debian/rules09:06
tristancertainly, building *baserock* on top of debian would be really, really strange09:07
jonathanmawI'm doing it with buildstream-tests. some elements were built with core and have brought in dependencies09:08
tristanbuildstream-tests has multiple branches, the 'build-gnome' branch is a baserock GNOME system09:08
jonathanmawtristan: that's the one09:08
tristanjonathanmaw, yeah, that sounds awful, dont do that09:08
tristanjonathanmaw, start with: https://gitlab.com/BuildStream/gnome-modulesets-base09:09
tristanAnd depend on "base.bst"09:09
jonathanmawok09:10
tristanjonathanmaw, in other words: The success criteria of being able to build a module with debian/rules is not that "You must be able to build a system that has all of the deps of dpkg-buildpackage by hand"09:11
tristanA runtime with those utilities installed in some way is just a prerequisite of the build element actually working, anyway09:11
tristanjonathanmaw, if that does not work out of the box (i.e. if that runtime does not automatically have those tools), then it's fairly easy to generate one on your host09:12
tristanBy cloning https://gitlab.com/BuildStream/debootstrap-ostree/, and modifying https://gitlab.com/BuildStream/debootstrap-ostree/blob/master/data/multistrap.conf.in09:13
* ssam2 finds https://wiki.gnome.org/Projects/BuildStream/Roadmap/CrossBuilding09:36
tristanRight, what I'm thinking is _anyway_ as far as bst files which define a toolchain bootstrap go09:36
tristanYou can always assume host compatible machine architecture09:36
tristanBut not target compatible09:36
*** jonathanmaw has quit IRC09:37
tristanSo whatever we have in gnu-toolchain, as a first step, has to first ensure that no code that has been built, will be run09:37
*** jonathanmaw has joined #buildstream09:37
ssam2it maybe that we can only built up to stage2 in that case09:37
ssam2but stage2 should be enough to produce a sysroot that runs on $target (or a virtualized equivalent) and can build stuff09:38
tristanEventually, in some shiny bright crazy future, it should be possible to cross compile from mips host -> arm target... all of that on a real Intel host09:38
ssam2apart from needing a kernel, which is pretty easy to automate if you're using virtualization, and pretty manual if you're using a random devboard09:38
tristanRight, there are the kernel concerns too indeed09:39
tristanHmm09:39
ssam2but they're a pain anyway as they are often sideloaded on real hardware09:39
ssam2well and in VMs09:39
tristanWell, I suppose that something we have to consider is that bsp projects should also be made to cross compile09:39
ssam2this is actually much easier with BuildStream than it was with Baserock tools I think, because BuildStream makes it easier to build a couple of artifacts explicitly and output them in a useful format09:40
ssam2if the tool can cross build a toolchain and a kernel, for the purposes of my current project that'll be enough and the rest could be a wrapper script09:40
tristanSo eventually we'll want a VM sandbox which has a requirement of a target arch runtime09:41
tristanBut lets not talk about that until much later :)09:41
ssam2yeah :-)09:41
ssam2I can see how it would slot in place though09:42
tristanssam2, from buildstream though, you will first want host/target arches to be defined, since we dont have that09:42
ssam2makes sense, yeah09:42
tristanSo you might want to first patch buildstream for that; and that will touch several areas09:42
tristanIn the frontend / Context object, you'll want options for --host --target09:43
tristanAnd we'll probably also want host/target arch conditionals, instead of just "arch" conditionals09:43
ssam2ok09:44
tristanssam2, note that the conditionals are part of the format proper, so this might take a bit of thought09:44
ssam2right09:44
ssam2actually I think I need a bit more than what I said above09:44
tristanCurrently we make use of "arch" to do some different things based on arch09:44
ssam2building a stage2 cross compiler that runs on $host isn't enough09:44
tristanAnd we assume that everything is a native build09:44
ssam2I then need a stage3 built on $host to run on $target09:45
tristanssam2, right, you need a canadian cross09:45
ssam2yeah09:45
tristanssam2, I actually really, really think this would all benefit from your reviewing my aboriginal work09:45
tristanBecause that one "works", with the same little bash script used with different HOST/TARGET combinations09:46
ssam2the YBD changes, you mean?09:46
*** xrt has joined #buildstream09:46
tristanNope09:46
tristanssam2, https://github.com/gtristan/aboriginal09:47
tristanssam2, that is basically a fork of aboriginal which uses a modern toolchain09:47
ssam2yes09:47
tristanSee for example: https://github.com/gtristan/aboriginal/blob/master/sources/sections/gcc.sh09:47
tristanAs I recall, we build gcc once without libstdc++09:48
tristanThen we build libc with the new gcc09:48
tristanThen we build libstdc++ from gcc against the new libc09:49
*** xrt has quit IRC09:49
tristanhttps://github.com/gtristan/aboriginal/blob/master/build.sh is the main flow of it09:50
tristanonce stage2 is done, we have all cross tools for host arch09:50
tristanand then we do https://github.com/gtristan/aboriginal/blob/master/native-compiler.sh09:50
tristanwhich is cross building native binutils, libc, gcc09:51
ssam2sure. So I guess the puzzle is how to implement native-compiler.sh in the context of BuildStream09:51
tristanssam2, it's not that crazy; but what I would do it use that build as a reference, first for the general flow of it09:52
tristanAnd then again when things break for some reason, there are probably some tricks in there that help09:53
tristanssam2, in any case, always assume there is a host arch compiler built in /09:53
tristanSo stage1 actually becomes something like: https://github.com/gtristan/aboriginal/blob/master/simple-cross-compiler.sh09:53
ssam2i was hoping to be able to have a shared gnu-toolchain stack that can be used for both cross bootstrap and normal builds, do you think that's feasible ?09:54
tristanfirst you build a cross compiler, then you use that cross compiler to build a native compiler, taking care of that build-gcc-twice thing09:55
tristanssam2, Yes certainly09:55
ssam2great09:55
tristanssam2, the trick to that is pretty simple actually09:55
tristanssam2, you just make sure you use a different host triple09:55
tristanSo I think basically you get around it by always calling your cross compiler ${arch}-unknown-${abi}09:56
tristanAnd your native toolchain is ${arch}-linux-${abi}09:56
tristanthe unknown vs linux makes sure all those toochain builds go through the same steps09:57
tristanssam2, so yeah the one thing I'm not entirely sure of... is what to do with the existing 'arch' conditionals09:58
ssam2in a backwards compatibility sense?09:58
tristansort of09:58
tristanI mean, what do they mean, host ? or target ?09:59
tristanI guess an "arch" conditional is target ?09:59
tristanand makes the implicit assumption that host = target ?09:59
tristanRight now we use it for, selecting which binary runtime to import09:59
tristanBut will also end up using it to pass special flags to some builds10:00
tristanssam2, I leave that question for you to reason about :)10:00
tristanI think that essentially, we keep --arch... and we add --host-arch and --target-arch... everything that currently only cares about --arch, continues to do so10:01
tristanOnly the low level cross compiling things care about --host / --target10:01
ssam2but for stage 3 we also have to think about --build perhaps10:01
ssam2i'm not sure this is the whole picture10:01
ssam2https://etherpad.gnome.org/p/SnvGnQuCmP10:01
ssam2i've tried to write out a native vs a cross bootstrap10:02
tristanSo what is stage3 exactly ?10:02
tristanin your definition of the day ?10:02
ssam2the elements in gnu-toolchain/ which don't have stage1 or stage2 prefixed to their names10:02
tristanssam2, I dont think those exist10:03
tristanthey have to go away10:03
tristanor be a part of stage2, rather10:03
tristanquoting myself from beginning of conversation:10:04
tristan<tristan> So whatever we have in gnu-toolchain, as a first step, has to first ensure that no code that has been built, will be run10:04
tristanssam2, that means that basically, the output of a base runtime has to ensure that all the native stuff was built with the cross stuff10:04
ssam2I agree on that10:04
ssam2ok, maybe stage1 is the thing that's confusing matters, it doesn't need to be there10:05
ssam2(except because of GCC build weirdness)10:05
tristanThats sort of why I would prefer you try the aboriginal flow10:05
tristanit's much more straight to the point10:05
tristanyou might just even try building it once10:05
tristanAnd observe the flow10:06
tristanssam2, Note that the 'host-tools' beginning stage is throwaway, we dont need that because of deterministic host inputs10:06
ssam2does https://etherpad.gnome.org/p/SnvGnQuCmP make more sense?10:07
ssam2I don't think it correspond to the current gnu-toolchain stratum, that's probably where i've been getting confused10:08
ssam2but as long as there's some way in buildstream to work out that $target_arch needs to mean armv8b64-unknown-linux-gnu in some places and armv8b64-baserock-linux-gnu in others, it seems workable within BuildStream10:08
tristanNo it does not work exactly the same as the current baserock things10:10
tristanssam2, look at configure_gcc() function, and how it's invoked in https://github.com/gtristan/aboriginal/blob/master/sources/sections/gcc.sh10:11
tristanNote that we make use of --program-prefix10:11
ssam2my confusion isn't over how to build a cross compiler, I did this exact same work 5 years ago ... it's just how to fit into buildsdtream10:11
ssam2but I think I get it now10:11
tristanand in the canadian-cross builds, we do alot of env assignments before configure, like CC_FOR_TARGET=${CC_PREFIX}cc10:12
tristanwhere CC_PREFIX is actually the --program-prefix we gave in the stage1 build10:12
tristanwhich is like "${arch}-"10:12
tristanssam2, yeah - I understand, I broke my brain cells quite a bit wrapping my head around this last year; the thing is I really think landley's builds are done very well compared to ours; and they get "every host/every target" done with the same build scripts10:14
tristanThat is what we want10:14
tristanYou can go pretty far down the rabbit hole10:14
ssam2we should really just spend a year rewriting the GCC build system ;-) but that's more than just a rabbit hole10:16
ssam2probably more than a year as well10:16
tristanEh10:16
tristanI have little faith10:16
tristanBetter put that effort in clang or smth else10:16
ssam2well, perhaps. there's less C++ in gcc though :-)10:17
tristangcc has hard coded paths depending on what C library *it* was compiled with10:17
ssam2yeah gcc has all sorts of mess10:17
tristanSo you can NOT build a program against a libc that GCC was not compiled against10:17
tristanWhen I asked about this, I was told: NO.10:18
tristanalmost there, I have totally lobotomized the sandbox API to allow some things and I think I've put things in the right places11:41
tristanAnyway now the sandbox directories are split up a bit, with root/, user/ and scratch/ subdirs11:43
tristanElements stage artifacts into root, but anything else custom (sources) into user/11:43
tristanAnd can define mount points for things they add in user/11:43
tristanThis leaves the sandbox implementation(s) free to do things a bit differently, like take care of adding a fuse layer (mounted via scratch/) on the /, in the case that it is not read-only, to provide the copy-on-write hardlink thing11:44
tristananyway all the elements seem to be working now with this adjustment... just have to plugin that fuze layer11:45
tristan*fuse ... and then I can undo my workaround for artifact caches and start using user mode checkouts again11:46
*** tristan has quit IRC12:33
*** jonathanmaw has quit IRC15:24
*** jude has quit IRC16:45
*** tiagogomes has quit IRC17:15
*** ssam2 has quit IRC17:15
*** violeta has quit IRC17:15
*** violeta has joined #buildstream20:22
*** violeta has quit IRC20:27

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