Make landmines work on local builds too

Moves (some of) gyp environment setup out of gyp_chromium into separate
module, and shares that between gyp_chromium and landmines.py.

landmines.py is added as the first entry in DEPS hooks so that it can
clobber the entire build directory before running other hooks that
extract/generate into the build dir.

Reland with fix for ios, and for clean pull.

[email protected]
BUG=400011

Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=289099

Review URL: https://codereview.chromium.org/457003004

Cr-Commit-Position: refs/heads/master@{#289546}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@289546 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/build/vs_toolchain.py b/build/vs_toolchain.py
index b039ed0..735827e 100644
--- a/build/vs_toolchain.py
+++ b/build/vs_toolchain.py
@@ -30,6 +30,8 @@
   depot_tools_win_toolchain = \
       bool(int(os.environ.get('DEPOT_TOOLS_WIN_TOOLCHAIN', '1')))
   if sys.platform in ('win32', 'cygwin') and depot_tools_win_toolchain:
+    if not os.path.exists(json_data_file):
+      Update()
     with open(json_data_file, 'r') as tempf:
       toolchain_data = json.load(tempf)