<commit_before>Shaking up GHC
==============

[![Build Status](https://travis-ci.org/snowleopard/shaking-up-ghc.svg)](https://travis-ci.org/snowleopard/shaking-up-ghc)

As part of my 6-month research secondment to Microsoft Research in Cambridge
I am taking up the challenge of migrating the current [GHC][ghc] build system
based on standard `make` into a new and (hopefully) better one based on
[Shake][shake]. If you are curious about the project you can find more details
on the [wiki page][ghc-shake-wiki] and in this [blog post][shake-blog-post].

This is supposed to go into the `shake-build` directory of the GHC source tree.

[Join us on #shaking-up-ghc on Freenode](irc://chat.freenode.net/#shaking-up-ghc)

Trying it
---------

Please see the [Preparation][ghc-preparation] on the haskell wiki
for general preparation. The preparation steps for the `shake` build system are
identical to those for the `make` build system. This means that you don't need
to adjust anything if you are already familiar with building ghc using the `make`
build system.

### Linux / Mac OS X

```bash
git clone git://git.haskell.org/ghc
cd ghc
git submodule update --init
git clone git://github.com/snowleopard/shaking-up-ghc shake-build
./boot
./configure
# or if you want to use clang (e.g. building on OS X)
./configure --with-gcc=$(which clang) # See #26

```

Now you have a couple of options:

- `./shake-build/build.sh` to run the script directly. You'll need to have
  `shake` installed globally.
- `./shake-build/build.cabal.sh` to install the build system in a Cabal sandbox
  and then run it.



### Windows

```bash
git clone --recursive git://git.haskell.org/ghc.git
cd ghc
git clone git://github.com/snowleopard/shaking-up-ghc shake-build
./boot
./configure --enable-tarballs-autodownload
shake-build/build.bat
```
Also see the [Building GHC on Windows guide][ghc-windows-building-guide].

### Resetting the build

To reset the new build system run the build script with `-B` flag. This will force Shake to rerun all rules, even if the results of the previous build are still in the GHC tree. This is a temporary solution; we are working on a proper reset functionality (see [#32](https://github.com/snowleopard/shaking-up-ghc/issues/32)).


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. Before attempting to
fix any issue do make sure no one else is already working on it. The
documentation is currently non-existent, but we will start addressing this
once the codebase stabilises.


[ghc-shake-wiki]: https://ghc.haskell.org/trac/ghc/wiki/Building/Shake
[ghc-preparation]: https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation<commit_msg>Minor revision<commit_after>Shaking up GHC
==============

[![Build Status](https://travis-ci.org/snowleopard/shaking-up-ghc.svg)](https://travis-ci.org/snowleopard/shaking-up-ghc)

As part of my 6-month research secondment to Microsoft Research in Cambridge
I am taking up the challenge of migrating the current [GHC][ghc] build system
based on standard `make` into a new and (hopefully) better one based on
[Shake][shake]. If you are curious about the project you can find more details
on the [wiki page][ghc-shake-wiki] and in this [blog post][shake-blog-post].

This is supposed to go into the `shake-build` directory of the GHC source tree.

[Join us on #shaking-up-ghc on Freenode](irc://chat.freenode.net/#shaking-up-ghc)

Trying it
---------

Please see the [Preparation][ghc-preparation] on the haskell wiki
for general preparation. The preparation steps for the `shake` build system are
identical to those for the `make` build system. This means that you don't need
to adjust anything if you are already familiar with building ghc using the `make`
build system.

### Linux / Mac OS X

```bash
git clone git://git.haskell.org/ghc
cd ghc
git submodule update --init
git clone git://github.com/snowleopard/shaking-up-ghc shake-build
./boot
./configure
# or if you want to use clang (e.g. building on OS X)
./configure --with-gcc=$(which clang) # See #26

```

Now you have a couple of options:

- `./shake-build/build.sh` to run the script directly. You'll need to have
  `shake` installed globally.
- `./shake-build/build.cabal.sh` to install the build system in a Cabal sandbox
  and then run it.



### Windows

```bash
git clone --recursive git://git.haskell.org/ghc.git
cd ghc
git clone git://github.com/snowleopard/shaking-up-ghc shake-build
./boot
./configure --enable-tarballs-autodownload
shake-build/build.bat
```
Also see the [Building GHC on Windows guide][ghc-windows-building-guide].

### Resetting the build

To reset the new build system run the build script with `-B` flag. This forces Shake to rerun all rules, even if results of the previous build are still in the GHC tree. This is a temporary solution; we are working on a proper reset functionality (see [#32](https://github.com/snowleopard/shaking-up-ghc/issues/32)).


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. Before attempting to
fix any issue do make sure no one else is already working on it. The
documentation is currently non-existent, but we will start addressing this
once the codebase stabilises.


[ghc-shake-wiki]: https://ghc.haskell.org/trac/ghc/wiki/Building/Shake
[ghc-preparation]: https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation
{'fraction_non_alphanumeric': 0.11070110701107011, 'fraction_numerical': 0.0024600246002460025, 'mean_word_length': 3.9153713298791017, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5658609', 'n_tokens_mistral': 1809, 'n_tokens_neox': 1714, 'n_words': 724}