Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

The source code for Jikes RVM is stored in a Subversion repository. A developer can either work with the version control system or downloaded one of the releases.

Download a Release

Major and minor releases of Jikes RVM occur at regular intervals. These releases are archived in the file downloadarea in either tar-gzip (jikesrvm-<version>.tar.gz) or tar-bzip2 (jikesrvm-<version>.tar.bz2) format. Use your web browser to download the latest version of Jikes RVM then to extract the tar-gzip archive type:

> tar xvzf jikesrvm-<version>.tar.gz

or for the tar-bzip2 archive type:

> tar xvjf jikesrvm-<version>.tar.bz2

Use Subversion

The source code for Jikes RVM is stored in a Subversion repository. There is plenty of online documentation for using Subversion such as the Subversion Book or Sourceforge documentation but after installing Subversion the current version of source can be downloaded via:

You can also retrieve a specific version (such as 2.4.6) via:

If you are a core developer you will be able to commit changes to the repository directly. Otherwise you will need to place patches in the patch tracker.

You can browse the online subversion repository at


You may want to retrieve Jikes RVM, make modifications and version control your changes. Unfortunately Subversion does not natively support decentralized development model where everyone maintains their own development tree. For this you will need to use SVK. SVK describes itself as "a decentralized version control system built with the robust Subversion filesystem. It supports repository mirroring, disconnected operation, history-sensitive merging, and integrates with other version control systems, as well as popular visual merge tools."

Note: The directions on this page were partially derived from a blog entry by Scott Laird.

Setting up the Local Repository

After you have downloaded and installed SVK you need to initialize a local repository and import Jikes RVM into local repository.

> svk depotmap --init # Initialize local repository
> svk mirror //jikesrvm/trunk # Setup up mapping
> svk sync --all # Synchronize local repository to all remote repositories

Synchronization will take a long time (Jikes RVM has a lot of history to import) and may need to be restarted if there is problems with the sourceforge servers.

Setting up a Local Branch

After the remote repository has been synchronized you can setup a local branch where you will do all your work and check out a working copy.

> svk cp //jikesrvm/trunk //jikesrvm/local # Setup local branch
> svk co //jikesrvm/local ~/Research/jikesrvm # Check out local branch into directory ~/Research/jikesrvm

SVK differs from Subversion in that the metadata for a checkout is not stored in the directory in which the files are checked out. You will not find any files such as ~/Research/jikesrvm/.svk/ - instead it is stored in central location. This means that if you ever want to move around a locally checked out copy you need to run:

> svk co --relocate ~/Research/jikesrvm ~/Research/jikesrvm2

And if you ever need to delete a locally checked out copy you delete the physical directory and then purge the record of its existence via:

> rm -rf ~/Research/jikesrvm2
> svk co --purge

Making Local Changes

You can modify the files in the checked out working copy and perform all the usual "svk commit", "svk diff" commands on the source code.

> cd ~/Research/jikesrvm
> vi NEWS
> svk diff NEWS
> svk commit -m "Added a news item" NEWS

Merging with Upstream Changes

When changes occur in the upstream Jikes RVM subversion repository you can update your local repository via the command:

> svk sync //jikesrvm/trunk

And you may want to move the changes across into your local branch via:

> svk smerge -I //jikesrvm/trunk //jikesrvm/local

And update your local branch via:

> cd ~/Research/jikesrvm
> svk up

Preparing Patches

Now that you have modified your local branch you want to create a patch so that it can be integrated back into the main Jikes RVM tree. The first thing to do is create a directory that will contain the patched versions.

> svk mkdir //jikesrvm/patchsets

Then you create a new branch for the patched version:

> svk cp //jikesrvm/trunk //jikesrvm/patchsets/news_add

And merge across the changes you are interested in:

> svk merge -l -c 1234 //jikesrvm/local //jikesrvm/patchsets/news_add

Note: the -l switch says to use the previous commit message as part of the new merge commit message.

You then check out the branch and verify your changes. By verifying your code against a clean tree you can make sure that you didn't miss any other changes in your local tree and that you didn't introduce any unintended changes. If you missed some changes you can add them directly to the branch or merge them across.

> svk co //jikesrvm/patchsets/news_add
> cd news_add
> ... RunSanityTests ...
> ... svk merge any missed changes ...
> ... emacs NEWS ...
> ... svk commit -m "Fix missed changes" ...

