-
Notifications
You must be signed in to change notification settings - Fork 205
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
Add da-hls helper #13853
Add da-hls helper #13853
Conversation
Maybe try playing around with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I'd really like to see this working!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look reasonable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, thank you!
current status
@hls-exe//haskell-language-server
builds successfully, and usingda-hls
as the language server executable works fine for//compiler/damlc:damlc@ghci
and its dependencies. That is, it doesn't work for test files yet. A crude way to work around this is to change//compiler/damlc:damlc@ghci
in.hie-bios
to the bazel target that includes the file of interest. I think the approach mentioned in tweag/rules_haskell#1489 might allow us to have a working hls for any.hs
file in the repo without changing.hie-bios
, but I'd rather do that later in a separate PR.The linker errors from earlier are sidestepped by simply removing the following lines from the output of
.hie-bios
,I'm not sure how to justify it but it seems to work. My guess is that attempting to run code that uses these libs, for instance by calling a function from
zlib
in anhls-eval-plugin
comment (-- >>>
), will crash the server, but that's unlikely compared to the other hls use cases.Finally, I managed to fix the
Could not find module
errors by usingsrc_strip_prefix
inda_haskell_library
s to remove any prefixes (e.g.src
orlib
).previously
@hls-exe//haskell-language-server
builds successfully, but actually usingda-hls
as the language server executable results in a bunch of errors like this one:I tried defining a
cc_library
libz-dyn
in3rdparty/c/zlib.BUILD
, identical tolibz
except withlinkstatic = False
, while removing the linefrom the output of
.hie-bios
, but then the errors referred tolibmerged_cbits.a
:I tried to exclude those by removing the following lines from the output of
.hie-bios
,After that, all the remaining errors are bogus
Could not find module
errors for modules which do exist. At first I thought this was related to generated.hs
files, for instanceCom.Daml.DamlLfDev.DamlLf1
, but that one is fine. The problem seems to be with some modules that import other modules from the same package; modules that only import modules from other packages work fine. Still, there does seem to be a relation with the generated modules because packages without generated module appear to work entirely. In turn, that's probably an effect of just dropping the libraries, but I don't know how to force hls to use them dynamically.