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

Looking for .stack in /build fails #47

Closed
andreas-ebot7 opened this issue Feb 20, 2020 · 7 comments
Closed

Looking for .stack in /build fails #47

andreas-ebot7 opened this issue Feb 20, 2020 · 7 comments

Comments

@andreas-ebot7
Copy link

Hi, great work. Wanted to give it a try and ran the haskell-language-server in a project (with and without hie.yaml). It failed because its expecting the .stack folder in /build. It's located in the directory itself. Am I doing something wrong? Wanted to provide this as feedback. Feel free to close if expected.

haskell-language-server
ghcide version: 0.1.0.0 (GHC: 8.6.5) (PATH: /home/andreas/bin/haskell-language-server) (GIT hash: 80bc2e8fac470330479c9e2e2222ebf5a687b95f)
(haskell-language-server)Ghcide setup tester in /home/andreas/dev/ebot7/conversational-engine.
Report bugs at https://github.com/haskell/haskell-language-server/issues

Step 1/6: Finding files to test in /home/andreas/dev/ebot7/conversational-engine
Found 35 files

Step 2/6: Looking for hie.yaml files that control setup
Found 1 cradle

Step 3/6, Cradle 1/1: Implicit cradle for /home/andreas/dev/ebot7/conversational-engine
Cradle {cradleRootDir = "/home/andreas/dev/ebot7/conversational-engine", cradleOptsProg = CradleAction: Stack}

Step 4/6, Cradle 1/1: Loading GHC Session
haskell-language-server: /build/.stack/programs/x86_64-linux/ghc-tinfo6-8.6.5/lib/ghc-8.6.5/settings: openFile: does not exist (No such file or directory)
@andreas-ebot7 andreas-ebot7 changed the title Looking for file in /build fails Looking for .stack in /build fails Feb 20, 2020
@alanz
Copy link
Collaborator

alanz commented Feb 20, 2020

Great to hear you are trying this. Quite frankly, it is not really in a usable state at the moment.

@jneira
Copy link
Member

jneira commented Feb 20, 2020

@andreas-ebot7 That is a really weird error message: can you build the project with stack? what is the output of run stack path --compiler-bin in the haskell-language-server dir?

@andreas-ebot7
Copy link
Author

@alanz Glad to hear. I'll keep an eye open until it's ready to be tested.
@jneira I installed it as binary for arch. See haskell/haskell-ide-engine#1068 (comment) Maybe that's related to the issue.

@jneira
Copy link
Member

jneira commented Feb 21, 2020

@andreas-ebot7

I installed it as binary for arch

The comment is about haskell-ide-engine binaries (no haskell-language-server), did you want to mean you installed ghc using arch package manager?
Afaiu the error is caused haskell-language-server is looking for your ghc installation in the wrong place. As you are using stack, that should download ghc in a sandbox location i think run stack build to check if stack works standalone and stack path --compiler-bin to show where stack is looking for ghc could help to diagnose the error.

@andreas-ebot7
Copy link
Author

The comment is about haskell-ide-engine binaries (no haskell-language-server), did you want to mean you installed ghc using arch package manager?

https://repo.archlinuxcn.org/x86_64/
https://repo.archlinuxcn.org/x86_64/haskell-language-server-git-r77.80bc2e8-1-x86_64.pkg.tar.zst
It is, but the repository contains also binaries for haskell-language-server.
image

You intially asked for stack output in the haskell-language-server dir, which confused me because I didn't clone the repo and compile it myself.

stack path --compiler-bin in a haskell project prints a path located in my user home. The binary was looking for /build/... Maybe a directory existing when at the compile time of the binary.

stack path --compiler-bin
/home/andreas/.stack/programs/x86_64-linux/ghc-tinfo6-8.6.5/bin

So I tend to not spending much time digging into the issue, because it could be caused by the way the binary was compiled on another system. Thanks for your answers.

@andreas-ebot7
Copy link
Author

I don't see this error when compiling the language server myself :) Therefore I'm happy to close the issue.

Step 1/6: Finding files to test in /home/andreas/dev/ebot7/conversational-engine
Found 34 files

Step 2/6: Looking for hie.yaml files that control setup
Found 1 cradle

Step 3/6, Cradle 1/1: Loading /home/andreas/dev/ebot7/conversational-engine/hie.yaml

Step 4/6, Cradle 1/1: Loading GHC Session

Step 5/6: Initializing the IDE

Step 6/6: Type checking the files

Completed (34 files worked, 0 files failed)

@jneira
Copy link
Member

jneira commented Feb 21, 2020

Great! thanks for trying it and report the issue, it could help a lot in this early stage of development.

pepeiborra pushed a commit that referenced this issue Dec 27, 2020
* TEST: Degrade type error to warning

It will be upgraded again later, but for the time being we want to see
whether the proposed mechanism for deferring type errors works at
all. As it turns out the first, most obvious approach, does not
work: this is documented in the next commit.

A second approach was found that does work, and appears in the commit
after the next.

This test is failing until the second approach is implemented.

* Defer type errors (first approach: FAILED)

The idea is to set the `-fdefer-type-errors` and
`-fwarn-deferred-type-errors` flags, by setting options
programatically inside the `Ghc` monad.

Deferral of type errors was not observed with this approach. The
(less obvious) approach used in the next commit seems to be more
successful.

* Defer type errors (second approach: SUCCESS)

This approach modifies the `ParsedModule` which is passed to
`GHC.typecheckedModule` by hie-core's `typecheckModule`.

Type warning deferral is now observed at run time, and the tests pass.

* TEST: Reinstate severity of type errors

So far, type errors have been deferred and reported as warnings.

The next step is to ensure that the deferred type errors are reported
as errors rather than warnings, once again. This test fails until the
implementation arrives in the next commit.

* Upgrade severity of deferred Type Errors after typecheck

... and make the test pass again.

* Hide helper functions in local scopes

* Stop setting Opt_WarnDeferredTypeErrors

... and the tests still pass, thereby confirming @hsenag's hypothesis
that this flag is not needed.

* TEST: Check that typed holes are reported as errors

* TEST: Downgrade severity of typed holes Error -> Warning

This test fails, thereby falsifying the hypothesis that
`Opt_DeferTypeErrors` implies `Opt_DeferTypedHoles`.

* Defer typed holes

... and pass the failing test.

* TEST: Reinstate severity of typed holes

... failing the test until the implementation catches up in the next
commit.

* Upgrade severity of deferred Typed Holes after typecheck

... and pass the test once again.

* TEST: Degrade variable out of scope from Error to Warning

... test fails until next commit.

* Defer out of scope variables

... passing the test which was changed in the last commit.

* TEST: Reinstate severity of out of scope variables

... failing the test, and forcing the implementation to catch up.

* Upgrade severity of deferred out of scope vars after typecheck

... passing the test once again.

* Add explicit tests for deferrals

* Add IdeOption for deferral switching

* Improve documentation of optDefer

* Add IdeDefer newtype
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

3 participants