This page describes a method of installing and maintaining a DM software stack that allows you to easily keep up to date with the current master of packages and to push your own changes. It was updated 2015-11-04 to support git-lfs packages such as afwdata.
Initial Installation
- Set up a git credential manager, e.g. as per afwdata’s README.md.
- (alternately: edit the file lsstsw/etc/repos.yaml to change all instances of https://github.com/lsst, except afwdata,to git@github.com:lsst. This works fine if you don’t plan to push to afwdata, and doesn’t require using the credential manager.)
- Clone the lsstsw package into the location of your choice:
git clone git@github.com:lsst/lsstsw.git
- Install lsstsw and rebuild lsst_apps using these instructions. Note that this pulls over all of afwdata, which is a lot of data. If you already have a cloned copy you may be able to avoid this by making a symlink to it from
lsstsw/build/afwdata
. - Eups tag the current build as “current” using command:
eups tags --clone b
NNNcurrent
whereb
NNN is the eups tag that lsstsw used for the packages installed by therebuild
command.
Development Cycle
To work on one or more packages, start by making a fresh build (if you have not gotten one recently) using rebuild:
-
rebuild lsst_apps
If this complains that it cannot clone some packages then you will have to update repos.yaml; the simplest way to do this to specify the-u
flag in the rebuild command. -
eups tags --clone bNNN current
as described above
Next declare the git clones of the packages you will be working on to eups. The git clones are in $LSSTSW/build
and I suggest you declare them with version git
and a eups tag of your username (since that tag is permitted by eups without altering the eups configuration). For example, user rowen
could issue the command eups declare -r $LSSTSW/build/afw afw git -t rowen
.
Now edit your code and rebuild manually, using scons
as needed. Having eups-tagged your packages, you can set them up using: setup -r . -t
your_username.
Warning: the rebuild command will erase any changes you have not pushed. Do not run the rebuild
command while developing and testing your code unless you really need it. Before you run rebuild
carefully verify that you have pushed (not just committed) all your changes.
When you are done with your work:
- Clean your commit history using
git rebase -i $HEAD~
N where N is the number of commits. - Get your changes reviewed.
- Clean up your code as required by the review and clean up the commit history again.
- Merge your changes to master and push all changes.
- Remove your username tag from the packages. For example to remove your username tag from afw:
eups undeclare afw git -t
your_username. - Build a fresh copy of the stack using
rebuild lsst_apps
followed byeups tags --clone b
NNNcurrent
.
Caveats
- Be careful not to overwrite your work with a “rebuild” command. Always commit and push before rebuilding, or do your work on clones that are not in
lsstsw/build
. - Be sure to clone tags if you want your new build to be current, because otherwise the default “setup” command won’t act as you expect.
- Be careful when trying to run packages in the build directory (rather than installed versions) because “rebuild” only builds what it has to, so some of those directories may not have been built.
- You should usually specify “-u” with the rebuild command to update your repos.yaml file. Otherwise you risk the build failing with a complaint about missing packages.