-
-
Notifications
You must be signed in to change notification settings - Fork 369
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
Probe-tools: Print stack ghc version #3093
Probe-tools: Print stack ghc version #3093
Conversation
Yeah, this looks nice! Do we think "stack ghc" is obvious enough? I kind of want to say "ghc provided by stack in this project" but that's a bit long. |
I like the idea in general, but I am worried That's why we run it in silent mode in hie-bios: https://github.com/haskell/hie-bios/blob/master/src/HIE/Bios/Cradle.hs#L817 Also, one more issue, since we might trigger a download in this case, hls-wrapper might freeze up with no feedback, since we call it before finding the cradle type: https://github.com/haskell/haskell-language-server/blob/master/exe/Wrapper.hs#L137 And if the command fails for any reason (e.g. can't install GHC because we are out of space), then we won't launch the hls-wrapper lsp service to report errors to the user and it will just crash. |
Thanks for the feedback @fendor . These definitely are valid points to consider. You mentioned standard output could kill the language server. Is the output and execution of Update: Okay, I think that's the case in the second reference you posted. |
No, it is not relevant, but truly great for debugging, since you tell people: Copy-paste the logs from VSCode (or editor of choice) and link them. I suppose the issue also asks you to paste |
What do you have in mind as a solution to the mentioned problems?
To repeat the core issue that should be addressed: For stack projects users might post the output of |
I am unfortunately not entirely sure how we can solve the issue here. I can imagine, there are multiple valid solutions. However, I personally like your first/fourth suggestion. We can use |
The more I start digging into the current state, the more I've the feeling I'm trying to reinvent something that already exists 😆 On hls launch there is a lot of debug output, including the ghc version of the cradle. Maybe it only needs to be moved around to be included in probe tools instead? And there even is So reusing already existing functionality seems to make sense, but comes at the cost of adding or depending on the whole cradle business to the simple implementation of |
You are not strictly speaking re-inventing something, we are trying to show debug information at a stage, where we don't know the details yet. The purpose of The cradle type shows you, what has been chosen. Once we know that, we can print more specific information, such as stack ghc version. Before we know we are using a stack-cradle, it actually doesn't make sense at all to print the stack ghc version. Thus, I think it makes more sense to print cradle specific debug information. Then we have the following stages:
Edit: similar to what your current code does in Wrapper.hs. |
I have to admit that I didn't understand and know of the duplication and differences between From what I've seen in the implementation it seems that This commit would use the existing - therefore safer way - to ask for the ghc version the cradle is using: d74f009 What do you think of it? Demo
|
I think the idea works well |
The ghc version on the $PATH is often not relevant for stack projects. The ghc version stack is using is printed in addition.
b04d7b5
to
f66e9e8
Compare
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.
LGTM, minor comments
Co-authored-by: fendor <[email protected]>
740cca9
to
6cfb608
Compare
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.
LGTM, thanks!
* Probe-tools: Print stack ghc version The ghc version on the $PATH is often not relevant for stack projects. The ghc version stack is using is printed in addition. * Probetools: cradle ghc version added to wrapper * Revert stack ghc changes to Ide.Main * Update exe/Wrapper.hs Co-authored-by: fendor <[email protected]> * Probe tools: Print version with padded spaces Addressing <haskell#3093 (comment)> Co-authored-by: fendor <[email protected]>
The ghc version on the $PATH is often not relevant for stack projects. The ghc version stack is using is printed in addition.
Example Output
Discussion
@michaelpj Followup to this comment to sketch the idea for a change. Do you have something like this change in mind?