GithubHelp home page GithubHelp logo

mpickering / ghc.nix Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alpmestan/ghc.nix

0.0 3.0 0.0 71 KB

Nix expression for working on GHC (WIP)

License: BSD 3-Clause "New" or "Revised" License

Nix 80.56% Shell 19.44%

ghc.nix's Introduction

Simple usage

Quickstart

To enter an environment without cloning this repository you can run:

nix-shell https://github.com/alpmestan/ghc.nix/archive/master.tar.gz

Building GHC

These commands assume you have cloned this repository to ~/ghc.nix. default.nix has many parameters, all of them optional. You should take a look at default.nix for more details.

$ sed -e '/BuildFlavour = quickest/ s/^#//' mk/build.mk.sample > mk/build.mk
$ nix-shell ~/ghc.nix/ --run './boot && ./configure && make -j4'
# works with --pure too

You can alternatively use Hadrian to build GHC:

$ nix-shell ~/ghc.nix/
# from the nix shell:
$ ./boot && ./configure
# example hadrian command: use 4 cores, build a 'quickest' flavoured GHC
# and place all the build artifacts under ./_mybuild/.
$ hadrian/build.sh -j4 --flavour=quickest --build-root=_mybuild
# you could also ask hadrian to boot and configure for you, with -c

# if you have never used cabal-install on your machine, you will likely
# need to run the following before the hadrian command:
$ cabal update

Using ghcide

You can also use ghc.nix to provide the right version of ghcide if you want to use ghcide whilst developing on GHC. In order to do so, pass the withIde argument to your nix-shell invocation.

nix-shell ~/.ghc.nix --arg withIde true

Running ./validate

$ nix-shell ~/ghc.nix/ --pure --run 'THREADS=4 ./validate'

See other flags of validate by invoking ./validate --help or just by reading its source code. Note that ./validate --slow builds the compiler in debug mode which has the side-effect of disabling performance tests.

Building and running for i686-linux from x86_64-linux

It's trivial!

$ nix-shell ~/ghc.nix/ --arg nixpkgs '(import <nixpkgs> {}).pkgsi686Linux'

TODO

  • We currently can't just invoke nix-build (#1)
  • We do not support all the cross compilation machinery that head.nix from nixpkgs supports.
  • Some tests actually break with GHCs built with the first command above.

ghc.nix's People

Contributors

alpmestan avatar deepfire avatar bgamari avatar mpickering avatar qrilka avatar int-index avatar ericson2314 avatar sgraf812 avatar supersven avatar vaibhavsagar avatar

Watchers

James Cloos avatar  avatar  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.