Finally you create a diff file and add it into the patch tracker.

> svk diff //jikesrvm/trunk //jikesrvm/patchsets/news_add > news_add_diff.txt

If the main source moved further forward and you need to update your local branch you can do it via the following command. Then just retest and recreate the diff file.

> svk smerge -I -l //jikesrvm/trunk //jikesrvm/patchsets/news_add

Applying Changes

If you are a Jikes committer and want to apply patch directly to the upstream source repository then you run:

> svk smerge //jikesrvm/patchsets/news_add //jikesrvm/trunk

Mirroring Local Branch

Sometimes you may want to mirror a local branch into a public Subversion repository. This may be so others can look at your changes, to provide a backup or to share changes between multiple SVK repositories.

> svk mkdir //mirror
> svk ls
<follow the prompts and have it mirror it onto //mirror/mymirror>
> svk sync //mirror/mymirror
> svk mkdir //mirror/mymirror/jikesrvm
> svk smerge --baseless -Il //jikesrvm/ //mirror/mymirror/jikesrvm

You can update the mirror at anytime via:

> svk smerge -I -l //jikesrvm/ //mirror/mymirror/jikesrvm

Use darcs

While a central SVN repository is excellent for collaboration on a common code base, sometimes you wish to try things before commiting to the SVN repository. If you plan on making a lot of changes spread accross numerous files, it can be handy to have a local version control system (VCS) in which to record your changes. Similarly to the SVK setup detailed above, you can opt to use darcsas your local version control system. Darcs is an open-source distributed VCS. This means that there is no centralized server on which the repository resides. Instead, each repository stands on its own, and changes made to one copy of the repository can be put into another copy. Basically, darcs is built around patches, that are invertible, commutable (if not there is a dependency) and mergable in any order. Because people are pretty familiar wirth SVN, a there is a page detailing the workflow comparison between darcs and SVN.

The directions given here are structured alike the SVK directions.

Setting up a Local Repository

Once you have downloaded and installed darcs onto your machine, you can create the initial repository:

> cd my_jikes_source_dir
> darcs init

Make sure you have only the source files in your my_jikes_source_dir directory, as we will be automatically adding all source files to the darcs repository. Darcs ignores all CVS and SVN related files, as well as a host of other so called boring files. The list of boring files is kept in the prefs/boring file in your darcs repository. Feel free to expand this list.

> darcs record --look-for-adds

If you give no other parameters, you get the following questions

> What is your email address? <snip>
> addfile ./GNUmakefile
> Shall I record this patch? (1/?) [ynWsfqadjkc], or ? for help: a
> What is the patch name? initial checkin
> Do you want to add a long comment? [yn] n

You will only be asked for your email address the first time you check someting into the repository. After the initial checkin, you end up with a _darcs directory that contains all the relevant information about your repository.

Making Local Changes

If you edit files locally, have tested your changes (i.e., Jikes RVM at least builds), you may want to record them in your repository. First check to see that you will record what you think has been changed.

> darcs whatsnew

If you added files in the Jikes RVM tree, you may wish to use the --look-for-adds argument to whatsnew. There are no special issues when dealing with binary files. If you are satisfied you can record the changes to all changes files (optionally using the --look-for-adds flag).

> darcs record

Or you can only record the changes made to one or more file, by explicitly adding them to the command line

> darcs record file1 file2 file3 ... fileN

You can confirm each change, or confirm them all at once, by typing a when asked to record 'this' patch. Notice that the smaller patches will be congregated into the larger patch that will get a name and (optionally) a comment in the repository. You can rollback patches, undoing them in the repository, the local copy (i.e., the working copy), or both. A list with patches you have recorded is available.

> darcs changes

Merging with Upstream Changes

If the Jikes RVM central SVN repository is changed, you use the regular SVN update to get the changes, and then you simply record the changes into the local darcs repository using

> darcs record -m "svn update at <date>" --look-for-adds

Preparing Patches and Applying Changes

If you wish to get a patch to the Jikes RVM team, you first update your local copy using SVN, store the changes into darcs, as described above, and basically create a SVN diff and submit the diff to the patch tracker.

If you have SVN write access to the central Jikes RVM SVN repository, you use the regular SVN command to check in your code.

Mirroring a Local Branch

