Homec4science

prepend path/to/phabricator/support/bin/ to $PATH

Authored by Angelos Evripiotis <jevripiotis@bloomberg.net> on Apr 3 2013, 21:49.

Description

prepend path/to/phabricator/support/bin/ to $PATH

Summary:
It's sometimes necessary to specify the paths to individual binaries
explicitly, e.g. a particular build of 'javelinsymbols' or a newer
version of git than is installed on your shared system.

By adding symlinks in the .../phabricator/support/bin/ directory you
can now spell these out using the file system.

Test Plan:
Ran on local Ubuntu VM:

.. add 'TEST' repo to diffusion ..
.. visit 127.0.01/diffusion/TEST - see ok ..

$ cd /opt
$ sudo sh -c 'echo "exit 1" > badgit'
$ sudo chmod +x /opt/badgit
$ sudo mkdir goodgit
$ sudo mv /usr/bin/git /opt/goodgit/

.. unset environment.append-paths ..
.. visit 127.0.01/diffusion/TEST - see error 'git: not found' ..
.. set environment.append-paths to /opt/goodgit/ ..
.. visit 127.0.01/diffusion/TEST - see ok ..

$ sudo ln -s /opt/badgit /usr/bin/git
.. visit 127.0.01/diffusion/TEST - see error 'error #1' ..
sudo ln -s /opt/goodgit/git web/phabricator/support/bin/git
.. visit 127.0.01/diffusion/TEST - see ok ..

.. unset environment.append-paths ..
.. visit 127.0.01/diffusion/TEST - see ok ..

$ sudo rm web/phabricator/support/bin/git
.. visit 127.0.01/diffusion/TEST - see error 'error #1' ..

$ sudo rm /usr/bin/git
$ sudo mv /opt/goodgit/git /usr/bin/
.. visit 127.0.01/diffusion/TEST - see ok ..

Note that 'DIRECTORY_SEPARATOR' was not used because apparently it's
portable and ok to just use '/'.
http://alanhogan.com/tips/php/directory-separator-not-necessary
(I'm pretty new to PHP so looking for guidance :)

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2378

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

Details

Committed
epriestley <git@epriestley.com>Apr 3 2013, 21:49
Pushed
aubortJan 31 2017, 17:16
Parents
rPHa13390a919a2: Flags on mobile, fix some filter-css
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHbfdce02689b7: prepend path/to/phabricator/support/bin/ to $PATH (authored by Angelos Evripiotis <jevripiotis@bloomberg.net>).Apr 3 2013, 21:49