[darcs-users] Installing from source as a newcomer

Ben Franksen ben.franksen at online.de
Mon Sep 13 11:10:07 UTC 2021


Am 11.09.21 um 17:47 schrieb Alexis Praga:
> I wanted to build darcs from source and I have a few remarks:
> 
> 1) The documentation says `cabal install darcs` but it's `cabal install
> exe:darcs` instead

It may be necessary to be more specific when you invoke `cabal install` 
from inside a project's source tree. Otherwise a `cabal install darcs` 
should work.

> 2) The default cabal files fail to compile with
>     cabal: filepath wildcard 'release/distributed-version' does not match
>     any files.
> I had to edit the "release-data" section :
> 
>     -- release data
> -  release/distributed-version
> -  release/distributed-context
> +  release/gen-version-info.hs
> 
> A patch with my changes have been submitted to patches at darcs.net.
> Of course, if I missed something, please tell me !

TL;DR: To `cabal install` from inside the darcs source tree you first 
need to manually execute a `runghc ./release/gen-version-info.hs`.

Long story: In order to generate the (detailed) version info we have to 
be inside the darcs repo; but `cabal install` from inside a source tree 
first creates a source dist tar ball and then unpacks, builds and 
installs that. If we added the gen-version-info.hs to the sdist then it 
would be invoked during the build but since it is not inside a darcs 
repo, the version info would be incomplete. In earlier cabal versions 
one could add hooks to the sdist command but that feature was removed 
(in cabal-2.4, IIRC) for reasons that are not perfectly clear to me. The 
recommended solution by the cabal developers is to create VCS-dependent 
data (or modules) before calling `cabal sdist` when preparing a release, 
which is what we did. But of course this does not work when doing `cabal 
install` from inside the source tree, unless you manually generate the 
version info first, whereas `cabal build` works just fine because it 
builds directly inside the source tree.

We should perhaps add a note in the README to make this clearer for new 
developers?

> 3) What's the difference betwen darcs.net and darcs.net/screened ?

It's the same repo.

Cheers
Ben
-- 
I would rather have questions that cannot be answered, than answers that
cannot be questioned.  -- Richard Feynman




More information about the darcs-users mailing list