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

Weeder doesn't work with stack 2.* #53

Open
ghost opened this issue Jun 28, 2019 · 10 comments
Open

Weeder doesn't work with stack 2.* #53

ghost opened this issue Jun 28, 2019 · 10 comments

Comments

@ghost
Copy link

ghost commented Jun 28, 2019

The new version of Stack doesn't generate .dump-hi files anymore (commercialhaskell/stack#4804).

The workaround is to tell stack to generate them: --ghc-options "-ddump-to-file -ddump-hi".

Are dump-hi files mandatory for weeder? Is possible to use .hi files only?

UPD. I guess the solution is to use http://hackage.haskell.org/package/hi-file-parser which is used by stack, but that's a lot of things to do.
UPD2. https://www.haskell.org/ghc/blog/20190626-HIEFiles.html

@ndmitchell
Copy link
Owner

I don't think hi-file-parser exposes nearly enough details. I also don't think HIE files helps massively - the info I need is already in the .hi, but there's a chance Weeder could be improved with the info.

I think the short term solution is to read the .hi files and send them through GHC --show-interface and then read the result.

@ndmitchell
Copy link
Owner

Uh oh, turns out the --show-iface flag doesn't show as much information as -ddump-hi. I've raised a GHC ticket at https://gitlab.haskell.org/ghc/ghc/issues/16886

@ndmitchell
Copy link
Owner

I have edited the README to require adding -ddump-to-file -ddump-hi. I've made a few changes in the code to cope with infelicities in the .dump-hi file, but it appears there are a few. I'll also need one to find the .hi files, since the .dump-hi files aren't always in the same place for Main modules, especially with -main-is. Those changes are going to take longer (unless someone else steps up), so the README workaround will have to do for now.

@leptonyu
Copy link

Can weeder add an argument --ghc-options to specify -ddump-to-file -ddump-hi?

@hsenag
Copy link

hsenag commented Sep 1, 2019

Could you do a release with the README update? It took me a fair bit of head-scratching before I found this issue.

@kvanbere
Copy link

kvanbere commented Sep 5, 2019

Yep this one got my head scratching also because it broke my Travis

@fizbin
Copy link

fizbin commented Sep 11, 2019

Related to this, it would be useful if weeder popped up a message saying something like "NO COMPILATIONS FOUND - please recheck instructions about ghc-options in stack.yaml" when no compilation at all was found, rather than simply telling me that every single module in my cabal file wasn't compiled.

@pjljvandelaar
Copy link

I don't know whether all observed behavior is caused by stack 2.* but I will add it here to avoid duplication.

On windows,
with Weeder v1.0.6, (C) Neil Mitchell 2017-2018
and stack --version: Version 2.1.3, Git revision 0fa51b9925decd937e4a993ad90cb686f88fa282 (7739 commits) x86_64 hpack-0.31.2
I get 'stty' is not recognized as an internal or external command, operable program or batch file.
and a lot of Module not compiled while they are.

See e.g. this log

C:> weeder -b .
'stty' is not recognized as an internal or external command,
operable program or batch file.
txs-smt-0.1.0.0: unregistering (local file changes: test\TorXakis\SortContextSpec.hs)
txs-basics     > Test running disabled by --no-run-tests flag.
txs-basics-gen > Test running disabled by --no-run-tests flag.
txs-name       > Test running disabled by --no-run-tests flag.
txs-name-gen   > Test running disabled by --no-run-tests flag.
txs-regex      > Test running disabled by --no-run-tests flag.
txs-regex-gen  > Test running disabled by --no-run-tests flag.
txs-sort       > Test running disabled by --no-run-tests flag.
txs-sort-gen   > Test running disabled by --no-run-tests flag.
txs-valexpr-gen> Test running disabled by --no-run-tests flag.
txs-value      > Test running disabled by --no-run-tests flag.
txs-value-gen  > Test running disabled by --no-run-tests flag.
txs-var-gen    > Test running disabled by --no-run-tests flag.
txs-smt        > build (lib + test)
txs-smt        > Preprocessing library for txs-smt-0.1.0.0..
txs-smt        > Building library for txs-smt-0.1.0.0..
txs-smt        > Preprocessing test suite 'txs-smt-test' for txs-smt-0.1.0.0..
txs-smt        > Building test suite 'txs-smt-test' for txs-smt-0.1.0.0..
txs-smt        > [5 of 6] Compiling TorXakis.SortContextSpec
txs-smt        > Linking .stack-work\dist\67675594\build\txs-smt-test\txs-smt-test.exe ...
txs-smt        > copy/register
txs-smt        > Installing library in C:\TorXakis.git\.stack-work\install\44ca3443\lib\x86_64-windows-ghc-8.2.2\txs-smt-0.1.0.0-H93aL5LguFvB2W30S1TUMR
txs-smt        > Registering library for txs-smt-0.1.0.0..
txs-smt        > Test running disabled by --no-run-tests flag.
Completed 14 action(s).
'stty' is not recognized as an internal or external command,
operable program or batch file.
'stty' is not recognized as an internal or external command,
operable program or batch file.
= Package txs-prettyprint-gen =

