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

runGit fails when git is not on path #7

Closed
dbaynard opened this issue Nov 20, 2018 · 2 comments
Closed

runGit fails when git is not on path #7

dbaynard opened this issue Nov 20, 2018 · 2 comments

Comments

@dbaynard
Copy link

dbaynard commented Nov 20, 2018

This is from stack:

Exception when trying to run compile-time code:
        git: readCreateProcessWithExitCode: runInteractiveProcess: exec: does not exist (No such file or directory)
      Code: tGitInfoCwdTry

githash/src/GitHash.hs

Lines 184 to 189 in c3d3859

runGit root args = do
let cp = (proc "git" args) { cwd = Just root }
(ec, out, err) <- readCreateProcessWithExitCode cp ""
case ec of
ExitSuccess -> return $ Right out
ExitFailure _ -> return $ Left $ GHEGitRunFailed root args ec out err

It looks like readCreateProcessWithExitCode is throwing an exception when it can't find git. It would help to say that explicitly — perhaps by catching and rethrowing with a better error message?

Edit: This needs to be handled so tGitInfoCwdTry doesn't throw an exception.

Related: commercialhaskell/stack#4364

@dbaynard dbaynard changed the title runGit fails with confusing error message when git is not on path runGit fails when git is not on path Nov 20, 2018
snoyberg added a commit that referenced this issue Nov 20, 2018
@snoyberg
Copy link
Owner

This should be addressed by 48f0c95, I'll drop a comment on the Stack issue. Thanks for clarifying 👍

@snoyberg
Copy link
Owner

I've made a release with the new fixes, closing.

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

No branches or pull requests

2 participants