Skip to content

Commit

Permalink
windows_cc_configure.bzl: Clear PATH, INCLUDE, LIB envs
Browse files Browse the repository at this point in the history
This change prevents leaking irrelevant envs to C++ actions.
Before running VCVARSALL.BAT, we set
    PATH=<system root>
    INCLUDE=
    LIB=

See #3500

Change-Id: I767a36a3be3c8c01ad5cac2a7762edd34047e1bf
PiperOrigin-RevId: 164242012
  • Loading branch information
meteorcloudy authored and dslomov committed Aug 4, 2017
1 parent 49463f6 commit 8879b48
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/cpp/windows_cc_configure.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ def _find_env_vars(repository_ctx, vc_path):
"@echo off\n" +
"call \"" + vcvarsall + "\" amd64 > NUL \n" +
"echo PATH=%PATH%,INCLUDE=%INCLUDE%,LIB=%LIB% \n", True)
env = _add_system_root(repository_ctx, repository_ctx.os.environ)
env = _add_system_root(repository_ctx,
{"PATH": "", "INCLUDE": "", "LIB": ""})
envs = execute(repository_ctx, ["./get_env.bat"], environment=env).split(",")
env_map = {}
for env in envs:
Expand Down

0 comments on commit 8879b48

Please sign in to comment.