31
31
import jsrun
32
32
from tools .shared import TEMP_DIR , EMCC , EMXX , DEBUG , EMCONFIGURE , EMCMAKE
33
33
from tools .shared import EMSCRIPTEN_TEMP_DIR
34
- from tools .shared import EM_BUILD_VERBOSE
35
34
from 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
37
36
from tools import shared , line_endings , building , config
38
37
39
38
logger = logging .getLogger ('common' )
60
59
EMTEST_REBASELINE = None
61
60
EMTEST_FORCE64 = None
62
61
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
+
63
71
# Special value for passing to assert_returncode which means we expect that program
64
72
# to fail with non-zero return code, but we don't care about specifically which one.
65
73
NON_ZERO = - 1
@@ -1765,8 +1773,8 @@ def build_library(name,
1765
1773
try :
1766
1774
with open (os .path .join (project_dir , 'configure_out' ), 'w' ) as out :
1767
1775
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
1770
1778
shared .run_process (configure , env = env , stdout = stdout , stderr = stderr ,
1771
1779
cwd = project_dir )
1772
1780
except subprocess .CalledProcessError :
@@ -1787,14 +1795,14 @@ def open_make_out(mode='r'):
1787
1795
def open_make_err (mode = 'r' ):
1788
1796
return open (os .path .join (project_dir , 'make.err' ), mode )
1789
1797
1790
- if EM_BUILD_VERBOSE >= 3 :
1798
+ if EMTEST_BUILD_VERBOSE >= 3 :
1791
1799
make_args += ['VERBOSE=1' ]
1792
1800
1793
1801
try :
1794
1802
with open_make_out ('w' ) as make_out :
1795
1803
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
1798
1806
shared .run_process (make + make_args , stdout = stdout , stderr = stderr , env = env ,
1799
1807
cwd = project_dir )
1800
1808
except subprocess .CalledProcessError :
0 commit comments