After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 742264 - "virtual" system depends
"virtual" system depends
Status: RESOLVED FIXED
Product: jhbuild
Classification: Infrastructure
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Jhbuild maintainers
Jhbuild QA
Depends on: 742292
Blocks: 742266
 
 
Reported: 2015-01-03 15:56 UTC by Allison Karlitskaya (desrt)
Modified: 2015-01-06 19:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
modules: fix check on pkg_config variable (1021 bytes, patch)
2015-01-03 19:59 UTC, Allison Karlitskaya (desrt)
committed Details | Review
add support for "virtual sysdeps" (7.78 KB, patch)
2015-01-03 19:59 UTC, Allison Karlitskaya (desrt)
none Details | Review
add support for "virtual sysdeps" (7.84 KB, patch)
2015-01-04 20:06 UTC, Allison Karlitskaya (desrt)
committed Details | Review

Description Allison Karlitskaya (desrt) 2015-01-03 15:56:09 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.
Comment 1 Allison Karlitskaya (desrt) 2015-01-03 19:59:45 UTC
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.
Comment 2 Allison Karlitskaya (desrt) 2015-01-03 19:59:47 UTC
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.
Comment 3 Allison Karlitskaya (desrt) 2015-01-03 21:44:36 UTC
Review of attachment 293672 [details] [review]:

::: jhbuild/moduleset.py
@@ +50,3 @@
+    'automake',
+    'bzr',
+    'cmake'

missing a comma there.  oops.
Comment 4 Allison Karlitskaya (desrt) 2015-01-04 20:06:47 UTC
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
Comment 5 Allison Karlitskaya (desrt) 2015-01-06 19:48:59 UTC
Attachment 293671 [details] pushed as 0002246 - modules: fix check on pkg_config variable
Attachment 293723 [details] pushed as e92634a - add support for "virtual sysdeps"