Homec4science

Add setup checks for the availability of 'which' and 'diff' binaries

Authored by epriestley <git@epriestley.com> on May 23 2013, 23:42.

Description

Add setup checks for the availability of 'which' and 'diff' binaries

Summary:
Spent an hour or two helping a user figure this out. Make sure I never do that again.

If the webserver is configured with an empty or bogus PATH, binaries like 'which' and 'diff' (and 'git', and 'svn', etc.) may not be available. In most cases, this is fine, because we get an error like "sh: whatever-command not found", which is obvious to diagnose.

In the case of 'diff', we don't get this, because 'diff' is expected to exit with a nonzero code for differing files -- so we interpret the "sh: whatever-command not found" as "files differ" and then try to parse the empty output.

Explicitly check for 'which' (on Windows, 'where') and 'diff' during setup (I plan to refine the behavior around 'git', 'svn' and 'hg' at some point, but this is less pressing since the errors are trivial to support).

Test Plan: Faked failures on all modes, verified setup warnings look reasonable.

Reviewers: btrahan, chad

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D6008

Details

Committed
epriestley <git@epriestley.com>May 23 2013, 23:42
Pushed
aubortJan 31 2017, 17:16
Parents
rPH40680e459f44: Add a basic multipage form
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHe591ef4db9aa: Add setup checks for the availability of 'which' and 'diff' binaries (authored by epriestley <git@epriestley.com>).May 23 2013, 23:42