-
This adds a command line option to build a "relocatable" bindist. The bindist is created by first creating a normal bindist and then installing it using the `RelocatableBuild=YES` option. This creates a bindist without any wrapper scripts pointing to the libdir. The motivation for this feature is that we want to ship relocatable bindists on windows and this method is more uniform than the ad-hoc method which lead to bugs such as #23608 and #23476 The relocatable bindist can be built with the "reloc-binary-dist" target and supports the same suffixes as the normal "binary-dist" command to specify the compression style.
This adds a command line option to build a "relocatable" bindist. The bindist is created by first creating a normal bindist and then installing it using the `RelocatableBuild=YES` option. This creates a bindist without any wrapper scripts pointing to the libdir. The motivation for this feature is that we want to ship relocatable bindists on windows and this method is more uniform than the ad-hoc method which lead to bugs such as #23608 and #23476 The relocatable bindist can be built with the "reloc-binary-dist" target and supports the same suffixes as the normal "binary-dist" command to specify the compression style.
Hadrian
Hadrian is the build system for the Glasgow Haskell Compiler. It is based on the Shake library. If you are curious about the rationale behind the project and the architecture of the build system you can find more details in this Haskell Symposium 2016 paper and this Haskell eXchange 2016 talk.
Your first build
Put on the helmet and run the following commands from the root of the GHC tree:
./boot && ./configure
hadrian/build -j
or on Windows:
./boot && ./configure --enable-tarballs-autodownload
hadrian/build.bat -j
Here flag -j
enables parallelism and is optional. We will further refer to the
build script simply as build
.
-
On Windows, if you do not want to install MSYS, you can use the Stack-based build script (Stack provides a managed MSYS environment), as described in these instructions. If you don't mind installing MSYS yourself or already have it, you can use the Cabal-based build script.
-
Hadrian is written in Haskell and depends on
shake
(plus a few packages thatshake
depends on),mtl
,quickcheck
, and GHC core libraries. -
If you have never built GHC before, start with the preparation guide.
-
By default Hadrian will fetch dependencies from the internet. If this is a problem for your build system then see the bootstrap directory for instructions about how to build hadrian without an internet connection.
Using the build system
Once your first build is successful, simply run build
to rebuild after some
changes. Build results are placed into _build
by default.
Choosing a build flavour
There are many different ways to build a compiler, each way is called a flavour.
-
--flavour=FLAVOUR
: choose a build flavour. The following settings are currently supported:default
,quick
,quickest
,perf
,prof
,devel1
anddevel2
. As an example, thequickest
flavour adds-O0
flag to all GHC invocations and builds libraries only in thevanilla
way, which speeds up builds by 3-4x.
In addition to the overall build flavour there are also "flavour transformers" which can slightly modify the build settings for a flavour. Some common flavour transformers are:
-
no_profiled_libs
: Don't build profiled libraries -
lint
: Build with core lint enabled. - etc
A flavour transformer is appended to a normal flavour name using +
--flavour=default+lint
Build flavours and flavour transformers are documented here.