Skip to content
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

Log stderr of stack exec ghc for better feedback #254

Merged
merged 3 commits into from
Mar 25, 2021

Conversation

fendor
Copy link
Collaborator

@fendor fendor commented Oct 1, 2020

From Freenode #haskell-ide-engine we had a line such as:

Failed to get project GHC version:CradleError {cradleErrorDependencies = [], cradleErrorExitCode = ExitFailure 1, cradleErrorStderr = ["Error when calling stack exec --silent ghc -- --numeric-version","",""]}

and you have to run stack exec --silent ghc -- --numeric-version to actually see the error.
The error was then:

Cannot open: Disk quota exceeded

If this was included in the above log line, it would have been easier to debug.

Smoke testing showed that --silent is not necessary as such log output was sent to stderr.

@fendor fendor requested a review from jneira October 1, 2020 16:58
@fendor
Copy link
Collaborator Author

fendor commented Oct 1, 2020

cc @bubba

@lukel97
Copy link
Contributor

lukel97 commented Oct 1, 2020

Can you test this with a clean .stack-work directory/no stack ghc installed for that version? I think I remember adding --silent because stack was pumping out progress information to stdout

@jneira
Copy link
Member

jneira commented Oct 1, 2020

Mmm and what about stack --silent setup && stack exec ghc --numeric-version (translated to haskell)?

@fendor
Copy link
Collaborator Author

fendor commented Oct 1, 2020

I will check!

@jneira
Copy link
Member

jneira commented Mar 21, 2021

@fendor your last push did not include the suggestion, did you have the opportunity of checking it?

@fendor
Copy link
Collaborator Author

fendor commented Mar 21, 2021

@jneira You are right, I basically forgot about this pr

@fendor fendor force-pushed the stack-log-stderr branch from 8106dfc to c2260cd Compare March 22, 2021 15:24
@fendor fendor force-pushed the stack-log-stderr branch from c2260cd to 9a6f324 Compare March 22, 2021 17:12
@fendor
Copy link
Collaborator Author

fendor commented Mar 22, 2021

So, rebased this PR. I tested locally and CI is doing something similar, I think this PR is safe as it is

@jneira
Copy link
Member

jneira commented Mar 22, 2021

@bubba noted above

Can you test this with a clean .stack-work directory/no stack ghc installed for that version? I think I remember adding --silent because stack was pumping out progress information to stdout

Iirc we wanted to avoid the output from downloading the ghc to fix some issue in hls-wrapper i cant find right nowhaskell/haskell-language-server#242 (hence the suggestion stack --silent setup && stack exec ghc --numeric-version)

@fendor
Copy link
Collaborator Author

fendor commented Mar 23, 2021

@jneira Right, but I experimented locally with it again, with a completely fresh stack project (e.g. no .stack-work and no ~/.stack folder) and everything seemed to work fine. You are still in favour of executing two commands (just to be sure)?

EDIT, after reading the recently linked Issue, I agree, we should use the two commands.

@fendor fendor force-pushed the stack-log-stderr branch from cac4a3c to 65f409d Compare March 23, 2021 09:56
@fendor
Copy link
Collaborator Author

fendor commented Mar 23, 2021

@jneira ready for review

Copy link
Member

@jneira jneira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, many thanks!

@fendor fendor merged commit 84d4c37 into haskell:master Mar 25, 2021
fendor added a commit to fendor/hie-bios that referenced this pull request Aug 30, 2021
* Log stderr of `stack exec ghc` for better feedback

* Execute `stack setup` on its own

* Add changes to ChangeLog

(cherry picked from commit 84d4c37)
fendor added a commit to fendor/hie-bios that referenced this pull request Aug 30, 2021
* Log stderr of `stack exec ghc` for better feedback

* Execute `stack setup` on its own

* Add changes to ChangeLog

(cherry picked from commit 84d4c37)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants