How to hack at the autobuild?
Hi, 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, Luc
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',
'[email protected]:cctbx-xfel/cctbx_project.git',
'https://github.com/cctbx-xfel/cctbx_project.git',
'
https://github.com/cctbx-xfel/cctbx_project/archive/master.zip']
(as seen in this commit)
https://github.com/cctbx-xfel/cctbx_project/commit/df22c2f4fa60f484e0ec3f115...
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
Hi,
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,
Luc
_______________________________________________ cctbxbb mailing list [email protected] http://phenix-online.org/mailman/listinfo/cctbxbb
Hi,
this is what I do:
* create an empty working directory
* inside, create a file named 'up' with content
#!/bin/bash
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.
-Markus
________________________________
From: [email protected] [[email protected]] on behalf of Aaron Brewster [[email protected]]
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',
'[email protected]:cctbx-xfel/cctbx_project.git',
'https://github.com/cctbx-xfel/cctbx_project.git',
'https://github.com/cctbx-xfel/cctbx_project/archive/master.zip']
(as seen in this commit)
https://github.com/cctbx-xfel/cctbx_project/commit/df22c2f4fa60f484e0ec3f115...
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
participants (3)
-
Aaron Brewster
-
Luc Bourhis
-
markus.gerstel@diamond.ac.uk