#257 closed defect (fixed)

can't build without darcs installed

Reported by: zooko Owned by: warner
Priority: major Milestone: 0.7.0
Component: packaging Version: 0.7.0
Keywords: Cc:
Launchpad Bug:

Description

Seb discovered that "make" fails if there is no darcs:

make make-version
python ./setup.py darcsver
darcsver is <module 'darcsver' from '/Users/wonwinmcbrootles/playground/allmydata/tahoe/trunk/darcsver-1.0.0-py2.5.egg/darcsver/__init__.pyc'>
running darcsver
error: No such file or directory
make[1]: *** [make-version] Error 1
make: *** [build] Error 2

We could make "make-version" pass in the case that darcs isn't present, but this spurred me to realize that we could also do something else: put the following into setup.py:

if 'darcsver' in not sys.argv: # to avoid recursion in case of weird sys.argv
    for arg in sys.argv:
        for start in ['bdist', 'build', 'sdist', 'install', 'develop']:
            if cmdname.startswith(start):
                (cin, cout, cerr,)= os.popen3("setup.py darcsver")
                print cout.read()

This would be similar to what we already did in setup.py back when "darcsver" was a separate script instead of a setuptools plugin, but it would be better, in that it would execute "darcsver" only in the case that the setup.py command being executed is one of those which wants a fresh version number.

Anyway, I guess that isn't directly related to this failure to build. The first thing to do is probably just configure the Makefile so that "make-version" failing doesn't cause builds to fail, if Brian agrees.

Change History (3)

comment:1 Changed at 2008-01-04T23:12:53Z by warner

  • Status changed from new to assigned

oh, I should change the Makefile to have build: depend upon src/allmydata/_version.py, and have src/allmydata/_version.py constructed with a rule that runs make-version. That ought to ensure that we run darcsver if there isn't already a _version.py (which should only ever be the case if we're building from a darcs checkout), and that we won't try to run it if there already is a _version.py (which should be the case if we're building from a tarball, and therefore don't require darcs to be available).

I'll give this a try.

comment:2 Changed at 2008-01-05T05:14:48Z by warner

I think that ought to have fixed it.. could you give it a try now?

comment:3 Changed at 2008-01-05T20:58:42Z by zooko

  • Resolution set to fixed
  • Status changed from assigned to closed

I tested it, and that fixes the build-without-darcs-but-with-_version.py scenario.

It is still the case that you have to run "make make-version" manually in order to refresh the version number. Moving my other idea into a separate ticket: #260 -- "automatic freshening of version number".

Note: See TracTickets for help on using tickets.