-
Notifications
You must be signed in to change notification settings - Fork 698
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplicate build-tools-depends/build-depends chokes new-build #4986
Comments
@ezyang Note that Pretty is meant to replace Text's disp. "Debugging Pretty instances" sounds suspicious, it's probably ok if the types won't be ever a type of cabal/project/etc -file field
Also please avoid huge patches at all cost. It's PITA to review.
Also remember that we have a freeze in two weeks, please tell @23Skidoo & others what you plan to do. Let's be strict with the deadline!
…Sent from my iPhone
On 1 Jan 2018, at 8.34, Edward Z. Yang ***@***.***> wrote:
This happened in practice with pretty-show (https://hackage.haskell.org/package/pretty-show-1.6.15/pretty-show.cabal)
Manifested itself as #4621
I am actually not sure if getAllToolDependencies should merge tool dependencies or not. Maybe not, in which case this patch is sufficient:
diff --git a/Cabal/Distribution/Backpack/ConfiguredComponent.hs b/Cabal/Distribution/Backpack/ConfiguredComponent.hs
index 1d929636f..9e095a39f 100644
--- a/Cabal/Distribution/Backpack/ConfiguredComponent.hs
+++ b/Cabal/Distribution/Backpack/ConfiguredComponent.hs
@@ -40,6 +40,7 @@ import Distribution.Simple.LocalBuildInfo
import Distribution.Version
import Distribution.Utils.LogProgress
import Distribution.Utils.MapAccum
+import Distribution.Utils.Generic
import Control.Monad
import qualified Data.Set as Set
@@ -191,7 +192,7 @@ toConfiguredComponent pkg_descr this_cid dep_map component = do
, pn /= packageName pkg_descr
, (cn, e) <- Map.toList comp_map
, cn == CLibName ]
- exe_deps =
+ exe_deps = ordNub $
[ exe
| ExeDependency pn cn _ <- getAllToolDependencies pkg_descr bi
-- The error suppression here is important, because in general
diff --git a/Cabal/Distribution/Types/AnnotatedId.hs b/Cabal/Distribution/Types/AnnotatedId.hs
index cc5991a3c..a424335fd 100644
--- a/Cabal/Distribution/Types/AnnotatedId.hs
+++ b/Cabal/Distribution/Types/AnnotatedId.hs
@@ -16,7 +16,7 @@ data AnnotatedId id = AnnotatedId {
ann_cname :: ComponentName,
ann_id :: id
}
- deriving (Show)
+ deriving (Show, Eq, Ord)
instance Package (AnnotatedId id) where
packageId = ann_pid
This might help unblock someone. I've got a bigger patch coming with (1) lots of new debugging Pretty instances, (2) more asserts and (3) a regression test.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I was hoping that the invariant was, if you have a "Pretty" instance but not a Parsec instance, then the Pretty instance is not intended to be machine-readable and if you ever did post-facto add a Parsec instance, you would fix the Pretty instance to match (which would be fine to change because no one was relying on it being parseable.) If this is not the case, then I'll have to add a full parallel Outputable type class hierarchy to Pretty for non-roundtrippable printing. ;)
The plan is:
I'll stage them all as separate patches to make it easier to review |
Big PRs are okay as long as they consist of a series of reasonably-sized patches that are more or less self-contained and easy to review one by one. #4889 is a good example of a big PR that is fairly easy to review. |
Previously, if you had: build-tool-depends: happy:happy build-tools: happy This would cause an executable dependency to show up twice in exe_deps. It turns out that this made its way all the way to cabal-install's InstallPlan, and then broke an invariant in the install plan execution engine. This is the "correct" fix but the whole arrangement is a little brittle. Signed-off-by: Edward Z. Yang <[email protected]>
Signed-off-by: Edward Z. Yang <[email protected]>
This assert would have more directly pinpointed the InstallPlan invariant that was broken in haskell#4986. Signed-off-by: Edward Z. Yang <[email protected]>
Signed-off-by: Edward Z. Yang <[email protected]>
This assert would have more directly pinpointed the InstallPlan invariant that was broken in haskell#4986. Signed-off-by: Edward Z. Yang <[email protected]>
Previously, if you had: build-tool-depends: happy:happy build-tools: happy This would cause an executable dependency to show up twice in exe_deps. It turns out that this made its way all the way to cabal-install's InstallPlan, and then broke an invariant in the install plan execution engine. This is the "correct" fix but the whole arrangement is a little brittle. Signed-off-by: Edward Z. Yang <[email protected]>
Signed-off-by: Edward Z. Yang <[email protected]>
Signed-off-by: Edward Z. Yang <[email protected]>
Previously, if you had: build-tool-depends: happy:happy build-tools: happy This would cause an executable dependency to show up twice in exe_deps. It turns out that this made its way all the way to cabal-install's InstallPlan, and then broke an invariant in the install plan execution engine. This is the "correct" fix but the whole arrangement is a little brittle. Signed-off-by: Edward Z. Yang <[email protected]>
Signed-off-by: Edward Z. Yang <[email protected]>
Previously, if you had: build-tool-depends: happy:happy build-tools: happy This would cause an executable dependency to show up twice in exe_deps. It turns out that this made its way all the way to cabal-install's InstallPlan, and then broke an invariant in the install plan execution engine. This is the "correct" fix but the whole arrangement is a little brittle. Signed-off-by: Edward Z. Yang <[email protected]> (cherry picked from commit 9b9414c)
This happened in practice with pretty-show (https://hackage.haskell.org/package/pretty-show-1.6.15/pretty-show.cabal)
Manifested itself as #4621
I am actually not sure if
getAllToolDependencies
should merge tool dependencies or not. Maybe not, in which case this patch is sufficient:This might help unblock someone. I've got a bigger patch coming with (1) lots of new debugging Pretty instances, (2) more asserts and (3) a regression test.
The text was updated successfully, but these errors were encountered: