X-JHBuild: A thin JHBuild wrapper with plug-ins.

Dirk Wallenstein halsmit at t-online.de
Fri Jun 11 04:01:47 PDT 2010


X-JHBuild-0.1.4
===============

New Features:
- repo-group local configuration
- main configuration file
- subcommand aliases
- arch/os filtering of modules
- all modules used in build.sh available by default
- new internal commands and plug-ins.
- run-time environment variables available in plug-ins and hooks (PATH
  and LD_LIBRARY_PATH will be set appropriately). The build-time
  variables are also available to all extensions (hooks & plug-ins).
- shell utility functions to improve the prompt and to navigate

After installation, a user who wants to build all modules would simply
navigate to a directory where the new repo-group should be located and
execute:
  $> x-jhbuild init
  $> x-jhbuild
The result should be very close to what an unmodified build.sh would
produce and will be available in the 'INSTALL' sub directory.

An interesting alternative approach would look like the following (as the name
x-jhbuild is far too long, the example user has aliased it to 'xjh'):
  $> xjh init
  $> xjh tinderwrap
The tinderwrap plug-in wraps the jhbuild subcommand tinderbox, opens the log in
a browser with xdg-open, and informs the user when the build operation has
stopped with Xdialog.

Inspect and edit the configuration with:
  $> xjh show-config # show only effective config settings
  $> xjh edit-config # start $EDITOR for the config file

Some features written out:
--------------------------
The most important change is that the configuration is now saved within
the repo-group root base directory. That allows a lot of nice features
like inter-module navigation and display of the current module-id in the
prompt.

The main meta module in the default moduleset does now comprise all the
modules that are used in build.sh (plus nouveau). Modules that don't
compile on the current os/arch combination will be filtered out. That is
accomplished by filling out the 'skip' configuration variable when
executing the internal command 'init'. There is another internal command
that can generate such lists for other arch/os combinations.

There is now an external configuration file, which eliminates the need to
modify the main script. The default settings without such a main
configuration file changed to settings that facilitate the usage for an
occasional user, whereas the example configuration file contains
settings that appear useful for someone who works with selected modules.
Currently this mainly concerns cwd-module addition.

Installation:
-------------
VERY IMPORTANT: If you already have a jhbuild installation, you need to
update it, because some parts rely on some recently added features.

The installation process is still the same and described more verbosely
in the initial mail [1]. Unpack the attached sources to ~/.x-jhbuild and
make '~/.x-jhbuild/bin/x-jhbuild' available in PATH.

Working with it:
================

Global Access
-------------
A lot of things rely on the availability of a repo-group local
configuration (RGLC). If you want to access a repo-group from any
location it is possible to specify a path to a RGLC file on the command
line and therefore create an alias for it. The RGLC files are located
directly below the repo-group and have the name '.repogroup-config.xjh'.
It is also possible to symlink them from the '~/.x-jhbuild/config'
directory.
  $> alias xjh-test="x-jhbuild -f /path/to/repogroup/.repogroup-config.xjh"

Prompt & Navigation
-------------------
The file '~/.x-jhbuild/var/shell-utility-functions.sh' contains some
functions that allow to:
  - Extend the git PS1 sign with the module-id and optionally the
    repo-group root base directory.
  - Display repo-group or module relative paths.
  - Facilitate navigation within a repository group.
There is documentation within that file. Here some examples. cdx is an
alias for __xjh_repogroup_internal_cd.

Without repo-group display, jump from the 'include' directory of the xserver
module to the libX11 module. Module relative paths are shown:
    ./include (xserver|master) $ cdx libX11
    ./ (libX11|master) $

With repo-group display, jump from the same directory to the repo-group
root directory. Repo-group relative paths are shown:
    ./xorg/xserver/include (test|xserver|master) $ cdx
    ./ (test||) $

