[erlang-questions] A Trick for tracking the Erlang dev branch.
Jesper Louis Andersen
jesper.louis.andersen@REDACTED
Sat May 21 14:31:07 CEST 2011
I often need to track the Erlang dev branch for what I am doing.
Hence, I am fairly often rebuilding Erlang/OTP. Also, I am using
Ubuntu and the default installation has historically been riddled with
odd design decisions. Hence, I am building from source. Unfortunately,
this also means you may be the only one running that particular
release and that gives problems when reporting bugs. This is trick I
use to build Erlang/OTP.
1. Install stow,
sudo aptitude install stow
If you don't know what stow does, it maintains a symbolic link farm
for you in /usr/local so we can enable/disable Erlang versions at whim
and have multiple installed Erlangs. It also means cleaning up is easy
since each program in /usr/local is installed in its own dir.
2. Execute
sudo aptitude build-dep erlang
to pull in all build dependencies we need. Since we are on Ubuntu and
Ubuntu *does* have an Erlang we can exploit it knows about the
dependencies we need.
3. Execute
git clone git://github.com/erlang/otp.git
to pull the source off of git.
4. Get into the directory and fire away
git checkout dev && ./otp_build autoconf
which sets up the environment and runs autoconf.
5. Get a useful tag for the otp version you have built
otp_version=$(git describe)
This is the trick! `git describe` will output to us a useful tag. In
my case it is OTP_R14B02-625-g5f7fa62 which means we are 625 commits
*after* the R14B02 tag and the SHA1 of that commit start with
g5f7fa62. In other words, I now have a neat hook I can report back to
the Erlang Devs if there are any problems and we will know exactly on
which commit I am and exactly what fixes I may not have present in my
build. In some of my projects I have a -tainted I add to the `git
describe` if I have local changes not present upstream and then I
embed this in the version string of my software. Hence, if some
downstream (Ubuntu packagers, etc) choose to patch the software I know
it has some patches on it I need to investigate the contents of.
6. ./configure --prefix=/usr/local/stow/${otp_version}
Throw the build into the stow directory.
7. make; make docs install install-docs
8 And then I enable it in stow:
cd /usr/local/stow && stow ${otp_version}
You may have to use stow -D on an old version first to remove the
symbolic link farm of that one.
--
J.
More information about the erlang-questions
mailing list