Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

HIE gives "could not execute: <some preprocessor exe>" #1500

Open
Ailrun opened this issue Dec 26, 2019 · 7 comments
Open

HIE gives "could not execute: <some preprocessor exe>" #1500

Ailrun opened this issue Dec 26, 2019 · 7 comments

Comments

@Ailrun
Copy link
Member

Ailrun commented Dec 26, 2019

In stack cradle (more specifically, I use multi-cradle with stack), if a preprocessor executable is installed only locally but not globally, HIE says could not execute: <the name of the preprocessor>.
For my case, I use tasty-discover, and my package.yaml specify it as a dependency like this,

tests:
  test:
    main: Driver.hs
    source-dirs:
      - test
    dependencies:
      - hedgehog
      - tasty
      - tasty-discover
      - tasty-hedgehog

but HIE emits could not execute: tasty-discover.

Maybe this is related to mpickering#60 and will be solved by #1496, but I am not sure.

@fendor
Copy link
Collaborator

fendor commented Dec 26, 2019

No, you have to have tasty-disover on the path for now. Maybe modify your path to point to the executable installed by stack.
Maybe we can change that in the future to be aware of the stack installed binaries.

@mpickering
Copy link
Collaborator

The proper solution here is to execute hie using stack exec hie? Just like how nix users have to run ghc in the right nix-shell command.

@fendor
Copy link
Collaborator

fendor commented Dec 26, 2019

While this is true, I dont think that this is really a viable solution for some users. E.g. we endorse the hie-wrapper, which can currently not handle this at all. But maybe we can fix that.

@alanz
Copy link
Collaborator

alanz commented Dec 26, 2019

I think it is important that hie is able to build based on whatever environment the project is using. If it uses tasty-discover (or hspec-discover) based on a project config, we must honour this.

@Ailrun
Copy link
Member Author

Ailrun commented Dec 26, 2019

@fendor, @mpickering, @alanz, thank you all for the answers!
Unfortunately, as @fendor said, stack exec hie is not viable for me because of how lsp-haskell works (or at least I believe it is not), so I hope it will be handled by hie itself, if possible.

(FYI, even though I had installed tasty-discover globally and made it work, I posted this issue because I don't think global installation is an optimal solution)

@Ailrun
Copy link
Member Author

Ailrun commented Dec 28, 2019

Oh, I see. It's hard to change the behaviour since it is the behaviour of GHC library.
So the following is a problematic part, right?
https://github.com/mpickering/hie-bios/blob/90955b3757f3fa65e7a96d54b677f5c936e3b782/src/HIE/Bios/Ghc/Api.hs#L84-L93
(The code calls G.depanal [] True and G.load' LoadAllTargets msg mod_graph consecutively to load all dependency modules, and I guess it's not easy to give some specific PATH to G.load')

@fendor
Copy link
Collaborator

fendor commented Dec 28, 2019

Exactly. We would have to manipulate the path ourselves, which is doable, but definitely postponed for now.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

4 participants