Commit 369a8c2e authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel 🕺
Browse files

Disable per-components mode for cabal-spec version < 1.8

cabal-version semantics prior to 1.8 joined all `build-depends`;
as suggested by @ezyang it's easier for now to just fallback to
legacy mode, than to add proper support for per-components builds
for ancient cabal-spec versions

Fixes #4121
parent bc592078
......@@ -872,7 +872,7 @@ buildAndInstallUnpackedPackage verbosity
let dispname = case elabPkgOrComp pkg of
ElabPackage _ -> display pkgid
++ " (all, due to Custom setup)"
++ " (all, legacy fallback)"
ElabComponent comp -> display pkgid
++ " (" ++ maybe "custom" display (compComponentName comp) ++ ")"
......
......@@ -1142,6 +1142,11 @@ elaborateInstallPlan verbosity platform compiler compilerprogdb pkgConfigDB
-- type, and teach all of the code paths how to handle it.
-- Once you've implemented this, swap it for the code below.
= fromMaybe PD.Custom (PD.buildType (elabPkgDescription elab0)) /= PD.Custom
-- cabal-format versions prior to 1.8 have different build-depends semantics
-- for now it's easier to just fallback to legacy-mode when specVersion < 1.8
-- see, https://github.com/haskell/cabal/issues/4121
&& PD.specVersion pd >= mkVersion [1,8]
{-
-- Only non-Custom or sufficiently recent Custom
-- scripts can be build per-component.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment