Add a 'build from sdist tarball' feature (aka distcheck) #267

Open
bos opened this Issue May 24, 2012 · 4 comments

Projects

None yet

2 participants

@bos
Contributor
bos commented May 24, 2012

(Imported from Trac #274, reported by guest on 2008-05-07)

I've often seen Darcs repos where the sdist tarball was incomplete, or where a person had a tarball which was incomplete.

I think this is because most people just never use the tarball; if they do ever use it, it's because it's what was downloaded from Hackage. The reason is that doing so is much more complex than 'configure; build; install': you need to configure, create an sdist tarball, cd into dist/; do a tar -xvf or whatever of the correct tarball; cd into that - and then you can configure/build/install. Assuming it is a working tarball.

Now, of course you can automate it. After the first dozen times, I wrote myself a shellscript to do all that for me:

function build_sdist { clean_configure && sdist &&

cd dist/ && untar *.tar.gz && cd ls -t ./ | grep "/" | head -n 1 && clean_configure && build && hinstall; haddock && hinstall; }

(This is pretty long and imperfect, but it would be even longer if all the other aliases and function definitions were included; I think they're pretty straightforwardly named though, so I haven't included them.)

It seems to me that this would be, at the very least, a useful adjunct to cabal check - if it makes sense to see whether various fields are filled out sanely, surely it makes sense to see whether needed files are included/listed?

It might be even better to make the normal 'runhaskell Setup build' do it from sdist, but this is harder to code (besides the forgoing, you'd need to copy in the configuration from the top-level, from when the user ran 'runhaskell Setup configure' and added whatever options) and possibly more confusing ("But Foo.hs is there, right there in src/! Why can't Cabal find it?"). So I'd be satisfied to do something like 'cabal checkdist'.

gwern

@bos
Contributor
bos commented May 24, 2012

(Imported comment by @dcoutts on 2008-05-07)

See also make distcheck from autoconf/automake
http://www.gnu.org/software/libtool/manual/automake/Dist.html

@bos
Contributor
bos commented May 24, 2012

(Imported comment by @saizan on 2008-05-07)

so the UI would be a new command named distcheck?
so that "cabal distcheck":

  1. runs "cabal sdist"
  2. untars the package in a fresh directory
  3. runs "cabal install" in it

and it should support most of the options of cabal sdist + cabal install(without a package argument)?

@bos
Contributor
bos commented May 24, 2012

(Imported comment by @dcoutts on 2009-06-07)

Replying to @saizan:

so the UI would be a new command named distcheck?

I was thinking some variant of the existing check command, eg cabal check --full or something.

so that "cabal distcheck": 1) runs "cabal sdist" 2) untars the package in a fresh directory 3) runs "cabal install" in it

Yes. See also what automake does.

and it should support most of the options of cabal sdist + cabal install(without a package argument)?

Hmm. I'd hope we can do with defaults, or perhaps a general configure/install option escape flag.

@timthelion

#939 sort of a dup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment