IRC logs for #buildstream for Thursday, 2017-05-25

*** violeta_ has joined #buildstream07:22
*** tiagogomes has joined #buildstream07:47
*** violeta_ has quit IRC07:57
*** violeta_ has joined #buildstream08:01
*** jonathanmaw has joined #buildstream08:40
*** tristan has joined #buildstream09:01
jonathanmawmorning/evening tristan09:02
tristan:)09:02
jonathanmawI'm having a look at https://gitlab.com/BuildStream/buildstream/issues/16, and I'm not entirely sure what to do with it09:02
tristanI had doctors appointment in the afternoon, arriving a bit late09:02
jonathanmawAIUI, you feel that the script element is inflexible. In what way?09:02
tristanjonathanmaw, right :)09:02
tristanSo, you know how BuildElement works right ?09:03
jonathanmawtristan: not specifically. that's buildstream/element.py?09:03
tristanI recently documented that pretty well actually: https://buildstream.gitlab.io/buildstream/buildstream.buildelement.html#module-buildstream.buildelement09:04
tristanNo, buildstream/element.py is the base class for all elements09:04
*** ssam2 has joined #buildstream09:04
tristanAnd BuildElement is a derived abstract class which we use to drive all the build related elements, like autotools, cmake, meson etc09:04
jonathanmawok09:05
tristanjonathanmaw, So for instance if you look at autotools: https://gitlab.com/BuildStream/buildstream/blob/master/buildstream/plugins/elements/autotools.py09:05
tristanyou can see the .py basically does nothing09:05
tristanThat is not a hard requirement for what I want from a base script element, but the idea is that you can make many different powerful derivations without having to write much code09:06
tristanA lot can be done just in the yaml09:06
tristani.e. https://gitlab.com/BuildStream/buildstream/blob/master/buildstream/plugins/elements/autotools.yaml09:06
tristanautotools plugin is mostly just yaml09:06
tristanjonathanmaw, So... I want something like BuildElement, but something that is configurable for running scripts09:07
tristanwhere one must stage at least one base dependency set at /09:07
tristanBut can stage zero...N other bases in other directories below the /buildstream directory09:07
tristanjonathanmaw, So think of the /buildstream directory as special, it's the only place we ever stage anything other than the base runtime09:08
tristanThe reason for this special case... is because we have a Sandbox option which allows staging the / read-only09:08
tristanbut keeps /buildstream read-write09:08
tristanjonathanmaw, I recently forced (hacked) the script element to not mount root readonly09:09
tristanThis is because I also have a use case for running scripts directly in the root, which modify the root09:09
tristan(i.e. with the GNOME multistrap base system, I need to do a conversion step with a script element that runs dpkg --configure -a)09:10
tristanjonathanmaw, So for instance one option for derived plugins, is to decide whether the root should be readonly or not09:10
tristanjonathanmaw, Also, I think it would be good if subclasses of the base script element can decide on domains of commands to run09:11
tristanI.e., like BuildElement has a set of configure-commands, build-commands, install-commands etc09:11
tristanBut this would be more abstract09:11
tristanjonathanmaw, the idea behind that is... to write an image deployment, we probably want to break this down into: Commands to make a boot partition bootable (syslinux and suchlike), Commands to generate an fstab, Commands to create the filesystems, commands to create a disk image and splice the created filesystems into it09:13
tristanlike you saw with the crazy script I showed you yesterday09:13
jonathanmawok09:13
tristanSo we probably want sane defaults for this, and as much configuration in the yaml as possible in the base script element09:14
tristanThat means that, projects which have some special need dont have to write a python file to crank out a crazy script if they so desire09:15
tristanBut at the same time, we want to create specialized derivatives09:15
jonathanmawso, we want to have a x86-image element that derives from an enhanced script element and by the magic of an associated yaml file already has the default commands09:15
tristanSo that we have an included x86-image plugin in buildstream, which we can use instead of that crazy script in projects09:15
tristanExactly09:16
jonathanmawand we want to extend the script element to group commands by domains, so that we can say "only do these groups of commands"09:16
tristanBasically we want to repeat the pattern we did with BuildElement, but with a bit more flexibility, so we can crank out plugins like x86-image09:16
tristanYeah09:16
tristanMaybe for that, the default is to just have "commands", but if a plugin defines a list of command domains, that overrides the default09:17
jonathanmawand they can of course override all of the commands in an individual domain, which saves them from having to override every single command and basically rewrite it from scratch.09:17
tristanWell09:18
tristanDerivation in buildstream is not that flexible09:18
tristanplugin-wise09:18
tristanjonathanmaw, the ScriptElement base abstract class will have to live beside BuildElement, in the core and not as a plugin09:18
tristanloaded plugins cannot derive from eachother09:19
tristanbecause we dont have a plugin system that allows inter plugin dependencies09:19
tristanwe probably could, but I dont think it's that important09:19
ssam2another thing buildstream has in common with gstreamer  ;-)09:20
tristanheh09:20
tristanjonathanmaw, so anyway, a plugin will probably define all of its default commands, and the command domains it wants to run09:20
tiagogomesDoes buildstream also provide insane amounts of colourised debug information?09:20
ssam2there are colours!09:21
tristantiagogomes, yes, but we stick to a format color and content color mostly all around09:21
tristanand dont do too much rainbow I think09:21
tiagogomes:)09:22
tristanjonathanmaw, of course, when someone declares an element of that kind (i.e. writes a file.bst), they can then override commands in their yaml as usual09:22
tiagogomesgstreamer allows plugin writers to define a color for the plugin debug09:22
tristanjonathanmaw, actually for reference, the order of priority for how configurations are applied is documented here: https://buildstream.gitlab.io/buildstream/format.html#element-composition09:23
jonathanmawtristan: ok, so for example, x86-image would have filesystem-arranging-commands, syslinux-config-commands, and partitioning-commands, and "command-domains: [filesystem-arranging, syslinux-config, partitioning]"09:24
tristanjonathanmaw, right, so that's the basic idea yes, _but_ I dont want command-domains itself to be configurable in the yaml09:25
tristanthis is mostly a question about presenting a digestible/understandable API09:25
tristanjonathanmaw, So that would be a one liner that the derived ScriptElement would do in python09:25
tristanAnd the x86-image plugin would then show only a yaml API that makes sense for itself09:26
tristanjonathanmaw, I know this conflicts a bit with what I said about having mostly things configurable in yaml, but we have to make some judgment calls along the way09:27
tristanjonathanmaw, for instance with this, the default of "command-domains" is [ "commands" ]09:27
tristanthat means the raw element could be used09:27
tristanthat part itself could actually be class data of the plugin09:28
tristan(as opposed to instance data)09:28
tristanjonathanmaw, I'm not sure I understand why you have to call os.makedirs() in bzr->stage()10:03
jonathanmawtristan: I was getting file not found errors when trying to stage10:04
tristanjonathanmaw, in normal circumstances, your plugin will stage sources in /buildstream/build/<contents of repo> ... i.e. os.makedirs() is getting called on /buildstream10:04
tristanSo then your file not found errors were... entirely from your test case ?10:05
jonathanmawthe full path seemed to be buildstream/build/<tmpdir>/buildstream/build, though I'm not sure why.10:05
jonathanmawthis was not in the test case, iirc10:05
tristanHmmm, this sounds dangerous, I better try it10:06
tristanDo you have that emacs element lying around anymore ?10:06
jonathanmawhttps://pastebin.com/3Qn8kdCa10:06
jonathanmawtristan: so, apart from taking arbitrary command domans, the enhanced scriptelement must also be able to stage elements to arbitrary places as read-only/read-write?10:19
jonathanmawto the extent that "/" in the stage can be read-write10:19
tristanjonathanmaw, so the sandbox only has an option to mount / readonly or readwrite, and /buildstream is always read-write10:23
jonathanmawand we can stage multiple things inside /buildstream10:23
tristanjonathanmaw, so it must stage one element at /, asides from that, it should be allowed to stage an arbitrary number of elements in directories under /buildstream10:23
tristanExactly10:24
jonathanmawso "base" will take an element and permissions. "input" becomes multiple element-permission pairs10:25
jonathanmawwould they be installed in a subdir based on the element's name, or allow that to be user-defined as well?10:25
tristanThat is one way I suppose10:25
tristanbut consider this a complete rewrite of the script element10:25
tristanwe have one chance to make the best API10:26
tristanjonathanmaw, I think for instance, if we are not going to specify any additional elements to stage (i.e. we are only staging one element at /), then we should not have to specify which of the dependencies is the base one10:26
tristanhowever, that may not mean imply that the / is readonly (maybe we stage certain dependencies, to write a script which produces something to be collected in /buildstream/install)10:28
tristanThe root should be readonly unless otherwise specified (default readonly root is best I think)10:28
tristanjonathanmaw, also note that... in the case that we are only staging things in / and nothing else, then we should be staging Scope.BUILD of self10:29
tristanOtherwise we stage Scope.RUN of a specified dependency10:29
jonathanmawtristan: would that mean a "dependencies" list, where the first element defaults to installing to "/" and is read-only, and subsequent elements default to "/buildstream/%{name}" and are read-write?10:31
jonathanmawand we throw a wobbly if after going through all those elements, none of them install to "/"10:31
*** tristan has quit IRC10:33
*** tristan has joined #buildstream10:42
tristanHere I was whining about how bst track emacs.bst was hanging10:43
tristanturns out I lost my connection :-S10:43
jonathanmawhrm, I commented out the directory creation and tried again, and the problem seems to have vanished10:44
jonathanmawso I guess I can take that out10:47
tristanI think so, I'm trying to reproduce here but looks like savannah doesnt wanna give me emacs :-(10:47
jonathanmawit took me about 30 minutes to clone :/10:47
tristanmaybe they know I was bad mouthing their ancient website https://savannah.gnu.org/10:48
tristanand they've singled me out !10:48
tristanjonathanmaw, Ok well, one other thing, functionally I can see that you're two functions for the atomic repodir thing... seems they can be collapsed into the context manager10:49
tristanYou only call the context manager from one place (which _ends_ with yield) and in that place, you end up calling that other function at the end10:49
*** ChanServ sets mode: +o tristan10:51
jonathanmawtristan: hrm, I could make _atomic_repodir call _atomic_replace_mirrordir after the yield10:52
tristanjonathanmaw, that's what I was observing yeah, looks like they belong together10:52
jonathanmawI think I did it that way because _atomic_repodir could in principle be used for non-mirroring tasks, but it looks like it's too specific here to actually warrant that.10:53
jonathanmawso I'll move the _atomic_replace_mirrordir10:53
tristanOk10:54
jonathanmawI'm not in favour of merging the functions because I'd find it harder to read, what with all the exceptions going on10:54
tristanyeah, sometimes it's better to name a function for readability even if you're not going to reuse it, I agree10:54
gitlab-br-botbuildstream: merge request (jonathan/bzr-source->master: Jonathan/bzr source) #19 changed state ("opened"): https://gitlab.com/BuildStream/buildstream/merge_requests/1911:06
tristanjonathanmaw, ok I'm just going to wait... have been wasting time looking for a more efficient repository than savannah11:14
tristanTrying to clone emacs and bzr itself (from launchpad) in parallel now11:14
tristananyway, sorry please dont give too much thought to bzr anymore, I expect it'll work I just wanna see it and feel it myself11:14
jonathanmawok11:15
tristanAlso, I think there is another bug with bzr but I'll try to figure it out, it's a tough one11:15
tristanSeems to consistently behave badly with cntl-C, I think it's my fault11:15
tristanweird, bzr seems to be doing something in my system /tmp11:19
tristanls -l /tmp/bzr-index-ClGP4J 3.7M11:19
tristandownloading at 300K, and du -hs the trunk dir from bzr branch still says 20K11:20
tristanOh, it's going into .bzr *beside* trunk/11:21
tristanOk, something is happening11:21
jonathanmawtristan: do we need to maintain backwards-compatibility for existing script elements?11:36
tristanjonathanmaw, No.11:48
tristanabsolutely not, the current is garbage11:48
tristanthere are 2 use cases and we'll replace them11:49
jonathanmawtristan: ok, and if the definitions->bst importer creates an script elements, it's up to them to get it right now.11:52
tristanjonathanmaw, it's up to us to fix that after12:05
tristanthere are two, and actually in neither case does the importer generate that12:06
tristanit's static data12:06
jonathanmawtristan: Do we want script elements to always collect output from the %{install-root} directory, or do we want to be able to override it and specify something else?12:25
tristanjonathanmaw, we definitely want to be allowed to collect from any location12:25
tristanBUT12:25
tristanI have been pondering this a bit12:25
tristanjonathanmaw, and I think that the two are not mutually exclusive12:26
tristanI.e. we can say Yes: Output is always collected from '%{install-root}'12:26
tristanAnd we can also say Yes: You can always set the value of install-root in your variables section of your element.12:26
tristanThe only question here is, is this good API ?12:27
jonathanmawtristan: the script element currently has config.collect, which defaults to "%{install-root}". I think I'd rather override collect than mangle install-root12:30
tristanNot sure, I think I have scrutiny for using %{install-root} overrides, but not for the same reasons12:33
tristanFirst, I think it's perfectly valid that an element author should set variables: sections to override default functionality12:33
tristanHowever, I'm just not convinced that using the word 'install-root' here makes sense; since install-root is mostly used by the build element as a make install location12:34
tristanThat said, I think I like the current approach for that in the current script element12:35
tristanTo default to %{install-root}, but then; it does seem a bit superficial that we have a parameter for it12:35
tristanjonathanmaw, so there is also another principle here to consider; which is, allowing multiple methods of achieving the same thing12:36
tristanWhich is something I tend to dislike as well12:36
tristanjonathanmaw, if we go with the current approach, then it becomes possible to override install-root variable, in order to achieve the same thing as overriding 'collect' in the config: section12:37
tristanwhich raises the question, why did we add that configuration in the first place ?12:37
tristanI dont know... ssam2 have any thoughts about this ?12:37
jonathanmawhmm. I was uncertain whether overriding install-root would actually work that way12:38
tristanI'm tending towards actually preferring avoiding adding additional config: parameters when the same can be achieved by setting a variable12:38
ssam2tristan, I've not thought about this deeply at all. I think 'collect' is a slightly confusing concept though12:38
ssam2non-intuitive, at least. it's not really confusing once you figure out what it means12:39
tristanvariables work all the way down to the project configuration (if declared there)12:39
tristanjonathanmaw, so something with a default in the project, can be overridden by a default on the element type, it can then be overridden again for all "foo" elements of a given project in the project.conf (at the end), and the final word is given to the element declaration (the foo.bst file) itself12:40
tristanactually jonathanmaw... I recently changed some of the build elements with something interesting...12:42
tristanjonathanmaw, see how 'conf-extra' works in https://buildstream.gitlab.io/buildstream/elements/autotools.html#module-elements.autotools for example12:42
tristanThis was basically done so that a project can add project wide configure flags, which do not conflict with element specific stuff, but an element can itself also just set conf-extra to add a configure option (but that would override any project wide setting)12:43
tristanjonathanmaw, ok lets go ahead with just stating that output is collected from 'install-root', which a user can set12:44
tristanwe have some months ahead of us before hardening, if we find something horrible about it, we'll change that (but hope we dont have to)12:45
jonathanmawlooking at buildelement, they have the command-subdir variable for where to start the command from. I think we would benefit from doing that, too.12:46
* tristan notes that after a first stable release, we'll have to define a release cycle and let plugin API additions land early in the cycle to allow API churn in master before releasing stable12:46
tristanyes, that is a good point too12:47
tristanjonathanmaw, I wonder if we may want that even on a per command-domain basis12:47
tristanhaving to write multi-line commands starting with 'cd foo' is obnoxious12:48
jonathanmawok. with the working directory defaulting to %{build-root} (I have no idea what build-root should sensibly be in a script element though), and definable for every command-domain12:49
tristanmaybe per-command-domain CWDs is overkill, not sure :)12:49
jonathanmawDefining it in yaml gets trickier12:49
tristanindeed12:50
jonathanmawI think I'll go with working dir being a per-element thing for now12:50
jonathanmawtristan: what does %{build-root} usually get set to?12:50
jonathanmawiirc in baserock it was /%{name}.build12:51
tristanYes, also I sort of feel like %{build-root} is not sensible for script elements12:51
tristan%{build-root} is /buildstream/build12:51
tristanBut /buildstream/build exists for building sources12:51
tristanSo far, I think we dont allow sources in script elements12:51
tristanAnd I think that is quite OK12:51
tristanFor manual building of sources, we have the 'manual' build element which should provide everything we need12:52
tristanAnd we can always use a 'compose' element or 'import' element if we want to combine with 'script'12:52
jonathanmawSo for the script element, the default working directory should be "/", and be overridable12:53
jonathanmawand with any luck, we can ignore the existence of %{build-root} altogether.12:53
tristanSure, it could be '/' by default, or, it could be: '/' by default if no additional elements are staged (and no /buildstream directory gets created)12:53
tristanOtherwise it could default to /buildstream when other elements get staged "somewhere below that"12:54
tristanBut maybe a static default is easier and even more comprehensive12:54
tristanThat said, it could still be defined as a variable instead of something collected form the config: section12:55
jonathanmawtristan: yep. in buildelement, it's the variable command-subdir.12:55
tristanjonathanmaw, right, and iirc it's called 'subdir' because its a subdirectory of %{build-root} (not an absolute path)12:57
jonathanmawtristan: so, "command-dir" then?12:57
tristanor cwd, even ?12:58
tristancurrent-working-directory is damn lengthy, but everyone understands cwd (I think)12:59
tristanthen again, command-dir is also fine, or work-directory12:59
tristanjust throwing around ideas :)12:59
jonathanmawI think we can get away with "cwd". AIUI, these variables don't get exported as environment variables, so shell commands won't get confused by the environment variable CWD, or the command cwd13:01
tristanNo they are not... actually we have environment: section for that :)13:03
tristanThe environment dictionary is what ultimately gets set into the environment, and it's values are substituted with the elements variables, too13:04
tristanHa !13:09
tristanjonathanmaw, Ok I've been debugging bzr, and I found it !13:09
tristanmouahahahaha13:09
jonathanmawerm13:10
tristanOk I'll fix it myself13:10
tristanyou will first facepalm, then you have permission to blame me :)13:10
gitlab-br-botpush on buildstream@master (by Tristan Van Berkom): 6 commits (last: Add bzr source plugin) https://gitlab.com/BuildStream/buildstream/commit/4653feb0c6b63dc97cadaf8c2a593664f990076f13:16
gitlab-br-botbuildstream: merge request (jonathan/bzr-source->master: Jonathan/bzr source) #19 changed state ("merged"): https://gitlab.com/BuildStream/buildstream/merge_requests/1913:16
tristanjonathanmaw, https://gitlab.com/BuildStream/buildstream/commit/92eab614c940677a64fc4d911b2438a7c2fe5f5a13:17
jonathanmawwow13:17
tristanyeah13:18
tristanNow I think we need better error tracking in the core for this, those stack traces were hard to follow13:18
gitlab-br-botbuildstream: issue #9 ("Enhancement: bzr source") changed state ("closed") https://gitlab.com/BuildStream/buildstream/issues/913:23
jonathanmawtristan: are these new dependencies going to have to live in config (and essentially be duplicates of the "dependencies" section earlier on but with more metadata), or can we put it in the root "dependencies" section?13:24
gitlab-br-botpush on buildstream@master (by Tristan Van Berkom): 1 commit (last: Docs Makefile: Dont generate plugin skeletons for __init__.py) https://gitlab.com/BuildStream/buildstream/commit/c4b5f665bedd1816e2849d899b7d08061f8496cf13:25
tristanjonathanmaw, thats a bit of a constraint for us... we have to have dependencies in the regular place13:27
tristan<tristan> jonathanmaw, I think for instance, if we are not going to specify any additional elements to stage (i.e. we are only staging one element at /), then we should not have to specify which of the dependencies is the base one13:28
tristanI.e. hence that comment from earlier on13:28
jonathanmawok. perhaps we should use a different name than "dependencies" for them then.13:29
jonathanmaw"stages"?13:29
tristanjonathanmaw, basically the core / loader will resolve the dependency graph long before the plugin is instantiated and such13:29
tristanYeah in the config we need a good name13:29
tristaneach of them need to specify some things... like A.) What directory under /buildstream to put them at... B.) the element name itself...13:30
tristanjonathanmaw, I guess it's fair to say that, if the directory is not specified, then it is the root dependency ?13:31
tristanAnd if none at all are specified, then we just stage the Scope.BUILD dependencies of the self element at the root ?13:31
tristanNice, looks like the CNTL-C (suspend/resume) functionality is fine with bzr, as long as the other bug was fixed13:33
jonathanmawSo, they default to just using the depends in the order they're given (first one is read-only /)13:33
jonathanmawbut can be overridden with greater detail in config13:33
tristanjonathanmaw, I dont believe I follow what you mean13:35
tristanjonathanmaw, I mean that... in the case that you dont specify any elements to stage in subdirs, as a special case, we just stage all the dependencies of self at /13:35
tristanotherwise, you have to specify an element for each thing that you stage, including the thing you stage at /13:36
tristanjonathanmaw, (note that there is no such thing as an order of things specified in depends)13:37
tristanyes it is a list, but that is superficial13:37
jonathanmawhrm13:37
tristanthey are resorted by dependency at load time13:37
tristanso the order has no meaning, except that when iterating over self.dependencies(), you can be sure that the first element does not depend on the second, etc13:38
jonathanmawok. So default with multiple elements in depends is to stage them all to /, and / is read-only.13:39
tristanhttps://gitlab.com/BuildStream/buildstream/blob/master/buildstream/_loader.py#L63113:39
jonathanmawBut if we want more, we define it in config13:39
tristanYes13:39
tristanjonathanmaw, the thing is, there is no way currently to stage more than one element to a given directory13:40
tristanbecause then the whole dependency resolving thing needs to be rerun, in that case the user need just provide a single element which depends on others; to stage in a subdir13:41
jonathanmawDo we still want to try and guess at sensible defaults when it's being overridden with config? It's getting complex to explain in the docstring, so I think it's going to be similarly complex to implement13:41
tristanok hold on...13:42
tristanI think it's not that complex13:42
tristanBut looking at this should be more telling: https://gitlab.com/BuildStream/buildstream-tests/blob/gnome-conversion-base/elements/base-configure.bst13:43
tristanjonathanmaw, So basically, that script is pretty straight forward, and I suspect similar things could happen; like just some hack someone wants to run before deploy13:44
tristanjonathanmaw, I feel like specifying base-system.bst twice in that case is redundant13:45
tristanespecially since we're not staging anything else13:45
jonathanmawtristan: ok. For cases where there are more than one element in depends, we can't make the same guess, so those will always require some amount of overriding13:48
jonathanmawgiven it inherits element, I should be able to call self.dependencies(scope, recurse=False)13:55
tristanjonathanmaw, I dont think that is the case, conversely, in cases that nothing is specified for staging things13:55
jonathanmawif I can figure out where scope comes form13:56
tristanso ok, lets have a name for that13:56
tristanI dont like "stages" really13:56
tristansounds like parts of a process13:56
jonathanmawdepends-layout?13:56
tristanyeah, or just "layout"13:57
tristanSo in the case that no "layout" is specified, we stage Scope.BUILD dependencies of self in /13:57
tristanOtherwise we stage Scope.RUN dependencies in every place that is specified in the "layout"13:57
tristanhttps://buildstream.gitlab.io/buildstream/buildstream.element.html#buildstream.element.Scope13:59
tristanThat is scope13:59
jonathanmawwhich is defined in the yaml by giving the depends the type "build" or "run"?13:59
tristanNot exactly no, however those are intrinsically linked13:59
tristanjonathanmaw, Scope defines a scope of an element, while the "build" or "run" attributes of a dependency of an element define the nature of that dependency relationship specifically14:00
tristanSo, those are dependency types, explained here: https://buildstream.gitlab.io/buildstream/format.html#dependency-types14:01
tristanBy default an element is both a runtime and build dependency14:01
tristanWhich means: I need this element in order to run, and I need this element in order to build14:01
tristanjonathanmaw, The Scope rather gives us a decision of what dependencies to pull in, depending on their types14:02
jonathanmawSo we'd expect a gnome-system script to have in its depends "deploy-base" with type "build", and "gnome-system" with type "run", and have layout say what to do with gnome-system?14:02
tristanNot really; note that in the current script element I have disallowed at preflight time; any elements which are not explicitly only build type dependencies14:03
tristanI think that is going to continue to make sense14:04
tristanjonathanmaw, can you think of a case; where a script element's output artifact still requires that script element's dependencies afterwards ?14:04
tristanIn both known cases, the dependencies of the script element itself must be non transitive14:05
jonathanmawok14:05
jonathanmawI think I've gotten confused somewhere. You think we should stage Scope.BUILD dependencies to / when layout isn't specified. And stage Scope.RUN dependencies according to layout, when it is specified.14:08
jonathanmawso would that mean that base-configure would have all their depends with type build, and gnome-system-image would have all their depends with type run?14:08
persiaLibraries for interpreted languages are a good case where a given element may be both a build-dependency and a runtime-dependency (well, for languages with less specialness.  perl, shell, etc.  Less so python, because specialness).14:14
persiaThe moreso for build processes that include `make test` or equivalent.14:15
tristanjonathanmaw, There is a distinction here you missed I think... when we stage Scope.BUILD dependencies to / as a fallback/default... it is the dependencies of _self_14:16
tristanjonathanmaw, whereas when we stage specific things into a layout, it is Scope.RUN dependencies of _those specified elements_14:17
jonathanmawso self is the element, e.g. gnome-system-image.bst, and the Scope.BUILD dependencies of it are deploy-base.bst and gnome-system.bst.14:19
jonathanmawwhen we have "layout", each element specified in that layout has its Scope.RUN dependencies staged?14:20
tristanjonathanmaw, ummm, ok so YES to the second thing14:21
tristanjonathanmaw, to the first thing... The Scope.BUILD dependencies of gnome-system-image.bst are what you said, and _additionally_ the transient runtime dependencies of those element14:22
tristans14:22
tristanjonathanmaw, lemme find a better example...14:22
tristanjonathanmaw, https://gitlab.com/BuildStream/buildstream-tests/blob/build-gnome/elements/gtk3/gtk3.bst14:23
tristanjonathanmaw, ok so gtk3.bst in that tree... has 3 dependencies, which are both runtime/build (default)14:24
tristanjonathanmaw, the Scope.BUILD of gtk3.bst is all the dependencies which _must be staged_ in order to build gtk314:24
tristanjonathanmaw, that means, gtk-deps.bst, wayland-generic.bst and x-common.bst... PLUS all of the "runtime" dependencies of those, recursively14:25
jonathanmawok, so dependencies of type "build" won't be picked up as part of recursive scoping14:27
tristanjjardon[m], This is the cause of the gitlab build failures btw: https://github.com/ostreedev/ostree/issues/633 I'm pretty sure, now why would hardlinks fail I have no idea, but they seem to also on my aarch64 build machines14:28
tristanjonathanmaw, exactly, they are non transitive14:28
tristanjonathanmaw, well, that is to say, if they are build _only_, think of build & runtime as bits in a bitmask14:28
jonathanmawso in gnome-system-image, we explicitly build-depend on gnome-system and deploy-base. We also implicitly depend on all of their runtime dependencies.14:29
jonathanmawwhich means they'll be present, so we can have "layout" use them14:30
tristanjonathanmaw, Yes, but by explicitly depending on them as "build _only_" it means that anything that depends on gnome-system-image artifact, wont carry in it's dependencies14:30
jjardon[m]thanks for the link tristan14:31
* jjardon[m] subscribes14:31
*** tiagogomes has quit IRC14:35
jonathanmawtristan: do we allow the Scope.BUILD dependencies of self to be defined in layout as well (in cases like gnome-system-image, which depend on deploy-base and gnome-system)?14:35
tristanjonathanmaw, I think not14:35
jonathanmawI'm not sure how something like gnome-system-image would be set up, then. A deploy-base that depends on all the things you want to include in layout?14:37
tristanjonathanmaw, in gnome-system-image, we stage deploy-base.bst in / and we stage gnome-system.bst in a subdir14:37
tristanOk so, there is no wiggling your way out of the fact of life, that an elements dependencies must be resolved waaay before an element plugin comes along and knows what to do with the dependencies14:38
tristanSo in the case of an element which says "I want to stage this standard debian base system with some host tools I know will work, which I can use to wrap up a system I build which is staged in /buildstream/input into a booting image"14:40
tristanI.e. remember that these are _two different systems_14:40
tristanYou dont want to overlap them and ever stage the Scope.BUILD dependencies of self, as they will inevitably contradict eachother14:40
tristanHowever, you still _need_ the "depends:" to be defined at load time, so that when it comes time to assemble the element, you know those deps are built/cached and available to work with14:41
jonathanmawtristan: yep, so they can't both be staged at /, that'd be completely unhelpful.14:42
tristanjonathanmaw, right, except for the case where you want to script something without staging things in different places14:42
tristanI.e. something that just runs some stuff on / and outputs a modified /14:43
jonathanmawtristan: that'd be one thing staged as "/", or a bunch of things staged carefully so that they're laid out exactly as you want.14:44
jonathanmaw(for when you're outputting a modified /)14:44
tristanRight, except when you say "one thing" staged as "/", you may be talking about multiple dependencies14:44
tristanThat is okay14:45
tristanbecause the Scope.BUILD dependencies of 'self' are resolve14:45
tristand14:45
tristanIt is always impossible, of course, to ever stage the Scope.RUN dependencies of self in an assemble method of self14:45
tristanbecause self has not yet produced an artifact14:45
jonathanmawtristan: by 'one thing staged as "/"' I was referring to the likes of base-configure, which only depends on one element14:47
jonathanmawa bunch of things staged carefully would be like gnome-system-image14:47
tristanjonathanmaw, yes exactly, I'm just remarking that base-configure only happens to declare one dependency, but it could depend on multiple14:49
tristanit would still be "the Scope.BUILD dependencies of self in /"14:49
jonathanmawtristan: ok, base-configure has one _declared_ dependency, but also all the implicit dependencies of it as well, which all end up in /14:51
tristanright14:51
jonathanmawgnome-system-image, however, declares gnome-system and deploy-base, which cannot both be staged directly to /14:51
tristanjonathanmaw, the reason why this distinction I'm making is significant, is because the way that the multiple dependencies declared on self are resolved is significant14:52
tristanI.e. it is impossible to reliably say "stage foo and bar here"14:52
tristanbecause without having a single element, there is no resolved deterministic staging order14:52
tristanthat is done in the loader, before anything else14:52
jonathanmawright14:52
jonathanmawso for staging, depends does not guarantee any ordering, so it only gives us useful information when we have only one declared dependency14:53
tristandepends does not decide the order14:53
tristanright14:54
tristanyou can reorder your depends as much as you like: same cache key, same staging order14:54
jonathanmawWe seem to be disagreeing on what to do when there's multiple declared dependencies. I think in that case we should stage them according to "layout"14:54
tristanRight, and that is incorrect, the semantic is backwards14:55
tristanIf there is a layout defined, then you must decide what to put where, including /14:55
tristanIf there is no layout, then you get all the Scope.BUILD dependencies staged in /14:56
tristanjonathanmaw, basically, you are proposing that base-configure can only ever depend on one element14:56
tristanBut I dont think that is required to be the case14:56
tristanjonathanmaw, Another thing which may not have been clear14:58
tristanjonathanmaw, you can have only one element listed in "depends:" but you can _still_ have a "layout"14:59
tristanjonathanmaw, for example, you might only need to stage core.bst to have the tools you need in /, in order to do something with a full system in /buildstream/input15:00
jonathanmawtristan: so, in cases like base-configure, stage everything in depends to /, assuming that they know what they're doing if they have multiple declared depends. In cases like gnome-system-image, there are still multiple declared depends, but how they get staged is defined by layout, right?15:00
tristanBecause core.bst can be found somewhere in the dependencies of devel-system.bst (for example), it can still be specified15:00
tristanright, my last comment sort of clarifies this I think15:01
tristanI have to leave this closing coffee shop at present midnight15:01
jonathanmawtristan: I think I'm getting confused because you said only runtime depends of the declared dependencies can be in layout15:02
jonathanmawwhich, aiui, excludes the declared dependencies, themselves15:02
tristanBut basically: If the "layout" is there it will define what element (found in self's dependencies, somewhere) to stage as Scope.RUN at which location; _otherwise_ in the absence of a "layout", default is to stage Scope.BUILD of _self_ (in other words, everything) in /15:02
tristanjonathanmaw, I said "staged as Scope.RUN", not runtime-only dependencies :)15:03
jonathanmawi.e. includes dependencies of type "all", or am I missing something else?15:04
tristanOk... stop for a moment, I have to go anyway15:04
tristanWithout thinking of all of this, please digest this: https://buildstream.gitlab.io/buildstream/format.html#dependency-types15:04
tristanWhich is about the types of dependencies an element can have15:04
tristanAnd then after, digest this: https://buildstream.gitlab.io/buildstream/buildstream.element.html#buildstream.element.Scope15:05
tristanWhich is about how we iterate over a set of dependencies15:05
tristanUnderstand the difference, and by then I will be reconnected from home :)15:05
*** tristan has quit IRC15:08
jonathanmawaha, an element's run scope includes itself15:11
*** tristan has joined #buildstream15:41
tristanjonathanmaw, "aha, an element's run scope includes itself" yes that is an important detail :)15:42
tristanyou need the element you want to run, if you intend to run it15:42
tristanSorry I stopped off to pick up some bbq chicken15:43
tristananyway it's pretty late here, I hope things are making a bit more sense, and if there are any suggestions that can help to make dependencies and element scope more clear, I'd be happy to hear them :)15:44
tristansince the clock is quickly ticking on a hardening which there is no turning back from15:45
tristanNote also that many of the frontend commands also have the concept of scope `bst show --deps <scope>`, `bst track --deps <scope>`15:46
tristanfor consistency I want to make `bst fetch` also have that, `bst build` is a bit special, though15:46
tristanThen `bst shell` has --scope, but maybe that API should be changed since the semantics of running a shell to build or running a shell to launch some program is a bit different than operating on a pipeline15:47
tristan(for instance the sandbox environment must be much weaker for running gui programs from a bst shell, than when trying to build in a clean environment)15:48
jonathanmawtristan: yep, I'm getting my head around it now15:52
*** jonathanmaw has quit IRC17:01
*** ssam2 has quit IRC17:50
*** tristan has quit IRC20:41

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