diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2022-05-24 10:59:57 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-05-30 13:44:50 -0400 |
commit | cac8c7bb098002ddce0ef7c1e4429940d22d8cc2 (patch) | |
tree | 547f1dba2414774d0c2fd6d2c5e5e838d22e00ad /hadrian/src/Builder.hs | |
parent | 6656f0165a30fc2a22208532ba384fc8e2f11b46 (diff) | |
download | haskell-cac8c7bb098002ddce0ef7c1e4429940d22d8cc2.tar.gz |
hadrian: Fix building from source-dist without alex/happy
This fixes two bugs which were adding dependencies on alex/happy when
building from a source dist.
* When we try to pass `--with-alex` and `--with-happy` to cabal when
configuring but the builders are not set. This is fixed by making them
optional.
* When we configure, cabal requires alex/happy because of the
build-tool-depends fields. These are now made optional with a cabal
flag (build-tool-depends) for compiler/hpc-bin/genprimopcode.
Fixes #21627
Diffstat (limited to 'hadrian/src/Builder.hs')
-rw-r--r-- | hadrian/src/Builder.hs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/hadrian/src/Builder.hs b/hadrian/src/Builder.hs index 160eb44f7a..b80ac59f8d 100644 --- a/hadrian/src/Builder.hs +++ b/hadrian/src/Builder.hs @@ -390,6 +390,10 @@ instance H.Builder Builder where isOptional :: Builder -> Bool isOptional = \case Objdump -> True + -- alex and happy are not required when building source distributions + -- and ./configure will complain if they are not available when building in-tree + Happy -> True + Alex -> True _ -> False -- | Determine the location of a system 'Builder'. |