Homec4science

Explicitly pass PHABRICATOR_ENV and PHABRICATOR_INSTANCE to subprocesses

Authored by epriestley <git@epriestley.com> on Jan 5 2017, 23:29.

Description

Explicitly pass PHABRICATOR_ENV and PHABRICATOR_INSTANCE to subprocesses

Summary:
Fixes T12070. Ref T12071. See T12071 for discussion.

D17100 changed things so that bin/repository gets an explicit TERM=dumb. As a side effect, this threw away the rest of the environment for installs with no "E" in variables_order. In particular, this means that "PHABRICATOR_ENV" may be dropped.

Since we're churning a lot and it's already Thursday, just patch this for now by reading "PHABRICATOR_ENV" out of the environment. I'll pursue more ambitious changes to fix this correctly after master promotes.

Test Plan:

  • Patched Phabricator to log which PHABRICATOR_ENV it was reading to /tmp/env.log during startup.
  • Set variables_order to "GPCS" (no "E").
  • Ran PHABRICATOR_ENV=custom/porcupine ./bin/phd start.
    • Before patch: bin/repository subprocess lauched with no PHABRICATOR_ENV.
    • After patch: bin/repository subprocess gets PHABRICATOR_ENV correctly.

I also fiddled around with trying to fix this "right" without requiring config changes, but couldn't find or google anything that lets us rebuild $_ENV if variables_order is whack.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12071, T12070

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

Details

Committed
epriestley <git@epriestley.com>Jan 5 2017, 23:48
Pushed
aubortMar 17 2017, 12:03
Parents
rPHU5ac2ca121489: Don't let stemming reduce a word beneath 3 characters
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHUc5848b71c10f: Explicitly pass PHABRICATOR_ENV and PHABRICATOR_INSTANCE to subprocesses (authored by epriestley <git@epriestley.com>).Jan 5 2017, 23:48