Setting up HLS on macOS for plutus development

Hey folks!

Right now I’m participating in Plutus Pioneer Program and enjoying it so far!
To make exercises and follow the lectures, I want to setup my editor for haskell/plutus development, which includes setting up the haskell-language-server. And I’m having troubles with it :slight_smile:

  1. Usign haskell-language-server provided from nix-shell.
    If I setup nix-shell from plutus repo I get haskell-language-server there. But it doesn’t work on macOS due to problems with dynamic linking. Since HLS binary provided in nix-shell is compiled without dynamic linking, it just crashes when I try to use it for writing Plutus contracts.
  2. Being unable to use HLS from nix-shell, I deviced to build it from source with dynamic linking support. For this I haven’t used anything from nix-shell, I just installed latest version of ghc system-wide and used it. HLS started to work but it reports different errors of kind Error: Reference to a name which is not a local, a builtin, or an external INLINABLE function. It doesn’t prevent from using HLS but it is very annoying.

Considering all the above I have several questions:

  1. For writing Plutus smart contracts, do we need to use nix-shell from plutus repo and GHC of specific version provided there?
  2. If answer for the first question is YES, how can I build hls of right version with right version GHC?
  3. If answer for the first question is NO, how can I resolve the type of errors mentioned above? Steps described here don’t work for me.

Please help a pioneer to start adopting this amazing tech :slight_smile:
Thanks in advance!

3 Likes

This issue might be related …