GithubHelp home page GithubHelp logo

shaking-up-ghc's Introduction

Shaking up GHC

Linux & OS X status Windows status

This is a new build system for the Glasgow Haskell Compiler. It is based on Shake and we hope that it will eventually replace the current make-based build system. If you are curious about the rationale and initial ideas behind the project you can find more details on the wiki page and in this blog post.

The new build system can work side-by-side with the existing build system. Note, there is some interaction between them: they put (some) build results in the same directories, e.g. inplace/bin/ghc-stage1.

Join us on #shaking-up-ghc on Freenode.

Your first build

Beware, the build system is in the alpha development phase. Things are shaky and often break; there are numerous known issues. Not afraid? Then put on the helmet and follow these steps:

  • If you have never built GHC before, start with the preparation guide.

  • This build system is written in Haskell (obviously) and depends on the following Haskell packages, which need to be installed: ansi-terminal, mtl, shake, QuickCheck.

  • Get the sources. It is important for the build system to be in the shake-build directory of the GHC source tree:

    git clone --recursive git://git.haskell.org/ghc.git
    cd ghc
    git clone git://github.com/snowleopard/shaking-up-ghc shake-build
  • Start your first build (you might want to enable parallelism with -j):

    shake-build/build.sh --configure

On Windows, use build.bat instead and pass an extra flag to configure (also see building on Windows): bash shake-build/build.bat --configure=--enable-tarballs-autodownload If you are interested in building in a Cabal sandbox or using Stack, have a look at shake-build/build.cabal.sh and shake-build/build.stack.sh scripts.

Using the build system

Once your first build is successful, simply run shake-build/build.sh or shake-build/build.bat to rebuild (you no longer need to use the --configure flag). Most build artefacts are placed into .build and inplace directories (#113).

Command line flags

In addition to standard Shake flags (try --help), the build system currently supports several others:

  • --configure[=ARGS]: run the configure script forwarding ARGS as command line arguments; also run the boot script to create the configure script if necessary. You do not have to use this functionality of the new build system; feel free to run boot and configure scripts manually, as you do when using make.
  • --flavour=FLAVOUR: choose a build flavour. Two settings are currently supported: default and quick (adds -O0 flag to all GHC invocations speeding up builds by 3x).
  • --progress-info=STYLE: choose how build progress info is printed. There are four settings: none, brief (one line per build command), normal (typically a box per build command; this is the default setting), and unicorn (when normal just won't do).
  • --split-objects: generate split objects, which are switched off by default. Due to a GHC bug, you need a full clean rebuild when using this flag.

User settings

The make-based build system uses mk/build.mk to specify user build settings. We use src/Settings/User.hs for the same purpose. Feel free to experiment following the Haddock comments.

Clean and full rebuild

  • shake-build/build.sh clean removes all build artefacts. Note, we are working towards a complete separation of GHC sources and build artefacts: #113.

  • shake-build/build.sh -B forces Shake to rerun all rules, even if results of the previous build are still in the GHC tree.

Testing

  • shake-build/build.sh test runs GHC tests. The current implementation is very limited and cannot replace the validate script (see #187).

  • shake-build/build.sh selftest runs tests of the build system. Current test coverage is close to zero (see #197).

Current limitations

The new build system still lacks many important features:

  • We only build vanilla way: #4, #186.
  • Documentation is broken: #98.
  • Validation is not implemented: #187.
  • Build flavours and conventional command line flags are not implemented: #188.
  • Cross-compilation is not implemented: #177.

Check out milestones to see when we hope to resolve the above limitations.

How to contribute

The best way to contribute is to try the new build system, report the issues you found, and attempt to fix them. Please note the codebase is very unstable at present and we expect a lot of further refactoring. The documentation is currently non-existent, but we are working on it: #55, #56.

Acknowledgements

I started this project as part of my 6-month research visit to Microsoft Research Cambridge, which was funded by Newcastle University, EPSRC, and Microsoft Research. I would like to thank Simon Peyton Jones, Neil Mitchell and Simon Marlow for kick-starting the project and for their guidance. Last but not least, big thanks to the project contributors, who helped me endure and enjoy the project.

shaking-up-ghc's People

Contributors

angerman avatar bgamari avatar hvr avatar joehillen avatar kgardas avatar ndmitchell avatar quchen avatar snowleopard avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.