GNOME Bugzilla – Bug 742264
"virtual" system depends
Last modified: 2015-01-06 19:49:07 UTC
I've been doing a lot of hacking on jhbuild lately, particularly on system depends. There is one more major feature that I've been wanting to add, but I'm not entirely sure how to approach it, so let's discuss that here. I want to make it so that various types of modules will add a "virtual" sysdep for the basic tools required to build it. Some examples: - anything that depends in any way on a .pc file will require path:pkg-config - anything that depends on xml catalogs will require path:xmlcatalog - just about everything will require path:make - autotools modules will require path:automake - cmake modules will require path:cmake - anything to be downloaded from git will require path:git - same for hg, bzr, cvs, svn, etc. The idea here is that: a) we should not need to actually list these modules in sysdeps.modules b) we should not need to actually declare the dependency on each module 'b' is probably easy enough: we can just implicitly add the depends as we process each module type. 'a' is the tricky part. The sysdeps code deals directly in module objects (and I think that's fine). I've thought about implementing this in about three different ways. Let's talk about git, for example: 1) encountering a module depending on git adds a dependency on "git". If that module exists already from the moduleset (either as a sysdep or a normal module) then it becomes a dependency. Otherwise, we create such a module automatically as a sysdep. This would provide a nice override mechanism for people who (for example) wanted to build git for themselves. Maybe not useful for git, but easy to imagine for another tool like cmake. This has a theoretical disadvantage of maybe disrupting dependency relationships in some people's strange modulesets that already have these module names, but I don't think it's a real problem. 2) same as above, but we do it in a namespace ('jhbuild-sysdep-git'?). Potentially, we do not allow modulesets to declare modules inside of this namespace, which would mean that we are always creating the virtual module. We'd probably want to tweak the output of 'sysdeps' to avoid showing the ugly name. 3) we add a simple function for 'gather extra deps' that runs on a list of modules and returns simple strings (of the form 'path:git') according to the modules. The sysdeps code calls this and adds it to the list of required sysdeps. Again, we'd probably need to tweak the output a bit. Of all the alternatives, I like '1' the best, but it's also the one that's potentially trickiest.
Created attachment 293671 [details] [review] modules: fix check on pkg_config variable This variable might well be equal to None, so just check its truth value instead of comparing it to the empty string.
Created attachment 293672 [details] [review] add support for "virtual sysdeps" jhbuild will now automatically add dependencies on things like "make", "git" and "pkg-config" for various modules, depending on their modtype, version control, etc. If these new depends are not available as packages in the module set, virtual ones will be created.
Review of attachment 293672 [details] [review]: ::: jhbuild/moduleset.py @@ +50,3 @@ + 'automake', + 'bzr', + 'cmake' missing a comma there. oops.
Created attachment 293723 [details] [review] add support for "virtual sysdeps" Updated patch with two changes: - missing comma (mentioned above) added - adjusted to gmake vs. make changes in bug 742292
Attachment 293671 [details] pushed as 0002246 - modules: fix check on pkg_config variable Attachment 293723 [details] pushed as e92634a - add support for "virtual sysdeps"