haskell / cabal

Official upstream development repository for Cabal and cabal-install
https://haskell.org/cabal
Other
1.63k stars 695 forks source link

assert, called at ./Distribution/Client/ProjectPlanning.hs:281:5 #4416

Open alanz opened 7 years ago

alanz commented 7 years ago

Using current cabal at c2dfc3310b71193a491424dddb8c4ab868c55b6e built with GHC 8.0.2, configuring for use with GHC ghc-8.2 branch at b3f7e9b54d9f36938effd265c84d5567b34c905b, with a brand new install.

Trying to build https://github.com/alanz/ghc-exactprint/tree/ghc-8.2

cabal new-configure --enable-tests -fdev --with-compiler=/opt/ghc/8.2.0.20170321/bin/ghc --allow-newer

results in

Resolving dependencies...
In order, the following would be built (use -v for more details):
 - Diff-0.3.4 (lib) (requires build)
 - StateVar-1.1.0.4 (lib) (requires build)
 - ansi-terminal-0.6.2.3 (requires build)
 - async-2.1.1 (lib) (requires build)
 - base-compat-0.9.2 (lib) (requires build)
 - base-orphans-0.5.4 (lib) (requires build)
 - cabal-doctest-1 (lib) (requires build)
 - call-stack-0.1.0 (lib) (requires build)
 - extensible-exceptions-0.1.1.4 (requires download & build)
 - ghc-paths-0.1.0.9 (requires build)
 - hostname-1.0 (requires build)
 - hsc2hs-0.68.1 (exe:hsc2hs) (requires build)
 - hspec-discover-2.4.2 (lib) (requires build)
 - mtl-2.2.1 (requires build)
 - old-locale-1.0.0.7 (lib) (requires build)
 - prelude-extras-0.4.0.3 (requires build)
 - primitive-0.6.2.0 (lib) (requires build)
 - semigroups-0.18.2 (lib) (requires build)
 - setenv-0.1.1.3 (lib) (requires build)
 - silently-1.2.5 (lib) (requires build)
 - stringbuilder-0.5.0 (lib) (requires download & build)
 - syb-0.7 (lib) (requires build)
 - text-1.2.2.1 (lib) (requires build)
 - transformers-compat-0.5.1.4 (lib) (requires build)
 - unix-compat-0.4.3.1 (requires build)
 - with-location-0.1.0 (lib) (requires download & build)
 - ansi-wl-pprint-0.6.7.3 (requires build)
 - HUnit-1.6.0.0 (lib) (requires download & build)
 - code-page-0.1.3 (lib) (requires build)
 - hspec-discover-2.4.2 (exe:hspec-discover) (requires build)
 - regex-base-0.93.2 (requires build)
 - tf-random-0.5 (lib) (requires build)
 - xml-1.3.14 (requires build)
 - hashable-1.2.5.0 (lib) (first run)
 - tagged-0.8.5 (lib) (requires build)
 - exceptions-0.8.3 (lib) (requires build)
 - filemanip-0.3.6.3 (requires build)
 - hspec-expectations-0.8.2 (lib) (requires build)
 - doctest-0.11.1 (lib) (first run)
 - regex-posix-0.95.2 (requires download & build)
 - QuickCheck-2.9.2 (lib) (requires build)
 - void-0.7.1 (lib) (requires build)
 - distributive-0.5.2 (requires build)
 - doctest-0.11.1 (test:doctests) (first run)
 - doctest-0.11.1 (exe:doctest) (first run)
 - test-framework-0.8.1.1 (requires download & build)
 - quickcheck-io-0.1.4 (lib) (requires build)
 - contravariant-1.4 (requires build)
 - test-framework-quickcheck2-0.3.0.3 (requires download & build)
 - test-framework-hunit-0.3.0.2 (requires download & build)
 - hspec-core-2.4.2 (lib) (requires build)
Assertion failed
CallStack (from HasCallStack):
  assert, called at ./Distribution/Client/ProjectPlanning.hs:281:5 in cabal-install-2.1.0.0-inplace:Distribution.Client.ProjectPlanning
ezyang commented 7 years ago

The commit you referenced is fairly old (Sep 13, 2016) and I couldn't repro using any of:

Here is an example succeeding run:

