Closed andrewufrank closed 7 years ago
This is the actual error:
-0.01s: "ghc-modi said: Error parsing targets: No local directories found as children of ."
Basically, ghc-mod crashes.
Honestly, I have no idea why. Running ghc-mod "/home/frank/Workspace8/atomtest/repo8/dove/Data/DoveRDF.hs -c 46 8
manually might give more information. Make sure current working directory is /home/frank/Workspace8/atomtest/repo8/dove
.
Sorry I can't me of more immediate help.
thank you for your immediate reaction. it should not touch the dove
directory, the stack.yaml
is later.
for the command
ghc-mod "/home/frank/Workspace8/atomtest/repo8/dove/Data/DoveRDF.hs" -c -- 46 8
i get "invalid option -c. can you tell me what the command should look excatly - i cannot see a -c
option?
flags: {}
extra-package-dbs: []
packages:
- '.'
- litText
- litNLP
- rdf4store
- rdfhextension
- uniform/uniform-algebras/
- uniform/uniform-convenience/
- uniform/uniform-error/
- uniform/uniform-fileio/
- uniform/uniform-strings/
- uniform/uniform-time/
extra-deps:
- chatter-0.8.0.1
- data-easy-0.7.0
- fullstop-0.1.4
- hgal-2.0.0.2
- non-negative-0.1.1
- numeric-prelude-0.4.2
- posix-paths-0.2.1.1
- rdf4h-3.0.1
- test-invariant-0.4.5.0
- tokenize-0.3.0
resolver: lts-8.1
Oh, sorry, I forgot type
. So the command should actually be
ghc-mod type "/home/frank/Workspace8/atomtest/repo8/dove/Data/DoveRDF.hs" -c -- 46 8
frank@santafe:~/Workspace8/atomtest/repo8/dove$ ghc-mod type "/home/frank/Workspace8/atomtest/repo8/dove/Data/DoveRDF.hs" -c -- 46 8 the reply then is
Error parsing targets: No local directories found as children of .
EXCEPTION: types:
readCreateProcess: stack "build" "--only-dependencies" "." (exit 1): failed
line 46 of DoveRDF.hs is import Safe
i do not see why it is interested in safe and i seem not to have changed this line (but it was in a project-wide search).
the stack.yaml (in home/frank/Workspace/atomtest/repo8
) you have above. i guess the point is that
there is no entry for dove
because i do not work on this right now.
stack build on this directory gives the error message that ghc-mod is reporting, but stack build on the directory above does not enter the dove
directory. i sense there might be a broad direction to work on all subdirectories (some *) and not only on those in the stack.yaml
.
thank you for your effort!
Well, there is a change in ghc-mod master that removes this particular call to stack build
unless explicitly requested, but ghc-mod still needs to at least be able to configure the project, and in the absence of stack.yaml
that could be tricky. But if you're not working on dove
, I wonder why it tries to read an expression type? Do you just happen to have DoveRDF
open?
i will check your suggestion next time i see this error. thank you for the help.
same setup, but i guess a different type of crash - therefore moved to #201
Okay, so this is trickier. Basically, ghc-mod can't find littext
that your project uses. There could be a lot of reasons for that, but maybe that's just a problem with package-db paths (which we should probably fix on ghc-mod side of things, but it can get rather tricky, see https://github.com/DanielG/ghc-mod/issues/787). Could you post output of stack path
run in /home/frank/Workspace8/atomtest/repo8/litNLP
and the directory where superproject stack.yaml
is located (I'm assuming /home/frank/Workspace8/atomtest/repo8
)?
Thanks. And sorry you're running into these issues.
same setup, but i guess a different type of crash: moved to #201
here the stack path that you asked for - regarding the first issue. do you think the second issue (comment above) is related or separate? if separate, delete or move to a new issue, please.
i wonder if i should add the solution form https://github.com/DanielG/ghc-mod/issues/787 ad. i think i can do this, if you believe that it would help (or clarify the issue)
in the root:
frank@santafe:~/Workspace8/atomtest/repo8$ stack path
stack-root: /home/frank/.stack
project-root: /home/frank/Workspace8/atomtest/repo8
config-location: /home/frank/Workspace8/atomtest/repo8/stack.yaml
bin-path: /home/frank/.stack/snapshots/x86_64-linux-nopie/lts-8.1/8.0.2/bin:/home/frank/.stack/programs/x86_64-linux/ghc-nopie-8.0.2/bin:/home/frank/.local/bin:/home/frank/.local/bin/:/home/frank/ghc-mod-sandbox/bin/:/home/frank/.cabal/bin:/home/frank/Debinstall83/deb9/amd9.bin:/home/frank/.bin:/home/frank/.bin/corenlp:/home/frank/.bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
programs: /home/frank/.stack/programs/x86_64-linux
compiler-exe: /home/frank/.stack/programs/x86_64-linux/ghc-nopie-8.0.2/bin/ghc
compiler-bin: /home/frank/.stack/programs/x86_64-linux/ghc-nopie-8.0.2/bin
local-bin: /home/frank/.local/bin
extra-include-dirs:
extra-library-dirs:
snapshot-pkg-db: /home/frank/.stack/snapshots/x86_64-linux-nopie/lts-8.1/8.0.2/pkgdb
local-pkg-db: /home/frank/Workspace8/atomtest/repo8/.stack-work/install/x86_64-linux-nopie/lts-8.1/8.0.2/pkgdb
global-pkg-db: /home/frank/.stack/programs/x86_64-linux/ghc-nopie-8.0.2/lib/ghc-8.0.2/package.conf.d
ghc-package-path: /home/frank/Workspace8/atomtest/repo8/.stack-work/install/x86_64-linux-nopie/lts-8.1/8.0.2/pkgdb:/home/frank/.stack/snapshots/x86_64-linux-nopie/lts-8.1/8.0.2/pkgdb:/home/frank/.stack/programs/x86_64-linux/ghc-nopie-8.0.2/lib/ghc-8.0.2/package.conf.d
snapshot-install-root: /home/frank/.stack/snapshots/x86_64-linux-nopie/lts-8.1/8.0.2
local-install-root: /home/frank/Workspace8/atomtest/repo8/.stack-work/install/x86_64-linux-nopie/lts-8.1/8.0.2
snapshot-doc-root: /home/frank/.stack/snapshots/x86_64-linux-nopie/lts-8.1/8.0.2/doc
local-doc-root: /home/frank/Workspace8/atomtest/repo8/.stack-work/install/x86_64-linux-nopie/lts-8.1/8.0.2/doc
dist-dir: .stack-work/dist/x86_64-linux-nopie/Cabal-1.24.2.0
local-hpc-root: /home/frank/Workspace8/atomtest/repo8/.stack-work/install/x86_64-linux-nopie/lts-8.1/8.0.2/hpc
local-bin-path: /home/frank/.local/bin
ghc-paths: /home/frank/.stack/programs/x86_64-linux
and in litNLP
frank@santafe:~/Workspace8/atomtest/repo8/litNLP$ stack path
stack-root: /home/frank/.stack
project-root: /home/frank/Workspace8/atomtest/repo8
config-location: /home/frank/Workspace8/atomtest/repo8/stack.yaml
bin-path: /home/frank/.stack/snapshots/x86_64-linux-nopie/lts-8.1/8.0.2/bin:/home/frank/.stack/programs/x86_64-linux/ghc-nopie-8.0.2/bin:/home/frank/.local/bin:/home/frank/.local/bin/:/home/frank/ghc-mod-sandbox/bin/:/home/frank/.cabal/bin:/home/frank/Debinstall83/deb9/amd9.bin:/home/frank/.bin:/home/frank/.bin/corenlp:/home/frank/.bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
programs: /home/frank/.stack/programs/x86_64-linux
compiler-exe: /home/frank/.stack/programs/x86_64-linux/ghc-nopie-8.0.2/bin/ghc
compiler-bin: /home/frank/.stack/programs/x86_64-linux/ghc-nopie-8.0.2/bin
local-bin: /home/frank/.local/bin
extra-include-dirs:
extra-library-dirs:
snapshot-pkg-db: /home/frank/.stack/snapshots/x86_64-linux-nopie/lts-8.1/8.0.2/pkgdb
local-pkg-db: /home/frank/Workspace8/atomtest/repo8/.stack-work/install/x86_64-linux-nopie/lts-8.1/8.0.2/pkgdb
global-pkg-db: /home/frank/.stack/programs/x86_64-linux/ghc-nopie-8.0.2/lib/ghc-8.0.2/package.conf.d
ghc-package-path: /home/frank/Workspace8/atomtest/repo8/.stack-work/install/x86_64-linux-nopie/lts-8.1/8.0.2/pkgdb:/home/frank/.stack/snapshots/x86_64-linux-nopie/lts-8.1/8.0.2/pkgdb:/home/frank/.stack/programs/x86_64-linux/ghc-nopie-8.0.2/lib/ghc-8.0.2/package.conf.d
snapshot-install-root: /home/frank/.stack/snapshots/x86_64-linux-nopie/lts-8.1/8.0.2
local-install-root: /home/frank/Workspace8/atomtest/repo8/.stack-work/install/x86_64-linux-nopie/lts-8.1/8.0.2
snapshot-doc-root: /home/frank/.stack/snapshots/x86_64-linux-nopie/lts-8.1/8.0.2/doc
local-doc-root: /home/frank/Workspace8/atomtest/repo8/.stack-work/install/x86_64-linux-nopie/lts-8.1/8.0.2/doc
dist-dir: .stack-work/dist/x86_64-linux-nopie/Cabal-1.24.2.0
local-hpc-root: /home/frank/Workspace8/atomtest/repo8/.stack-work/install/x86_64-linux-nopie/lts-8.1/8.0.2/hpc
local-bin-path: /home/frank/.local/bin
ghc-paths: /home/frank/.stack/programs/x86_64-linux
i hope this is helpful.
Strangely enough, everything seems to be in order...
So here's an idea...
.stack-work
from sub-projects (litText
, litNLP
in particular)stack build
in superproject (/home/frank/Workspace8/atomtest/repo8
)stack build ghc-mod
in superproject (no need for stack install
btw)I've tried with a simple a-b project (i.e. superproject references projects a and b, where b depends on a, no stack.yaml in sub-projects), and everything seems to work... If your project is opensource and available from github or something similar, I might test with it directly. If not, don't worry about it.
Also, for good measure, run stack exec ghc-mod debug
in litNLP
and litText
and post output here, maybe I'm missing something.
As for the relevance to the first issue... Well, frankly, first one is a non-issue honestly. Ghc-mod is not supposed to work when stack can't configure the project, and from what I understood, the project that threw an error is "disabled". So... yeah. Big scary red box just basically says "hey, ghc-mod can't handle this". The second issue is different in this regard, as it should work, but for some obscure reason does not, and it's not related in any shape or form to the first one. Since github doesn't provide means for splitting issues, I'm just going to leave this as it is.
i followed you advice to delete all .stack-work (except in superproject) (and i have included the missing dove directory in stack.yaml - which is not recompiled, so no time lost). it works. Again, thank you for your patience!
nevertheless, i think if a subdirectory is not in the stack.yaml, then it should be ignored by ghc-mod.
ps. i also tried to split the issues, but i am not certain i did this right and perhaps confused the whole, so i close this discusion. feel free to close #201 and i will reopen, when i have a new case.
nevertheless, i think if a subdirectory is not in the stack.yaml, then it should be ignored by ghc-mod.
Problem is, stack doesn't report if a given project is not in stack.yaml
. So only way to know is try to configure it and see if it fails. But it can fail for a huge number of other reasons. So... you know, we've opted for an obvious solution of "tell the user something went wrong". Better error messages should alleviate the problem somewhat, but that's pretty low on the priority list and let's say, it's trickier than it should be. I've toyed with the idea of improving ghc-mod's API to make this kind of thing easier, but it's pretty much in its infancy, and there are a lot of more pressing issues at the moment.
[Enter steps to reproduce below:]
i use ghc. 8.0.2 with stack, the ghc-mod is compiled with same ghc version (stack build ghc-mod and stack install ghc-mod).
this is a show stopper - sorry to say!
andrew
here the log:
Atom Version: 1.13.1 Electron Version: 1.3.13 System: Debian GNU/Linux Thrown From: haskell-ghc-mod package, v1.19.7
Stack Trace
Haskell-ghc-mod: ghc-mod interactive command type failed with error ghc-modi crashed
Commands
Config
Installed Packages