[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Clojure versioning



On Tue Aug 24 18:07, Peter Collingbourne wrote:
> > I don't like either solution very much. Of the two, what I would prefer is:
> > 
> >  - version clojure itself
> >  - have clojure be a metapackage depending on the current version
> >  - things b-d on clojure and depend on clojureX.Y, with AOT compilation
> >  - when you upgrade clojure, add a new clojureX.Y, replace clojure metapackage
> >  but leave the old clojureX.Y. At this point everything in the archive still
> >  works, depending on the old clojureX.Y
> >  - slowly rebuild all the libraries to use the new clojure/clojureX.Y
> >  - when nothing depends on the old clojureX.Y, remove it from the archive
> > 
> > Helper tools can do the dependency calculation for you, so the rebuilds might
> > not even need source changes. It might also mean that during the transition you
> > need both versions of clojure installed (but this should only happen in
> > unstable/testing), but I think that's  better than building multiple versions
> > of each package. There are also issues of two libraries being used by the same
> > program, only one of which has been upgraded, which will have to be considered.
> 
> Actually, I am beginning to prefer this solution.  What do you
> think the helper tools should look like?  One idea is to have a
> .mk file in /usr/share/cdbs/1/class which defines a clojure.version
> environment variable in DEB_MAVEN_ARGS and declares a substvar, say
> clojure:Depends.  The individual package would then be responsible for
> replacing the clojure version number in pom.xml with ${clojure.version}
> (e.g. using maven.rules) and using either ${maven:Depends} or
> ${clojure:Depends} (for non-maven builds) in debian/control.  Or do
> you think there is a cleaner way to do this?

Well, your first problem is using CDBS (-;

More seriously, what I was thinking was:

build-depends: clojure
...
depends: ${clojure:Depends}

Then all the build scripts would refer to an unversionned clojure symlink, so
there's no need to put the clojure version number anywhere (if there is, then
I'll lower my opinion of your build system q-: )

Some trivial helper tool would literally do: 

(echo -n clojure:Depends=; dpkg -S $(readlink -f `which clojure`) | cut -d: -f1 ) >> debian/$package.substvars

so that you get the current clojure explicitly in your depends (actually, maybe
it'll version it or something, but you get the idea)

In fact, jh_depends could just stick that in the substvars whenever clojure is
installed and then let you use it if you want to.

Matt

Attachment: signature.asc
Description: Digital signature


Reply to: