3131import jsrun
3232from tools .shared import TEMP_DIR , EMCC , EMXX , DEBUG , EMCONFIGURE , EMCMAKE
3333from tools .shared import EMSCRIPTEN_TEMP_DIR
34- from tools .shared import EM_BUILD_VERBOSE
3534from tools .shared import get_canonical_temp_dir , try_delete , path_from_root
36- from tools .utils import MACOS , WINDOWS , read_file , read_binary , write_file , write_binary
35+ from tools .utils import MACOS , WINDOWS , read_file , read_binary , write_file , write_binary , exit_with_error
3736from tools import shared , line_endings , building , config
3837
3938logger = logging .getLogger ('common' )
6059EMTEST_REBASELINE = None
6160EMTEST_FORCE64 = None
6261
62+ # Verbosity level control for subprocess calls to configure + make.
63+ # 0: disabled.
64+ # 1: Log stderr of configure/make.
65+ # 2: Log stdout and stderr configure/make. Print out subprocess commands that were executed.
66+ # 3: Log stdout and stderr, and pass VERBOSE=1 to CMake/configure/make steps.
67+ EMTEST_BUILD_VERBOSE = int (os .getenv ('EMTEST_BUILD_VERBOSE' , '0' ))
68+ if 'EM_BUILD_VERBOSE' in os .environ :
69+ exit_with_error ('EM_BUILD_VERBOSE has been renamed to EMTEST_BUILD_VERBOSE' )
70+
6371# Special value for passing to assert_returncode which means we expect that program
6472# to fail with non-zero return code, but we don't care about specifically which one.
6573NON_ZERO = - 1
@@ -1765,8 +1773,8 @@ def build_library(name,
17651773 try :
17661774 with open (os .path .join (project_dir , 'configure_out' ), 'w' ) as out :
17671775 with open (os .path .join (project_dir , 'configure_err' ), 'w' ) as err :
1768- stdout = out if EM_BUILD_VERBOSE < 2 else None
1769- stderr = err if EM_BUILD_VERBOSE < 1 else None
1776+ stdout = out if EMTEST_BUILD_VERBOSE < 2 else None
1777+ stderr = err if EMTEST_BUILD_VERBOSE < 1 else None
17701778 shared .run_process (configure , env = env , stdout = stdout , stderr = stderr ,
17711779 cwd = project_dir )
17721780 except subprocess .CalledProcessError :
@@ -1787,14 +1795,14 @@ def open_make_out(mode='r'):
17871795 def open_make_err (mode = 'r' ):
17881796 return open (os .path .join (project_dir , 'make.err' ), mode )
17891797
1790- if EM_BUILD_VERBOSE >= 3 :
1798+ if EMTEST_BUILD_VERBOSE >= 3 :
17911799 make_args += ['VERBOSE=1' ]
17921800
17931801 try :
17941802 with open_make_out ('w' ) as make_out :
17951803 with open_make_err ('w' ) as make_err :
1796- stdout = make_out if EM_BUILD_VERBOSE < 2 else None
1797- stderr = make_err if EM_BUILD_VERBOSE < 1 else None
1804+ stdout = make_out if EMTEST_BUILD_VERBOSE < 2 else None
1805+ stderr = make_err if EMTEST_BUILD_VERBOSE < 1 else None
17981806 shared .run_process (make + make_args , stdout = stdout , stderr = stderr , env = env ,
17991807 cwd = project_dir )
18001808 except subprocess .CalledProcessError :
0 commit comments