== Section library ==
Module not compiled
* TorXakis.OptionsGen
Redundant build-depends entry
* QuickCheck
* base
* deepseq
* txs-prettyprint

= Package txs-solve-random =

== Section library ==
Module not compiled
* TorXakis.RandomSolver
Redundant build-depends entry
* base
* hashmap
* mtl
* random
* random-shuffle
* text
* txs-basics
* txs-name
* txs-regex
* txs-solve
* txs-sort
* txs-valexpr
* txs-value
* txs-var

= Package txs-regex =

== Section library ==
Module not compiled
* TorXakis.Regex
* TorXakis.Regex.ConversionPosix
* TorXakis.Regex.ConversionXsd
* TorXakis.Regex.Regex
* TorXakis.Regex.RegexFromXsdAlex
* TorXakis.Regex.RegexFromXsdHappy
Redundant build-depends entry
* array
* base
* containers
* deepseq
* text
* txs-basics

== Section test:txs-regex-test ==
Module not compiled
* Spec.hs
* TorXakis.RegexSpec
Redundant build-depends entry
* QuickCheck
* base
* hspec
* regex-tdfa

= Package txs-var =

== Section library ==
Module not compiled
* TorXakis.ContextVar
* TorXakis.Var
* TorXakis.Var.FreeVars
* TorXakis.Var.VarDef
* TorXakis.Var.VarsDecl
* TorXakis.VarContext
Redundant build-depends entry
* base
* containers
* deepseq
* hashable
* txs-basics
* txs-name
* txs-sort

= Package txs-prettyprint =

== Section library ==
Module not compiled
* TorXakis.PrettyPrint
Redundant build-depends entry
* base
* containers
* deepseq
* text
* txs-basics
* txs-language
* txs-name
* txs-regex
* txs-sort
* txs-valexpr
* txs-value
* txs-var

= Package txs-serverstate =

== Section library ==
Module not compiled
* TorXakis.IfServer
* TorXakis.ServerState
Redundant build-depends entry
* base
* containers
* hashmap
* mtl
* network
* text
* txs-corestate
* txs-language
* txs-name
* txs-prettyprint
* txs-sort
* txs-valexpr
* txs-value
* txs-var

= Package txs-value-gen =

== Section library ==
Module not compiled
* TorXakis.ValueGen
Redundant build-depends entry
* QuickCheck
* base
* text
* txs-basics-gen
* txs-name
* txs-regex-gen
* txs-sort
* txs-sort-gen
* txs-value

== Section test:txs-value-gen-test ==
Module not compiled
* Spec.hs
* TorXakis.ValueGenSpec
Redundant build-depends entry
* QuickCheck
* base
* hspec
* txs-sort
* txs-sort-gen
* txs-value
* txs-value-gen

= Package txs-valexpr =

== Section library ==
Module not compiled
* TorXakis.ContextFunc
* TorXakis.ContextValExpr
* TorXakis.ContextValExpr.ContextValExpr
* TorXakis.ContextValExpr.ContextValExprBasis
* TorXakis.FuncContext
* TorXakis.FuncDef
* TorXakis.FuncSignature
* TorXakis.FuncSignature.FuncSignature
* TorXakis.FuncSignature.RefByFuncSignature
* TorXakis.FuncSignature.UsedFuncSignatures
* TorXakis.ValExpr
* TorXakis.ValExpr.Subst
* TorXakis.ValExpr.Unsafe
* TorXakis.ValExpr.UnsafeSubst
* TorXakis.ValExpr.ValExpr
* TorXakis.ValExpr.ValExprBasis
* TorXakis.ValExpr.ValExprExtension
* TorXakis.ValExprContext
Redundant build-depends entry
* Unique
* array
* base
* containers
* deepseq
* hashable
* hashmap
* regex-tdfa
* text
* txs-basics
* txs-name
* txs-regex
* txs-sort
* txs-value
* txs-var

= Package txs-defs =

== Section library ==
Module not compiled
* TorXakis.ContextTorXakis
Redundant build-depends entry
* base
* containers
* txs-basics
* txs-language
* txs-name
* txs-sort
* txs-valexpr

= Package txs-chan =

