Don't call icacls when cross-compiling on non-Windows hosts
Change-Id: I658bf36195cbf39bb09166b19fa9643fbbed68ef Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1932091 Reviewed-by: Thomas Anderson <thomasanderson@chromium.org> Commit-Queue: Joe Mason <joenotcharles@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#718845} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: ead882878e27646844a9483a6221b128b223f72c
This commit is contained in:
Родитель
52927f5a11
Коммит
e2349a5c52
|
@ -35,6 +35,10 @@ MSVC_TOOLSET_VERSION = {
|
|||
'2017' : 'VC141',
|
||||
}
|
||||
|
||||
def _HostIsWindows():
|
||||
"""Returns True if running on a Windows host (including under cygwin)."""
|
||||
return sys.platform in ('win32', 'cygwin')
|
||||
|
||||
def SetEnvironmentAndGetRuntimeDllDirs():
|
||||
"""Sets up os.environ to use the depot_tools VS toolchain with gyp, and
|
||||
returns the location of the VC runtime DLLs so they can be copied into
|
||||
|
@ -49,7 +53,7 @@ def SetEnvironmentAndGetRuntimeDllDirs():
|
|||
bool(int(os.environ.get('DEPOT_TOOLS_WIN_TOOLCHAIN', '1')))
|
||||
# When running on a non-Windows host, only do this if the SDK has explicitly
|
||||
# been downloaded before (in which case json_data_file will exist).
|
||||
if ((sys.platform in ('win32', 'cygwin') or os.path.exists(json_data_file))
|
||||
if ((_HostIsWindows() or os.path.exists(json_data_file))
|
||||
and depot_tools_win_toolchain):
|
||||
if ShouldUpdateToolchain():
|
||||
if len(sys.argv) > 1 and sys.argv[1] == 'update':
|
||||
|
@ -225,6 +229,7 @@ def _CopyRuntimeImpl(target, source, verbose=True):
|
|||
os.chmod(target, stat.S_IWRITE | stat.S_IREAD)
|
||||
# Sometimes BUILTIN/Administrators and SYSTEM doesn't grant the access
|
||||
# to the file on bots. crbug.com/956016.
|
||||
if _HostIsWindows(): # Skip if icacls is not available.
|
||||
subprocess.call(['icacls', target, '/grant', 'Administrators:f'])
|
||||
subprocess.call(['icacls', target, '/grant', 'SYSTEM:f'])
|
||||
|
||||
|
@ -472,8 +477,7 @@ def Update(force=False, no_download=False):
|
|||
|
||||
depot_tools_win_toolchain = \
|
||||
bool(int(os.environ.get('DEPOT_TOOLS_WIN_TOOLCHAIN', '1')))
|
||||
if ((sys.platform in ('win32', 'cygwin') or force) and
|
||||
depot_tools_win_toolchain):
|
||||
if (_HostIsWindows() or force) and depot_tools_win_toolchain:
|
||||
import find_depot_tools
|
||||
depot_tools_path = find_depot_tools.add_depot_tools_to_path()
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче