Skip to content

Hackathon 2016

Mikhail Glushenkov edited this page Oct 7, 2016 · 21 revisions

This is a page to collect ideas for Cabal/Hackage hacking tasks/mini-projects for the Haskell eXchange Hackathon 2016. It is an updated version of a similar page for the 2015 infrastructure hackathon.

Please use the #hackage IRC channel on freenode for online discussions.

Feel free to expand individual bullet points into full (linked) pages or tickets/issues.

Strategically important projects

Mostly Cabal Hell and related.


  • Package collections in cabal-install and hackage-server

    The idea here is to support package collections directly in our infrastructure. Currently package collections like Stackage are implemented indirectly by specially crafted cabal.config/cabal.project.freeze files. Collections are also to be distributed via hackage, allowing anyone to define and distribute collections.

    A specification was posted to the libraries list recently. There is also some prototype code available for cabal-install. The cabal-install code adds solver support and allows for set-like operations on collections. Nothing has been started yet for hackage-server.

    This is an important feature since package collections are one of the two big solutions to cabal hell. This is not a huge project. There's probably enough for two people to work on the client side and two on the server side.


  • Improve cabal new-build TODO: Update this section

    This is the other major plank in the solution to cabal hell. This is not a neat self-contained project. There are lots of parts to this project and it will require people to work together.

    This is an ongoing rewrite of the cabal-install build/install/sandbox functionality. The goals are:

    • replace sandboxes, make all builds local by default
    • full sharing of built packages, so new projects don't require rebuilding everything
    • steal mechanisms from nix: nix style hashed package ids and store
    • a UI focused on working with several packages at once, not just individual packages
    • incremental rebuilds of packages within projects (cabal sandbox does this but not well)
    • a stateless UI, e.g. solver choices don't depend on what you built previously
    • a UI that does the necessary prerequisite steps, e.g. cabal build will always configure and build dependencies if necessary
    • react automatically to changes in .cabal and config files, e.g. cabal build just does the right thing

    There is existing code that's good enough to dog-food, i.e. it can build Cabal + cabal-install and their dependencies. There is lots to do:

    • The existing code needs to be extended and made more mature so that it can replace the existing code paths.
    • Building on top of the new cabal build code to support cabal {repl,test,run,haddock} etc.
    • New cabal project file system
    • Implementing new UI semantics for cabal install
    • Adjusting cabal configure for a stateless UI style.
    • Merging code into the main branch.

More modest projects

  • Cabal documentation.

    Cabal's user guide got quite a bit better recently, but there's still a lot of room for improvement. In particular, we want to put more emphasis on the cabal-install tool at the expense of the Setup.hs interface and add a tutorial section. Ideally, the user guide would look like approximately this:

    1. Intro
    2. Tutorial, p.1 - how to use cabal-install to build and install existing packages
    3. Tutorial, p.2 - how to develop programs using cabal-install and write .cabal files -- basically, an updated version of https://wiki.haskell.org/How_to_write_a_Haskell_program.
    4. .cabal format reference
    5. cabal-install command reference
    6. cabal new-build chapter
    7. Appendix: Cabal spec (i.e., the Setup.hs interface)

    Anyone considering this should feel empowered to make decisions. You could decide to start from scratch with a new structure and just pinch material from the existing docs. You might want to fully split into tutorial and reference.


  • A new website for cabal-install/Cabal.

    Our website hasn't been updated in ages, so a facelift is long due. It doesn't have to be super-advanced, a simple Hakyll-based static page with a blog/news feed would suffice. Start by looking at the https://github.com/haskell/cabal-website repo.


  • Improvements in the release process.

TODO

  • An updated Cabal spec.

TODO

  • Include-able Common Stanzas #2832

    Allow to reduce duplication by moving common definitions to include-able common stanzas which can then be included from other stanzas.


  • Rewrite of the .cabal file parser and AST. #2865

    The following text is directly copied from the 2015 page. @phadej (Oleg Grenrus) is the person to talk to about this issue.

    The existing parser has no formal grammar, has terrible error messages and is sometimes very slow and memory hungry. In large part this is because ReadP is a terrible parser. Now that the ghc library no longer depends on the Cabal library, Cabal is now allowed to depend on parsec.

    The Cabal parser is two-stage, outline then individual fields. This approach will remain. There is a prototype new parser (with a grammar!) using parsec for the outline phase which has had some significant testing (the new grammar only rejects a very small number of old quirky .cabal files). This new parser needs to be integrated and tested further. Additionally the infrastructure for parsing the individual fields needs to be rewritten to use parsec. There is also experimental code for a new more flexible AST for cabal files.

    Further future goals would be to preserve more information in the parser so that editing and re-saving .cabal files becomes possible, preserving layout and comments.



  • Improve the DWARF debugging experience

Try enabling DWARF debugging in a new-build project, document your experience, suggest (and if possible, implement!) improvements. Ideally, something like cabal new-build --enable-debugging should do the trick.

Useful links