haskell-mafia / mafia

Provides protection against cabal swindling, robbing, injuring or sabotaging people with chopsticks.
http://haskell-mafia.github.io/mafia/
BSD 3-Clause "New" or "Revised" License
135 stars 19 forks source link

Should mafia be building the tests for dependent packages? #228

Closed erikd closed 6 years ago

erikd commented 6 years ago

Just noticed that mafia builds the tests for dependent packages, or at least tries to.

With cabal 2.0 and ghc 8.4.3 I can do this:

> cabal unpack criterion-1.4.1.0
> cd criterion-1.4.1.0/
> touch examples/LICENSE   # Fix missing file
> mafia build

and I get this:

Installing dependencies...
Creating sandbox for uuid-types-1.0.3-33caa758f7d96b8e874e771b77fa7269d708a013
Building uuid-types-1.0.3-33caa758f7d96b8e874e771b77fa7269d708a013
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: hashable-1.2.7.0/installed-3hr... (user goal)
next goal: tasty (dependency of uuid-types-1.0.3:*test)
rejecting: tasty-1.1.0.1, tasty-1.1, tasty-1.0.1.1, tasty-1.0.1,
tasty-1.0.0.1, tasty-1.0, tasty-0.12.0.1, tasty-0.12 (conflict:
uuid-types-1.0.3:test => tasty>=0.10 && <0.12)
rejecting: tasty-0.11.3, tasty-0.11.2.5 (conflict: hashable =>
base==4.11.1.0/installed-4.1..., tasty => base>=4.5 && <4.11)
rejecting: tasty-0.11.2.4 (conflict: hashable =>
base==4.11.1.0/installed-4.1..., tasty => base>=4.6 && <4.11)

The problem is actually the test dependencies of uuid-types. The tests specify a stupidly old version of tasty which then requires an old version of hashable which conflicts with the base supplied with this version of GHC.

Obviously uuid-types should be fixed, but I'm wondering if broken tests should prevent a dependency being built.

erikd commented 6 years ago

Turns out this was due to tweaking my ~/.cabal/config file (on a single machine I had not used in a white) to override the default and set tests: True. Reseting it returned mafia's behavior to normal.

Found the problem using cabal user-config diff which prints the difference between the user's config and the default one for that version of cabal.

Closing this.