The supplied functions can be improved a lot, but are already useful, I
think. Command-line-completion is thinkable but there would probably be
some sort of caching necessary because of the delay to parse the modules
file. Also, I apologize for any lack of shell agnostic exposed by that
functions. Just tell me what you need, or send improved versions. 

A colorless example PS1 could look like:
    PS1='\u@\h $(__xjh_ps1_relpath) $(__xjh_ps1_sign)> '

Building
--------
All build-policies now trigger a build for dirty branches, but I haven't
changed the default build_policy. That might generate false bug
reports. On the other hand it can be very useful to skip to the module
where the previous build stopped. I think the dependency chain would be
more trustworthy if every non-proto package would rely directly or
indirectly on the proto meta module (or the merged proto package), so
that any proto change would trigger a complete rebuild. Then proto deps
could not become incomplete.
Currently the 'build' subcommand does not log to a file (or I missed
that in the many jhbuild commands and options), but I have created a
simple plug-in around the 'tinderbox' subcommand, named 'tinderwrap'. It
uses xdg-open and Xdialog, to open the log in a browser and inform the
user when the build stopped. Maybe a more sophisticated version can be
advertised to the occasional user.
Actually, a mix between 'tinderbox' and 'build' would be really nice,
but that appears to be a more comprehensive task.

Tests
-----
The PATH, LD_LIBRARY_PATH, and FONTPATH environment variables will have
the necessary values in plug-ins and hooks. Therefore it should be easy
to write plug-ins that use the new installation.

Plans
-----
A wiki page with a tutorial and a download option.
Attempt to get a more comprehensive modules file online.

Dirk Wallenstein (45):
      Update the version number
      config: Copy the default config to a template for use with RGLC
      config: Prune documentation from the default config file
      config: Create placeholders in the RGLC template
      Improve moduleset path spec check
      Split command line parsing and option mangling
      Add internal command for RGLC initialization
      Use a repo-group local configuration as default
      Add internal command 'script'
      plugins: Add a plug-in to easily edit the RGLC
      plugins: Add a plug-in to show only the effective configuration
      hooks: Don't prompt when help is requested
      Simplify the build environment preparation
      Additionally set/modify run-time environment variables
      One time modification of env-vars that rely on 'prefix'
      Apply one-time env-var mods globally in the first invocation
      plugins: Display the one-time modified env-vars in testme
      extensions: Don't hardcode bash in shell scripts
      Compute a list of modules to skip
      Insert modules to skip into RGLC configuration
      modules: Finer grained dependencies for added apps
      modules: Simplify two very frequent app dep graphs
      modules: Add application 'bitmap'
      modules: Remove duplicated font tags from my.modules
      modules: Create a meta-module wrapping all font additions
      modules: Add utils present in build.sh and the modular repo
      modules: Include drivers used in build.sh
      modules: Assemble xorg.modules improvements into a section
      modules: Assemble modules for build.sh compliance
      modules: Add repo URL 'git' subdir notes for upstream compliance
      config: Use my.modules as default in the RGLC template
      Add support for an external main configuration file
      Add a main configuration example file
      Make the implicit subcommand configurable
      Add support for subcommand aliases
      Sync the naming scheme for configurable variables
      Add internal command to print modules to skip
      Add shell utility functions
      Let 'script' show the used configuration file path
      Kill process group on SIGTERM
      config: Update build_policy documentation
      config: Shovel misc configuration vars to the bottom
      plugins: Add the 'tinderwrap' plug-in
      Fix a typo
      x-jhbuild-0.1.4

[1] http://lists.freedesktop.org/archives/xorg-devel/2010-May/008111.html

--
Greetings,
Dirk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: x-jhbuild-0.1.4.tar.bz2
Type: application/x-bzip2
Size: 35072 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20100611/cfc96239/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: all-new-commit-messages.log.bz2
Type: application/x-bzip2
Size: 5301 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20100611/cfc96239/attachment-0003.bin>


More information about the xorg-devel mailing list