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
Pass RTS arguments from the wrapper to HLS #2228
Conversation
Oops, this branch includes changes from a previous pull request that was already merged. I'm trying to fix it now. |
5aba9de
to
e9ea4f7
Compare
Okay, this is ready for review now. |
On IRC, glguy pointed out that there are RTS options that write to a file, and this will result in both binaries writing to the same file. That's unfortunate, but I cannot think of a better way to do this, given that we can't really prevent the haskell-language-server-wrapper binary from acting according to the RTS options it is passed. |
hmm what about create a dedicate option to bypass the rts options only to hls? or a generic option --server-args to pass it to hls? |
I guess I don't think it's worth the complexity. I'm tempted to just say we should document the issue and leave it alone. There are lots of good RTS options to pass along, and only a few bad ones. I think the case that someone is trying to produce runtime statistics to a file is rare enough that we can just warn them not to use the wrapper. Note that even if we fix this for command line args, the same problem will exist with the |
Threre is a test fail which might be related with this change:
will rerun just in case |
I don't think it's related, and it looks like it's passing now. |
I believe a more robust solution here is to use |
Currently, RTS arguments are not passed along from the wrapper to HLS.
I have run into this lately where I'm running HLS on a development VM, and HLS growing its memory usage too far causes the VM to become inaccessible and need to be rebooted. I'd like to pass
+RTS -M10G
to the HLS process. But this argument is eaten by the wrapper script and not passed along.Fortunately, there is GHC.Environment.getFullArgs, which includes RTS arguments in the list. I believe that HLS should be using that instead of getArgs.