Your darcs repository can be made available though HTTP or SSH. For the former, you place the _darcs directory on a public HTTP server, for the latter you need to give people SSH access to the machine your repository resides on. If you wish to take a copy of your repository along, you basically have two choices. Either you copy the full Jikes RVM source tree, inclusing your _darcs directory. This will allow you to keep track of the changes made in the central SVN repository while you are on the road. Or you only take your darcs repository along, relying on access to the machine on which the full Jikes RVM SVN checked out copy resides. For the latter you just 'get' your darcs repository. For the sake of clarity, we will call the machine you did all the above on the 'original_machine', and we will call the one where you want a copy on the 'road_machine'. On road_machine you

> darcs get original_machine:my_jikes_source_dir

If you make changes while on the road, you record them locally, on road_machine. If you wish to sync with original_machine you

> darcs put original_machine:my_jikes_source_dir

Suppose you have updated the working copy from the SVN repository on original_machine, and you wish these changes reflected on your road_machine, you first check the changes into darcs on the original_machine and then you

> darcs pull original_machine:my_jikes_source_dir

The darcs repositories with which you have synched are kept in _darcs/prefs/repos.

Use SVN::Mirror to Clone the SVN Repository

You can use SVN::Mirror to mirror the repository locally. You can install it via your distributions package manager or via Perl's CPAN (<code>perl -MCPAN -e shell</code>) installation tool. You will need the command line interface to this called svm.

First create a repository to hold your mirror that will be held at the location 'SVMREPOS':

> export SVMREPOS=~/Research/jikesrvm
> svnadmin create $SVMREPOS

then initialize and synchronize it to the latest repository:

> svm init mirror/mymirror/jikesrvm
> svm sync mirror/mymirror/jikesrvm

Synchronization will take a long time (Jikes RVM has a lot of history to import) and may need to be restarted if there is problems with the sourceforge servers. You can speed up the sync by flattening a series of changes into one larger change via:

> svm sync mirror/mymirror/jikesrvm $REVISION

where $REVISION is the current revision.

Rsync the SVN repository

The following commands will copy the Jikes RVM SVN repository to the current directory:

> export
> rsync -a rsync-svn-j::svn/jikesrvm/* .

Using GIT to manage a local version of the Jikes RVM repository

GIT is a distributed version control tool that allows you to set up your own clone repositories of the Jikes RVM SVN repository that people can collaboratively work in. Changes can be pushed back to the Jikes RVM SVN repository or pulled from the Jikes RVM SVN repository.

Set up SVN clone

Set up a repository to hold a clone of the main Jikes RVM SVN repository (NB. we only set to import the trunk as bringing in everything else would be too slow):

> mkdir jikesrvm-svn.git
> cd jikesrvm-svn.git
> git svn init -T

Bring in the Jikes RVM SVN (NB. you probably only want to pull in from a particular revision, if you don't specify -r and a version then the whole Jikes RVM history will be pulled across which will be very slow):

> git svn fetch -r 14100

Create a cloned local public repository to work off

Having a local clone of the SVN cloned repository will allow you to make branches that you can then push into the SVN clone which you can them commit back into the SVN repository:

> cd ..
> git clone --bare jikesrvm-svn.git jikesrvm.git

Checkout a local world to work in

> git clone jikesrvm.git myjikesrvm.git

Push a change back into your local public repository

First do a local commit. Git requires you to add what you want to commit and then commit, the -a option to commit can do these two actions together.

> cd myjikesrvm.git
> vi ...
> git commit -a

You then need to push this back to local public repository:

> git push

Push a change from the local public repository to the SVN repository clone

> cd ../jikesrvm.git
> git push <path to jikesrvm-svn.git> +master

The master is what is being pushed, the + forces the push.

Commit changes from the Jikes RVM SVN clone back to the Jikes RVM SVN repository

> cd ../jikesrvm-svn.git
> git svn dcommit

Pull changes into the Jikes RVM SVN clone from Jikes RVM SVN

> cd ../jikesrvm-svn.git
> git svn dcommit

Push changes from the Jikes RVM SVN clone to the local public Jikes RVM repository

> cd ../jikesrvm-svn.git
> git push ../jikesrvm.git +master

Bring local repository up-to-date with local public Jikes RVM repository

> cd ../myjikesrvm.git
> git pull

  • No labels