Commit 542789ea authored by Edward Z. Yang's avatar Edward Z. Yang Committed by Edward Z. Yang
Browse files

Report error if mixin refers to non-existent/visible package.


Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
parent 56688d70
......@@ -92,9 +92,14 @@ mkConfiguredComponent this_pid this_cid lib_deps exe_deps component =
-- Resolve each @backpack-include@ into the actual dependency
-- from @lib_deps@.
explicit_includes
= [ (cid, pid { pkgName = name }, rns)
| Mixin name rns <- mixins bi
, Just (cid, pid) <- [Map.lookup name deps_map] ]
= [ let (cid, pid) =
case Map.lookup name deps_map of
Nothing ->
error $ "Mix-in refers to non-existent package " ++ display name ++
" (did you forget to add the package to build-depends?)"
Just r -> r
in (cid, pid { pkgName = name }, rns)
| Mixin name rns <- mixins bi ]
-- Any @build-depends@ which is not explicitly mentioned in
-- @backpack-include@ is converted into an "implicit" include.
......
name: Fail2
version: 0.1.0.0
license: BSD3
author: Edward Z. Yang
maintainer: ezyang@cs.stanford.edu
build-type: Simple
cabal-version: >=1.25
library
mixins: non-existent
default-language: Haskell2010
import Test.Cabal.Prelude
main = setupAndCabalTest $ do
skipUnless =<< ghcVersionIs (>= mkVersion [8,1])
r <- fails $ setup' "configure" []
assertOutputContains "non-existent" r
return ()
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