ezyang@sabre:~/Dev/labs/ghc-exactprint$ /opt/cabal/head/bin/cabal new-configure --enable-tests -fdev --with-compiler=ghc-8.2.1 --allow-newer
Resolving dependencies...
In order, the following would be built (use -v for more details):
 - Diff-0.3.4 (lib) (requires download & build)
 - base-orphans-0.5.4 (lib) (requires build)
 - cabal-doctest-1 (lib) (requires build)
 - call-stack-0.1.0 (lib) (requires build)
 - ghc-paths-0.1.0.9 (lib:ghc-paths) (requires build)
 - mtl-2.2.1 (lib:mtl) (requires build)
 - old-locale-1.0.0.7 (lib) (requires build)
 - prelude-extras-0.4.0.3 (lib:prelude-extras) (requires build)
 - semigroups-0.18.2 (lib) (requires build)
 - silently-1.2.5 (lib) (requires build)
 - stm-2.4.4.1 (lib) (requires build)
 - syb-0.7 (lib) (requires download & build)
 - text-1.2.2.1 (lib) (requires build)
 - transformers-compat-0.5.1.4 (lib) (requires build)
 - unix-compat-0.4.3.1 (lib:unix-compat) (requires build)
 - HUnit-1.5.0.0 (lib) (requires build)
 - old-time-1.1.0.3 (lib) (requires build)
 - StateVar-1.1.0.4 (lib) (requires build)
 - hashable-1.2.5.0 (lib) (requires build)
 - tagged-0.8.5 (lib) (requires build)
 - exceptions-0.8.3 (lib) (requires build)
 - filemanip-0.3.6.3 (lib:filemanip) (requires build)
 - void-0.7.1 (lib) (requires build)
 - distributive-0.5.2 (lib:distributive) (requires build)
 - contravariant-1.4 (lib:contravariant) (requires build)
 - comonad-5 (lib:comonad) (requires build)
 - bifunctors-5.4.1 (lib) (requires build)
 - semigroupoids-5.1 (lib:semigroupoids) (requires build)
 - profunctors-5.2 (lib) (requires build)
 - free-4.12.4 (lib) (requires build)
 - ghc-exactprint-0.5.3.0 (test:test) +dev (first run)
 - ghc-exactprint-0.5.3.0 (lib) +dev (first run)

Can you try again with a more recent cabal-install version?

alanz commented 7 years ago

Oops, the cabal version in question is actually 8d3e1203d4ec88612287fa06d16b1aaeda659655

Not sure how I got that hash in my report.

alanz commented 7 years ago

Ok, it seems to be related to other directories used as subprojects

My cabal.project has

packages: .
     ../../ekmett/comonad
     ../../bgamari/hashable
     ../../ekmett/semigroupoids
     ../../phadej/doctest

-- doctest needs branch static-flags-802-fix

where each repo matches the github 8.2 branch version.

If I comment out all the subpackages except '.' then it configures fine, but the build fails on comonad, as expected

Mikolaj commented 5 years ago

With cabal version https://github.com/haskell/cabal/commit/6316102a9cd2f889099ee52b1848414637621bc9 I'm getting two similar assertions, but only when I use the following cabal.project.local file:

jobs: 1
flags: +with_expensive_assertions
profiling: False
library-profiling: False
tests: False
coverage: False
library-coverage: False
optimization: False
documentation: False

package *
  documentation: True
  library-profiling: False

Here's how to reproduce:

git clone git@github.com:LambdaHack/LambdaHack.git
cd LambdaHack
git checkout 16e5632a10b116905e499f2dd83ca21d0a0be261
~/teeeeeeeeee/LambdaHack$ cabal new-install -j1 .
Wrote tarball sdist to
/home/mikolaj/teeeeeeeeee/LambdaHack/dist-newstyle/sdist/LambdaHack-0.9.2.0.tar.gz
Resolving dependencies...
Build profile: -w ghc-8.6.4 -O0
In order, the following will be built (use -v for more details):
Assertion failed
CallStack (from HasCallStack):
  assert, called at ./Distribution/Client/ProjectPlanning.hs:242:5 in main:Distribution.Client.ProjectPlanning
~/teeeeeeeeee/LambdaHack$ cabal new-install -j1
Resolving dependencies...
Assertion failed
CallStack (from HasCallStack):
  assert, called at ./Distribution/Client/ProjectOrchestration.hs:796:5 in main:Distribution.Client.ProjectOrchestration
Mikolaj commented 2 years ago

This may be related to #6006.