== Section library ==
Module not compiled
* TorXakis.Chan
* TorXakis.Chan.ChanDef
* TorXakis.Chan.ChansDecl
* TorXakis.ChanContext
Redundant build-depends entry
* base
* containers
* deepseq
* hashable
* txs-basics
* txs-name
* txs-sort

= Package txs-solve =

== Section library ==
Module not compiled
* TorXakis.ProblemSolver
Redundant build-depends entry
* base
* containers
* hashmap
* txs-basics
* txs-name
* txs-sort
* txs-valexpr
* txs-value
* txs-var

= Package txs-value =

== Section library ==
Module not compiled
* TorXakis.Value
* TorXakis.Value.ConversionText
* TorXakis.Value.ConversionXML
* TorXakis.Value.Value
* TorXakis.Value.ValueAlex
* TorXakis.Value.ValueHappy
Redundant build-depends entry
* array
* base
* bytestring
* containers
* deepseq
* hexpat
* regex-tdfa
* text
* txs-basics
* txs-name
* txs-sort

== Section test:txs-value-test ==
Module not compiled
* Spec.hs
* TorXakis.ValueSpec
Redundant build-depends entry
* base
* hspec
* text
* txs-sort
* txs-value

= Package txs-name-gen =

== Section library ==
Module not compiled
* TorXakis.FunctionNameGen
* TorXakis.NameGen
* TorXakis.XMLNameGen
Redundant build-depends entry
* QuickCheck
* base
* deepseq
* text
* txs-language
* txs-name

== Section test:txs-name-gen-test ==
Module not compiled
* Spec.hs
* TorXakis.FunctionNameGenSpec
* TorXakis.NameGenSpec
* TorXakis.XMLNameGenSpec
Redundant build-depends entry
* QuickCheck
* base
* containers
* hspec
* regex-tdfa
* text
* txs-basics-gen
* txs-language
* txs-name
* txs-name-gen

= Package txs-bexpr =

== Section library ==
Module not compiled
* TorXakis.BExpr
* TorXakis.BExpr.BExpr
* TorXakis.BExpr.BExprConstructor
* TorXakis.BExprContext
* TorXakis.ContextBExpr
* TorXakis.ContextBExpr.ContextBExpr
* TorXakis.ContextBExpr.ContextBExprBasis
* TorXakis.ContextChanVar
* TorXakis.ContextProc
* TorXakis.ProcContext
* TorXakis.ProcDef
* TorXakis.ProcSignature
* TorXakis.ProcSignature.ProcExit
* TorXakis.ProcSignature.ProcSignature
* TorXakis.ProcSignature.RefByProcSignature
* TorXakis.ProcSignature.UsedProcSignatures
* TorXakis.Relabel
Redundant build-depends entry
* Unique
* base
* containers
* deepseq
* hashable
* hashmap
* text
* txs-basics
* txs-chan
* txs-name
* txs-sort
* txs-valexpr
* txs-value
* txs-var

= Package txs-valexpr-gen =

== Section library ==
Module not compiled
* TorXakis.ContextTestValExpr
* TorXakis.TestFuncData
* TorXakis.TestValExprContext
* TorXakis.TestValExprData
Redundant build-depends entry
* QuickCheck
* base
* txs-basics-gen
* txs-name
* txs-name-gen
* txs-sort
* txs-sort-gen
* txs-valexpr
* txs-value
* txs-value-gen
* txs-var
* txs-var-gen

== Section test:txs-valexpr-gen-test ==
Module not compiled
* Spec.hs
* TorXakis.TestValExprContextSpec
Redundant build-depends entry
* QuickCheck
* base
* containers
* hspec
* txs-prettyprint
* txs-sort
* txs-valexpr
* txs-valexpr-gen
* txs-value

= Package txs-basics-gen =

== Section library ==
Module not compiled
* TorXakis.Cover
* TorXakis.Distribute
Redundant build-depends entry
* QuickCheck
* base

== Section test:txs-basics-gen-test ==
Module not compiled
* Spec.hs
* TorXakis.DistributeSpec
Redundant build-depends entry
* QuickCheck
* base
* hspec
* txs-basics-gen

= Package txs-name =

== Section library ==
Module not compiled
* TorXakis.FunctionName
* TorXakis.Name
* TorXakis.Name.Name
* TorXakis.Name.RefByName
* TorXakis.Name.UsedNames
* TorXakis.NameMap
* TorXakis.XMLName
Redundant build-depends entry
* Unique
* base
* containers
* deepseq
* hashable
* hashmap
* text
* txs-basics

