Ticket #274 (new enhancement)

Opened 5 years ago

Last modified 15 months ago

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

Reported by: guest Owned by:
Priority: normal Milestone: cabal-install-0.16
Component: cabal-install tool Version: 1.2.3.0
Severity: normal Keywords:
Cc: gwern0@…, niklas.broberg@… Difficulty: normal
GHC Version: 6.8.2 Platform:

Description

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

Change History

  Changed 5 years ago by duncan

  • priority changed from low to normal
  • component changed from Cabal library to cabal-install tool
  • summary changed from Add a 'build from sdist tarball' feature to Add a 'build from sdist tarball' feature (aka distcheck)

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

  Changed 5 years ago by guest

  • cc gwern0@… added

  Changed 4 years ago by duncan

  • milestone set to cabal-install-0.8

follow-up: ↓ 5   Changed 4 years ago by Saizan

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)?

in reply to: ↑ 4   Changed 4 years ago by duncan

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.

  Changed 4 years ago by NiklasBroberg

  • cc niklas.broberg@… added

  Changed 15 months ago by kosmikus

  • milestone changed from cabal-install-0.8 to cabal-install-0.16
Note: See TracTickets for help on using tickets.