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

packages not compiling on latest lts with global project #2075

Closed
flip111 opened this issue Apr 28, 2016 · 9 comments
Closed

packages not compiling on latest lts with global project #2075

flip111 opened this issue Apr 28, 2016 · 9 comments
Milestone

Comments

@flip111
Copy link
Contributor

flip111 commented Apr 28, 2016

These are packages that don't work (also the stack solver command is broken)

https://gist.github.com/flip111/414149e053d7ce92992914ac0e5a8b9d

This is my global project stack.yaml file

# This is the implicit global project's config file, which is only used when
# 'stack' is run outside of a real project.  Settings here do _not_ act as
# defaults for all projects.  To change stack's default settings, edit
# '/home/flip111/.stack/config.yaml' instead.
#
# For more information about stack's configuration, see
# https://github.com/commercialhaskell/stack/blob/release/doc/yaml_configuration.md
#
flags: {}
extra-package-dbs: []
packages: []
extra-deps: []
resolver: lts-5.14

stack exec -- ghc-pkg describe mtl

name: mtl
version: 2.2.1
id: mtl-2.2.1-3af90341e75ee52dfc4e3143b4e5d219
key: mtl_Aue4leSeVkpKLsfHIV51E8
license: BSD3
maintainer: Edward Kmett <[email protected]>
homepage: http://github.com/ekmett/mtl
synopsis: Monad classes, using functional dependencies
description:
    Monad classes using functional dependencies, with instances
    for various monad transformers, inspired by the paper
    /Functional Programming with Overloading and Higher-Order Polymorphism/,
    by Mark P Jones, in /Advanced School of Functional Programming/, 1995
    (<http://web.cecs.pdx.edu/~mpj/pubs/springschool.html>).
category: Control
author: Andy Gill
exposed: True
exposed-modules:
    Control.Monad.Cont Control.Monad.Cont.Class Control.Monad.Error
    Control.Monad.Error.Class Control.Monad.Except
    Control.Monad.Identity Control.Monad.List Control.Monad.RWS
    Control.Monad.RWS.Class Control.Monad.RWS.Lazy
    Control.Monad.RWS.Strict Control.Monad.Reader
    Control.Monad.Reader.Class Control.Monad.State
    Control.Monad.State.Class Control.Monad.State.Lazy
    Control.Monad.State.Strict Control.Monad.Trans Control.Monad.Writer
    Control.Monad.Writer.Class Control.Monad.Writer.Lazy
    Control.Monad.Writer.Strict
trusted: False
import-dirs: /home/flip111/.stack/snapshots/x86_64-linux/nightly-2016-04-28/7.10.3/lib/x86_64-linux-ghc-7.10.3/mtl-2.2.1-Aue4leSeVkpKLsfHIV51E8
library-dirs: /home/flip111/.stack/snapshots/x86_64-linux/nightly-2016-04-28/7.10.3/lib/x86_64-linux-ghc-7.10.3/mtl-2.2.1-Aue4leSeVkpKLsfHIV51E8
data-dir: /home/flip111/.stack/snapshots/x86_64-linux/nightly-2016-04-28/7.10.3/share/x86_64-linux-ghc-7.10.3/mtl-2.2.1
hs-libraries: HSmtl-2.2.1-Aue4leSeVkpKLsfHIV51E8
depends:
    base-4.8.2.0-0d6d1084fbc041e1cded9228e80e264d
    transformers-0.4.2.0-81450cd8f86b36eaa8fa0cbaf6efc3a3
haddock-interfaces: /home/flip111/.stack/snapshots/x86_64-linux/nightly-2016-04-28/7.10.3/doc/mtl-2.2.1/mtl.haddock
haddock-html: /home/flip111/.stack/snapshots/x86_64-linux/nightly-2016-04-28/7.10.3/doc/mtl-2.2.1
pkgroot: "/home/flip111/.stack/snapshots/x86_64-linux/lts-5.14/7.10.3"
@flip111
Copy link
Contributor Author

flip111 commented Apr 28, 2016

After cleaning out the .stack/snapshots folder installing hasktags, doctest, stack-run and codex works, the rest remains a problem.

@sjakobi
Copy link
Member

sjakobi commented Apr 28, 2016

Thanks for reporting this! I've hit the files missing in package problem too.

The stack solver issue already being tracked (#2039).

Can you install hsdev when you manually add the missing dependencies to the extra-deps of your global stack.yaml?

As a workaround you could also

stack unpack hsdev
cd hsdev-X.Y
stack init --solver --ignore-subdirs
stack install

@flip111
Copy link
Contributor Author

flip111 commented Apr 28, 2016

Can you install hsdev when you manually add the missing dependencies to the extra-deps of your global stack.yaml?

Are you asking this just for me to test or as a more permanent solution? I could test it for you sure, but for a solution i'd rather not put dependencies in my global config.

@sjakobi
Copy link
Member

sjakobi commented Apr 28, 2016

To me, the global project is more or less scratch space.

Nothing keeps you from just deleting the extra-deps after the installation and performing a stack clean.

It would be convenient though to have someting like stack install --one-off mytool that performs roughly the steps I've described above.

@mgsloan
Copy link
Contributor

mgsloan commented Apr 28, 2016

Yeah, the global project is just a default project, there is nothing special about it. The docs should probably be clearer on this point.

i'd rather not put dependencies in my global config.

You can do stack install pkg-i-want-1.2.3 dependency-2.4, and that'll do it. We should support --solver when building non-local packages. I've only wanted this on rare occasion, but it would be nice to have: #1693

@mgsloan mgsloan added this to the Support milestone Apr 28, 2016
@flip111
Copy link
Contributor Author

flip111 commented Apr 29, 2016

hsdev works! extra-deps looks like this:

extra-deps:
  - hformat-0.1.0.0
  - simple-log-0.3.4
  - text-region-0.1.0.0

@mgsloan
Copy link
Contributor

mgsloan commented Apr 29, 2016

Cool, feel free to reopen if there's more to discuss

@mgsloan mgsloan closed this as completed Apr 29, 2016
@dkasak
Copy link
Contributor

dkasak commented Apr 15, 2017

I just tried building QuickFuzz and got an error mentioning the same package name (mtl-2.2.1@mtl_Aue4leSeVkpKLsfHIV51E8) while building one of the depedencies:

--  While building package djinn-lib-0.0.1.2 using:
      /home/dkasak/.local/share/stack/setup-exe-cache/x86_64-linux/setup-Simple-Cabal-1.22.5.0-ghc-7.10.3 --builddir=.stack-work/dist/x86_64-linux/Cabal-1.22.5.0 build --ghc-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1
    Logs have been written to: /home/dkasak/code/projects/QuickFuzz/.stack-work/logs/djinn-lib-0.0.1.2.log

    Configuring djinn-lib-0.0.1.2...
    Building djinn-lib-0.0.1.2...
    Preprocessing library djinn-lib-0.0.1.2...
    
    /tmp/stack2713/djinn-lib-0.0.1.2/src/Djinn/HCheck.hs:14:8:
        Could not find module ‘Control.Monad.Except’
        There are files missing in the ‘mtl-2.2.1@mtl_Aue4leSeVkpKLsfHIV51E8’ package,
        try running 'ghc-pkg check'.
        Use -v to see a list of the files searched for.
    
    /tmp/stack2713/djinn-lib-0.0.1.2/src/Djinn/HCheck.hs:18:8:
        Could not find module ‘Control.Monad.State’
        There are files missing in the ‘mtl-2.2.1@mtl_Aue4leSeVkpKLsfHIV51E8’ package,
        try running 'ghc-pkg check'.
        Use -v to see a list of the files searched for.

@sjakobi mentioned encountering files missing in package errors before. Is there a bug that tracks this? I don't have a clue of what the underlying cause is so I don't know where to start investigating.

@mgsloan
Copy link
Contributor

mgsloan commented Apr 22, 2017

@dkasak Closest thing to an issue for this is #1811 . Doing a ghc-pkg check seems to be a good plan for figuring out what causes this. Could also be useful to have a command to run that automatically unregisters such broken packages.

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

4 participants