HTML5 - emscirpten on windows - attempting to reduce the "Acess is denied" incidents

#jira UE-76599  //UE4/Release-4.23 - Compile UE4Game HTML5 - clang++.exe --version failed: [Error 5] Access is denied
#rb none
#rnx

#ROBOMERGE-OWNER: ben.marsh
#ROBOMERGE-AUTHOR: nick.shin
#ROBOMERGE-SOURCE: CL 7113390 in //UE4/Release-4.23/... via CL 7113395
#ROBOMERGE-BOT: BUILD (Main -> Dev-Build) (v367-6836689)

[CL 7138141 by nick shin in Dev-Build branch]
This commit is contained in:
nick shin
2019-06-21 04:14:54 -04:00
parent 593d8fe665
commit 1799c610ef
2 changed files with 26 additions and 6 deletions
@@ -22,6 +22,8 @@ import subprocess
import sys
import tempfile
import platform
if sys.version_info < (2, 7, 12):
# EPIC EDIT start -- nick.shin 2019-05-29 -- UE-75005
# print('emscripten required python 2.7.12 or above', file=sys.stderr)
@@ -403,7 +405,11 @@ def expected_llvm_version():
def get_clang_version():
global actual_clang_version
if actual_clang_version is None:
proc = check_call([CLANG, '--version'], stdout=PIPE)
# EPIC EDIT start -- nick.shin 2019-06-20 -- UE-75306 UE-76260 UE-76599
# python on windows is sometimes having a problem getting back to this when the call has already terminated
# proc = check_call([CLANG, '--version'], stdout=PIPE)
proc = check_call([CLANG, '--version'], stdout=PIPE, check=False)
# EPIC EDIT end -- nick.shin 2019-06-20 -- UE-75306 UE-76260 UE-76599
m = re.search(r'[Vv]ersion\s+(\d+\.\d+)', proc.stdout)
actual_clang_version = m and m.group(1)
return actual_clang_version
@@ -455,8 +461,11 @@ def check_llvm():
return False
if not Settings.WASM_BACKEND:
clang_v = run_process([CLANG, '--version'], stdout=PIPE).stdout
clang_v = clang_v.splitlines()[0]
# EPIC EDIT start -- nick.shin 2019-06-14 -- UE-76260
# clang_v = run_process([CLANG, '--version'], stdout=PIPE).stdout
# clang_v = clang_v.splitlines()[0]
clang_v = get_clang_version()
# EPIC EDIT end -- nick.shin 2019-06-14 -- UE-76260
if '(emscripten ' not in clang_v:
logger.error('clang version does not appear to include fastcomp (%s)', str(clang_v))
return False
@@ -1414,8 +1423,11 @@ class Building(object):
def get_multiprocessing_pool():
if not Building.multiprocessing_pool:
# EPIC EDIT start -- nick.shin 2019-05-29 -- UE-75306
# cores = Building.get_num_cores()
cores = 1
if platform.system() == "Windows":
# reduce the incident of: "[Error 5] Access is denied" on Windows
cores = 1
else:
cores = Building.get_num_cores()
# EPIC EDIT end -- nick.shin 2019-05-29 -- UE-75306
if DEBUG:
# When in EMCC_DEBUG mode, only use a single core in the pool, so that
@@ -18,6 +18,8 @@ from . import ports
from . import shared
from tools.shared import check_call
import platform
stdout = None
stderr = None
@@ -29,7 +31,13 @@ def call_process(cmd):
def run_commands(commands):
cores = min(len(commands), shared.Building.get_num_cores())
# EPIC EDIT start -- nick.shin 2019-06-20 -- UE-76599
if platform.system() == "Windows":
# reduce the incident of: "[Error 5] Access is denied" on Windows
cores = 1
else:
cores = min(len(commands), shared.Building.get_num_cores())
# EPIC EDIT end -- nick.shin 2019-06-20 -- UE-76599
if cores <= 1:
for command in commands:
call_process(command)