From 679812d2b679af952a7c9ab45a9a3a3476874a07 Mon Sep 17 00:00:00 2001
From: "Edward Z. Yang" <ezyang@cs.stanford.edu>
Date: Mon, 21 Dec 2015 14:45:45 -0800
Subject: [PATCH] Comment on #2971 at the relevant place needing a fix.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
---
 Cabal/Distribution/Simple/PreProcess.hs | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Cabal/Distribution/Simple/PreProcess.hs b/Cabal/Distribution/Simple/PreProcess.hs
index c854f21805..9c3e2032c8 100644
--- a/Cabal/Distribution/Simple/PreProcess.hs
+++ b/Cabal/Distribution/Simple/PreProcess.hs
@@ -448,6 +448,12 @@ ppHsc2hs bi lbi =
        ++ ["-o", outFile, inFile]
   }
   where
+    -- TODO: installedPkgs contains ALL dependencies associated with
+    -- the package, but we really only want to look at packages for the
+    -- *current* dependency.  We should use PackageIndex.dependencyClosure
+    -- on the direct depends of the component.  Can't easily do that,
+    -- because the signature of this function is wrong.  Tracked with
+    -- #2971 (which has a test case.)
     pkgs = PackageIndex.topologicalOrder (packageHacks (installedPkgs lbi))
     isOSX = case buildOS of OSX -> True; _ -> False
     isELF = case buildOS of OSX -> False; Windows -> False; AIX -> False; _ -> True;
-- 
GitLab