== Section test:txs-name-test ==
Module not compiled
* Spec.hs
* TorXakis.NameSpec
Redundant build-depends entry
* QuickCheck
* base
* hspec
* regex-tdfa
* text
* txs-name

= Package txs-language =

== Section library ==
Module not compiled
* TorXakis.Language
Redundant build-depends entry
* base
* containers
* deepseq
* hashable
* regex-tdfa
* text
* txs-name
* txs-sort
* txs-valexpr

= Package txs-sort =

== Section library ==
Module not compiled
* TorXakis.ContextSort
* TorXakis.Sort
* TorXakis.Sort.Sort
* TorXakis.SortContext
Redundant build-depends entry
* base
* containers
* deepseq
* hashable
* text
* txs-basics
* txs-name

== Section test:txs-sort-test ==
Module not compiled
* Spec.hs
* TorXakis.SortADTSpec
* TorXakis.SortContextSpec
Redundant build-depends entry
* base
* hspec
* text
* txs-name
* txs-sort

= Package txs-smt =

== Section library ==
Module not compiled
* TorXakis.SMTAlex
* TorXakis.SMTHappy
* TorXakis.SMTString
* TorXakis.SMTStringAlex
* TorXakis.SMTStringHappy
* TorXakis.SmtLanguage
* TorXakis.SmtM
Redundant build-depends entry
* MissingH
* array
* base
* bimap
* containers
* deepseq
* hashable
* hashmap
* mtl
* process
* regex-tdfa
* text
* time
* txs-basics
* txs-name
* txs-regex
* txs-solve
* txs-sort
* txs-valexpr
* txs-value
* txs-var

== Section test:txs-smt-test ==
Module not compiled
* Spec.hs
* TorXakis.ConstraintSpec
* TorXakis.PushPopSpec
* TorXakis.SortContextSpec
* TorXakis.TestSolvers
Redundant build-depends entry
* HUnit
* QuickCheck
* base
* hashmap
* hspec
* hspec-contrib
* mtl
* process
* text
* txs-basics
* txs-name
* txs-regex
* txs-smt
* txs-solve
* txs-solve-random
* txs-sort
* txs-sort-gen
* txs-symbolic
* txs-valexpr
* txs-value
* txs-var

= Package txs-basics =

== Section library ==
Module not compiled
* TorXakis.Error
* TorXakis.RefByIndex
Redundant build-depends entry
* base
* deepseq
* hashable

== Section test:txs-basics-test ==
Module not compiled
* Spec.hs
* TorXakis.ErrorSpec
Redundant build-depends entry
* QuickCheck
* base
* hspec
* txs-basics

= Package txs-var-gen =

== Section library ==
Module not compiled
* TorXakis.ContextTestVar
* TorXakis.TestVarContext
* TorXakis.TestVarData
* TorXakis.VarsDeclGen
Redundant build-depends entry
* QuickCheck
* base
* containers
* multimap
* txs-name
* txs-name-gen
* txs-sort
* txs-sort-gen
* txs-var

== Section test:txs-var-gen-test ==
Module not compiled
* Spec.hs
* TorXakis.VarsDeclGenSpec
Redundant build-depends entry
* QuickCheck
* base
* hspec
* multimap
* txs-name
* txs-sort
* txs-sort-gen
* txs-var
* txs-var-gen

= Package txs-corestate =

== Section library ==
Module not compiled
* TorXakis.CoreState
Redundant build-depends entry
* base
* mtl
* text
* txs-valexpr

= Package txs-symbolic =

== Section library ==
Module not compiled
* TorXakis.SymbolicSolver
Redundant build-depends entry
* base
* containers
* hashmap
* mtl
* txs-basics
* txs-solve
* txs-sort
* txs-valexpr
* txs-value

= Package txs-regex-gen =

== Section library ==
Module not compiled
* TorXakis.RegexGen
Redundant build-depends entry
* QuickCheck
* base
* deepseq
* text
* txs-basics-gen
* txs-regex

== Section test:txs-regex-gen-test ==
Module not compiled
* Spec.hs
* TorXakis.RegexGenSpec
Redundant build-depends entry
* QuickCheck
* base
* containers
* hspec
* regex-tdfa
* text
* txs-basics
* txs-regex
* txs-regex-gen

@ghost
Copy link
Author

ghost commented Sep 17, 2019

@pjljvandelaar it seems to be a different issue. There is no stty program on windows.

tfausak added a commit to haskellweekly/haskellweekly that referenced this issue Sep 29, 2019
It doesn't work with Stack 2: ndmitchell/weeder#53
@ndmitchell
Copy link
Owner

Weeder 2.0 is being developed at https://github.com/ocharles/weeder so I suggest you go see if that fixes your issues.

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

6 participants