Skip to content
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

Assert fails when elabBuildStyle == BuildAndInstall. #6762

Closed
philderbeast opened this issue May 7, 2020 · 3 comments
Closed

Assert fails when elabBuildStyle == BuildAndInstall. #6762

philderbeast opened this issue May 7, 2020 · 3 comments

Comments

@philderbeast
Copy link
Collaborator

philderbeast commented May 7, 2020

I'm doing a clean followed by an install and getting an assertion failure when BuildAndInstall is not expected. Note that I'm tracing elabBuildStyle.

. assert (elabBuildStyle == BuildInplaceOnly ||
elabComponentId == hashedInstalledPackageId
(packageHashInputs sharedConfig elab))

> cabal v2-clean
> cabal v2-install flare-timing
...
Build profile: -w ghc-8.2.2 -O1
In order, the following will be built:
BuildAndInstall
Assertion failed
CallStack (from HasCallStack):
  assert, called at ./Distribution/Client/ProjectPlanning.hs:255:5 in
main:Distribution.Client.ProjectPlanning

If I change the condition to the following then the install works:

    -- either a package is built inplace, or we are not attempting to
    -- build any test suites or benchmarks (we never build these
    -- for remote packages!)
  . assert ((traceShowId elabBuildStyle) == BuildInplaceOnly ||
     elabBuildStyle == BuildAndInstall ||
     Set.null elabStanzasAvailable)
> cabal v2-clean
> cabal v2-install flare-timing
...
BuildAndInstall
...
Symlinking 'unpack-track' to '/Users/pdejoux/.cabal/bin/unpack-track'
Symlinking 'fs-arrival' to '/Users/pdejoux/.cabal/bin/fs-arrival'
Symlinking 'align-time' to '/Users/pdejoux/.cabal/bin/align-time'
Symlinking 'area-step' to '/Users/pdejoux/.cabal/bin/area-step'
Symlinking 'fs-filter' to '/Users/pdejoux/.cabal/bin/fs-filter'
Symlinking 'fs-route' to '/Users/pdejoux/.cabal/bin/fs-route'
Symlinking 'mask-track' to '/Users/pdejoux/.cabal/bin/mask-track'
Symlinking 'peg-frame' to '/Users/pdejoux/.cabal/bin/peg-frame'
Symlinking 'task-length' to '/Users/pdejoux/.cabal/bin/task-length'
Symlinking 'discard-further' to '/Users/pdejoux/.cabal/bin/discard-further'
Symlinking 'gap-point' to '/Users/pdejoux/.cabal/bin/gap-point'
Symlinking 'tag-zone' to '/Users/pdejoux/.cabal/bin/tag-zone'
Symlinking 'fs-effort' to '/Users/pdejoux/.cabal/bin/fs-effort'
Symlinking 'fs-score' to '/Users/pdejoux/.cabal/bin/fs-score'
Symlinking 'land-out' to '/Users/pdejoux/.cabal/bin/land-out'
Symlinking 'cross-zone' to '/Users/pdejoux/.cabal/bin/cross-zone'
Symlinking 'extract-input' to '/Users/pdejoux/.cabal/bin/extract-input'

I built cabal from source, updated in the last week:

> git log
commit b89a1c634ab11421b21d56d37be5cd6504faa0d3
(HEAD -> master, upstream/master, origin/master)
Merge: c26cddb2c 7fcb20453
Author: Oleg Grenrus <oleg.grenrus@iki.fi>
Date:   Tue Apr 21 19:19:31 2020 +0300

    Merge pull request #6725 from phadej/disambiguate-flags

    Rename Flag types

> cabal v2-install cabal-install --overwrite-policy=always
...
Resolving dependencies...
Build profile: -w ghc-8.8.3 -O1
In order, the following will be built (use -v for more details):
BuildAndInstall
 - cabal-install-3.3.0.0 (exe:cabal) (requires build)
Starting     cabal-install-3.3.0.0 (exe:cabal)
BuildAndInstall
Building     cabal-install-3.3.0.0 (exe:cabal)
Installing   cabal-install-3.3.0.0 (exe:cabal)
Completed    cabal-install-3.3.0.0 (exe:cabal)
Symlinking 'cabal' to '/Users/pdejoux/.cabal/bin/cabal'

> cabal --version
cabal-install version 3.3.0.0
compiled using version 3.3.0.0 of the Cabal library
@philderbeast
Copy link
Collaborator Author

I can supply the change as a pull request.

@philderbeast
Copy link
Collaborator Author

Same assertion failure reported on #6006.

@philderbeast
Copy link
Collaborator Author

I can no longer reproduce this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant