chapel icon indicating copy to clipboard operation
chapel copied to clipboard

Improve Mason error when git is missing

Open jabraham17 opened this issue 1 year ago • 2 comments

Improves the error thrown by Mason when git is missing. Prior to this PR, all that would be thrown was "Internal mason error", which is not helpful.

PR also includes a bonus typo fix in the docs for Subprocess

Checked that the test for this error message passes

[Reviewed by @benharsh]

jabraham17 avatar May 16 '24 23:05 jabraham17

Do we not have a way of detecting that git is totally unavailable, such that we can say that directly? To me, these messages suggest that the sub-command of git failed, rather than git not existing.

benharsh avatar May 20 '24 22:05 benharsh

Do we not have a way of detecting that git is totally unavailable, such that we can say that directly?

The best way in Chapel code I could come up with was running a loop over all directories in PATH (as returned by getenv) and see if git exists in any of them. This felt overly heavy handed to me.

Another slightly cleaner alternative is to have spawn(["which", "git"]), but that's less portable as not all systems have which installed by default

jabraham17 avatar May 20 '24 23:05 jabraham17