VPATH support for projects

Kuba Ober kuba at mareimbrium.org
Fri Mar 23 13:10:29 UTC 2007


Hi,

in hopes of getting kdevelop to play ball with aegis repositories that have no 
symlinks, I have a feature request/RFC.

Aegis is a software configuration management system. The way it handles 
branching and changes is to only have changed files in a branch/change. To 
find a file, you have to look in your change, if not there look in all the 
branches up along the way to the baseline, then look in the baseline.

As a crude workaround, aegis can provide symlinks to all the necessary places, 
but that becomes slightly awkward when working with repositories that have 
thousands of files, and is really a workaround for broken build tools. I've 
managed to get my aegis repository be non-symlinked for both unix and windows 
builds (visual studio called via wine from a unix build tool). So the only 
thing left is kdevelop :)

To work on something, you create a change in its own working directory. Say in 
project "cool", branch 2.8, you have change 10. It'd be, by default in 
~/cool.2.8.C010. To find the files, you need two directories: the project's 
root directory, and the change directory. Given project name and change 
number, aegis can provide you with both. Assume that project's root is 
in /devel/cool.

To look for a file called "aargh", you need to follow this order:

1. ~/cool.2.8.C010/aargh
2. /devel/cool/branch.2/branch.8/baseline/aargh
3. /devel/cool/branch.2/baseline/aargh
4. /devel/cool/baseline/aargh

Aegis can provide a list of files in each level of this tree. So, could 
inspect following lists in advance and know where each file is:

1. aegis -list change_files -unformatted -project cool.2.8 -change 10
2. aegis -list change_files -unformatted -project cool.2 -change 8
3. aegis -list change_files -unformatted -project cool -change 2
4. aegis -list project_files -unformatted -project cool

Files in list 1 are relative to ~/cool.2.8.C010 (change directory), list 2 is 
relative to /devel/cool/branch.2/branch.8/baseline (branch directory) and so 
on. I've left out details such as dealing with deleted files in those 
lists -- one still uses kdevelop's file list so that deleted files are also 
removed from there so shouldn't be a problem.

Without any specific knowledge of aegis, the direct access to file lists is 
out of the question, so instead the VPATH approach is necessary, where a 
project has a VPATH to look in. If a file is not in the kdevelop project's 
directory, it has to be looked for, in order, in the files given in the VPATH 
(it can be a project variable).

I don't think it necessary for kdevelop to directly provide support for 
generating VPATH programmatically. You'd typically have a script as part of 
the change creation process, which accesses the project's xml file and 
modifies the VPATH accordingly.

Note that the branch contents change over time as other changes get checked 
in, so that every time a file is opened, the VPATH traversal should be 
repeated (no caching!). Also, all the files that are not in the change are 
non-writeable, but kdevelop will already know about that from their 
attributes.

I was wondering whether someone would have a big urge to implement this for 
kdevelop 4, and if not where to start looking in the code? I'd imagine that 
VPATH would be a global project property, and basically ignored if empty, and 
used if not-empty.

Kuba




More information about the KDevelop-devel mailing list