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

Rethink/rework the HIE BIOS #1053

Closed
alanz opened this issue Jan 14, 2019 · 15 comments
Closed

Rethink/rework the HIE BIOS #1053

alanz opened this issue Jan 14, 2019 · 15 comments

Comments

@alanz
Copy link
Collaborator

alanz commented Jan 14, 2019

haskell-ide-engine has the concept of a BIOS. which is the layer that interfaces with the underlying operating system, package manager, etc.

To date, we have been using modified versions of cabal-helper and ghc-mod, in forked repos from the main upstream.

It has now been several years, and we still cannot put hie onto hackage, because we do not have a clean dependency list.

So, time to reconsider our options.

  • Apply resources to getting cabal-helper, ghc-mod-core and ghc-mod as used by hie onto hackage.

  • Adapt https://github.com/kazu-yamamoto/hhp, which has cabal new-build support.

  • Something else, perhaps based on what ghcid is doing.

Prerequisites are that it supports stack, cabal old build, cabal new-build, and nix.
But, realistically, we can assume GHC >= 8.2.2, and for the cabal builds, cabal-install >= 2.4.1.0

@alanz
Copy link
Collaborator Author

alanz commented Jan 14, 2019

@Avi-D-coder
Copy link
Collaborator

How do the .hie files affect this? Will ghc-mod still be needed?

@alanz
Copy link
Collaborator Author

alanz commented Jan 14, 2019

@Avi-D-coder The .hie files are unrelated. This is about being able to load a module under development, so that we can get information out of it.

This also includes managed a partly-edited but unsaved file.

@lorenzo
Copy link
Collaborator

lorenzo commented Jan 14, 2019

What would be your preferred solution @alanz ?

@alanz
Copy link
Collaborator Author

alanz commented Jan 14, 2019

@lorenzo I would rather keep an open mind at this stage, tbh.

@lukel97
Copy link
Collaborator

lukel97 commented Jan 16, 2019

What exactly would the first option (getting cabal-helper/ghc-mod onto Hackage) involve? Would it be the case that we would have the HIE forks as a separate package on Hackage a-la cabal-helper-hie ghc-mod-hie?

@alanz
Copy link
Collaborator Author

alanz commented Jan 16, 2019

@bubba Ideally it would involve getting them to a point where @DanielG would merge the changes and publish.

But I am concerned about his available time for this.

@shmish111
Copy link

I am very interested in this issue as I have been unable to get ghc-mod working on my OSX laptop (or a windows laptop previously) and I have tried many times over the last 3 years, including using nix.

Have you looked at https://github.com/google/haskell-indexer I doubt is has everything that is needed but it should provide a strong foundation for all the features that require static analysis. Additionally it doesn't load the whole index into memory and it is designed to be able to work with very large projects, something I feel ghc-mod or any tool that creates an in-memory index would struggle with.

And finally, I would really like to get this to work with https://github.com/tweag/rules_haskell so it would be great if HIE didn't require cabal, rather cabal and stack features should be optional, as would features for Bazel or Shake or any other build system.

@alanz
Copy link
Collaborator Author

alanz commented Jan 29, 2019

it would be great if HIE didn't require cabal, rather cabal and stack features should be optional, as would features for Bazel or Shake or any other build system.

That is an interesting split point, and probably makes sense, given that in hie we basically want to know the shape of a project, and then load files as needed into GHC, regardless of how the specific config came about.

And I understand this is one of the great strengths of ghcid, it basically piggy-backs on ghci, so can work in any context where it is possible to start it up.

@eskimor
Copy link

eskimor commented Jan 30, 2019

I think making use of ghci together with this https://ghc.haskell.org/trac/ghc/ticket/15461 would improve/simplify things a lot! Also this would probably open the possibility for an obelisk project for example to re-use the ghci session ob run is using for hie, so I don't need to tell hie how to spawn a proper ghci session for my project and I don't end up having two ghci sessions running, which at best are wasting resources and worst might even interfere with each other.

@lorenzo
Copy link
Collaborator

lorenzo commented Jan 30, 2019

@alanz would it be feasible to propose https://ghc.haskell.org/trac/ghc/ticket/15461 as a summer of code project? Sounds like it could be really handy for us

@mpickering
Copy link
Collaborator

mpickering commented Feb 24, 2019

I have a plan which will allow implementing HIE support for bazel, obelisk etc.

@shmish111 @eskimor Can you provide me some simple sample projects which I can use to test my implementation? (Nix compatible instructions preferable)

@DanielG
Copy link
Collaborator

DanielG commented Feb 24, 2019

@mpickering could you elaborate on your plan a bit? You see, I also have a plan which means we might be duplicating effort :)

@eskimor
Copy link

eskimor commented Feb 25, 2019

@mpickering awesome! :-) That's fortunately very easy as obelisk comes with an example project.

Just install obelisk as described here, then create some empty directory and run ob init from within - you will get very small (and useless) example web service. Start the ghcid session with ob run.

@alanz alanz modified the milestones: 2019-02, 2019-03 Mar 2, 2019
@mpickering mpickering mentioned this issue Mar 10, 2019
4 tasks
@alanz alanz modified the milestones: 2019-03, 2019-04 Apr 6, 2019
@alanz alanz modified the milestones: 2019-04, 2019-05 May 4, 2019
@alanz alanz modified the milestones: 2019-05, 2019-06 Jun 1, 2019
@alanz alanz modified the milestones: 2019-06, Some time Jul 7, 2019
@lukel97
Copy link
Collaborator

lukel97 commented Dec 20, 2019

Done in #1126

@lukel97 lukel97 closed this as completed Dec 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants