mietek / haskell-on-heroku

Buildpack for deploying Haskell apps
BSD 3-Clause "New" or "Revised" License
131 stars 16 forks source link

Support automatically determining build tools #34

Closed mietek closed 9 years ago

mietek commented 10 years ago

Add support for automatically determining what are the build-tools and extra-libraries needed to install any Cabal package.

Currently, the required build-tools are expected to be declared manually in .halcyon/sandbox-extra-apps.

Most of the work towards automation is already done, but is too slow to use on every push:

$ time (
>     lib_constraints=$( cabal_list_planned_lib_constraints /tmp/haskell-on-heroku-examples/hello-yesod-platform ) &&
>     echo "${lib_constraints}" | cabal_get_all_package_files 1 /tmp/lib_package_files &&
>     echo "${lib_constraints}" | cabal_dump_all_package_build_tools /tmp/lib_package_files | sed 's/^/build-tools: /' &&
>     echo "${lib_constraints}" | cabal_dump_all_package_extra_libs /tmp/lib_package_files | sed 's/^/extra-libs: /'
> )
build-tools: hsc2hs
build-tools: alex
build-tools: happy
extra-libs: z

real  0m11.015s
user  0m15.550s
sys   0m2.530s

This could be sped up by cabal get being able to output just the package description. (https://github.com/haskell/cabal/issues/1954 and haskell/cabalPR#1977).

mietek commented 9 years ago

Moved to https://github.com/mietek/halcyon/issues/9.