[cctbxbb] How to hack at the autobuild?

markus.gerstel at diamond.ac.uk markus.gerstel at diamond.ac.uk
Fri Dec 15 00:31:18 PST 2017


this is what I do:
* create an empty working directory
* inside, create a file named 'up' with content

rm bootstrap.pyc -f
cp modules/cctbx_project/libtbx/auto_build/bootstrap.py .
python bootstrap.py "$*"

* create a directory in the working directory named 'modules'
* inside, git clone $path_to_your_development_copy_of_cctbx_modules

so you can run './up' instead of python bootstrap.py as you would normally.

To tinker with things, you can for example

cd modules/cctbx_project
vi libtbx/auto_build/bootstrap.py
(..do things..)
git add -u; git commit -m "did thing" # commit, but no push
cd ../..
./up --builder=dials

You only need to commit if you intend to run the update step. The 'update' step will then try to pull updates from your local development cctbx repository, and that shouldn't interfere too much.

To revert all changes do git reset --hard origin/master.
Once you are happy with your changes you can
* if necessary squash them into fewer or just a single commit using git rebase -i HEAD~5  (say if you want to edit the last 4 commits)
* export them with git format-patch -2 (to export the 2 last commits)
* go to your proper development cctbx repository
* git pull --rebase; git am -3k ${path_to_the_bootstrap_repository}/*.patch; git push

I find a git-aware command prompt to be exceedingly useful with all these things. So in case you don't have one and you are using bash on linux you may want to take a look at https://github.com/Anthchirp/scripts/blob/master/setup-bashrc.file#L2-L23 for inspiration.


From: cctbxbb-bounces at phenix-online.org [cctbxbb-bounces at phenix-online.org] on behalf of Aaron Brewster [asbrewster at lbl.gov]
Sent: Friday, December 15, 2017 00:53
To: cctbx mailing list
Subject: Re: [cctbxbb] How to hack at the autobuild?

Hi, you could fork the cctbx_project into your personal github account, then check out the forked repository locally.  Make the changes to support Fedora and push them back as commits to your forked repository.  Then, make a local edit to bootstrap.py to pull from your repository.  Something like this (lines 755-757):

# Core CCTBX repositories
# These must all provide anonymous access.
class cctbx_module(SourceModule):
  module = 'cctbx_project'
  anonymous = ['git',
               'git at github.com:cctbx-xfel/cctbx_project.git',

(as seen in this commit)

You can use that edited bootstrap to test your changes.

Does that make sense?  When you are done, you can push the changes back using a pull request from your forked repository.

-Aaron and Billy

On Thu, Dec 14, 2017 at 4:15 PM, Luc Bourhis <luc_j_bourhis at mac.com<mailto:luc_j_bourhis at mac.com>> wrote:

I have found a few issues with auto build on recent versions of Fedora. I need to edit files in libtbx/autobuild to fix them but then I want to test that running bootstrap works. But then bootstrap.py always pull from github. I don’t want to push my changes to github until it’s solid though. How do you guys approach that?

Best wishes,


cctbxbb mailing list
cctbxbb at phenix-online.org<mailto:cctbxbb at phenix-online.org>

This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail.
Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. 
Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message.
Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom

More information about the cctbxbb mailing list