Skip to content

Commit ebc3145

Browse files
authored
Rename EM_BUILD_VERBOSE -> EMTEST_BUILD_VERBOSE (#16904)
This environment variable is now only used by test code so I've moved it into tests/common.py and renamed it. Also, set EMTEST_BUILD_VERBOSE=2 in CI to get more information output.
1 parent 3c1bd95 commit ebc3145

File tree

5 files changed

+25
-22
lines changed

5 files changed

+25
-22
lines changed

.circleci/config.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ executors:
1212
- image: emscripten/emscripten-ci
1313
environment:
1414
LANG: "C.UTF-8"
15-
EMTEST_DETECT_TEMPFILE_LEAKS: "1"
1615
EMCC_CORES: "4"
1716
EMSDK_NOTTY: "1"
1817
EMTEST_WASI_SYSROOT: "~/wasi-sdk/wasi-sysroot"
18+
EMTEST_BUILD_VERBOSE: "2"
19+
EMTEST_DETECT_TEMPFILE_LEAKS: "1"
1920
mac:
2021
environment:
2122
EMSDK_NOTTY: "1"

ChangeLog.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@ See docs/process.md for more on how version tagging works.
2020

2121
3.1.11
2222
------
23-
- Bug fixes
23+
- The `EM_BUILD_VERBOSE` environment variable only effects test code these days
24+
and therefore was renamed to `EMTEST_BUILD_VERBOSE`.
2425

2526
3.1.10 - 05/02/2022
2627
-------------------
28+
- Bug fixes
2729

2830
3.1.9 - 04/21/2022
2931
------------------

tests/common.py

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,8 @@
3131
import jsrun
3232
from tools.shared import TEMP_DIR, EMCC, EMXX, DEBUG, EMCONFIGURE, EMCMAKE
3333
from tools.shared import EMSCRIPTEN_TEMP_DIR
34-
from tools.shared import EM_BUILD_VERBOSE
3534
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
3736
from tools import shared, line_endings, building, config
3837

3938
logger = logging.getLogger('common')
@@ -60,6 +59,15 @@
6059
EMTEST_REBASELINE = None
6160
EMTEST_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.
6573
NON_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:

tests/test_other.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@
2929
raise Exception('do not run this file directly; do something like: tests/runner other')
3030

3131
from tools.shared import try_delete, config
32-
from tools.shared import EMCC, EMXX, EMAR, EMRANLIB, PYTHON, FILE_PACKAGER, WINDOWS, EM_BUILD_VERBOSE
32+
from tools.shared import EMCC, EMXX, EMAR, EMRANLIB, PYTHON, FILE_PACKAGER, WINDOWS
3333
from tools.shared import CLANG_CC, CLANG_CXX, LLVM_AR, LLVM_DWARFDUMP, LLVM_DWP, EMCMAKE, EMCONFIGURE
3434
from common import RunnerCore, path_from_root, is_slow_test, ensure_dir, disabled, make_executable
3535
from common import env_modify, no_mac, no_windows, requires_native_clang, with_env_modify
3636
from common import create_file, parameterized, NON_ZERO, node_pthreads, TEST_ROOT, test_file
3737
from common import compiler_for, read_file, read_binary, EMBUILDER, require_v8, require_node
38-
from common import also_with_minimal_runtime, also_with_wasm_bigint
38+
from common import also_with_minimal_runtime, also_with_wasm_bigint, EMTEST_BUILD_VERBOSE
3939
from tools import shared, building, utils, deps_info, response_file
4040
import common
4141
import jsrun
@@ -655,13 +655,13 @@ def test_cmake(self, test_dir, output_file, cmake_args):
655655
if test_dir == 'target_html':
656656
env['EMCC_SKIP_SANITY_CHECK'] = '1'
657657
print(str(cmd))
658-
self.run_process(cmd, env=env, stdout=None if EM_BUILD_VERBOSE >= 2 else PIPE, stderr=None if EM_BUILD_VERBOSE >= 1 else PIPE)
658+
self.run_process(cmd, env=env, stdout=None if EMTEST_BUILD_VERBOSE >= 2 else PIPE, stderr=None if EMTEST_BUILD_VERBOSE >= 1 else PIPE)
659659

660660
# Build
661661
cmd = conf['build']
662-
if EM_BUILD_VERBOSE >= 3 and 'Ninja' not in generator:
662+
if EMTEST_BUILD_VERBOSE >= 3 and 'Ninja' not in generator:
663663
cmd += ['VERBOSE=1']
664-
self.run_process(cmd, stdout=None if EM_BUILD_VERBOSE >= 2 else PIPE)
664+
self.run_process(cmd, stdout=None if EMTEST_BUILD_VERBOSE >= 2 else PIPE)
665665
self.assertExists(tempdirname + '/' + output_file, 'building a cmake-generated Makefile failed to produce an output file %s!' % tempdirname + '/' + output_file)
666666

667667
# Run through node, if CMake produced a .js file.

tools/shared.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -675,14 +675,6 @@ def get_llvm_target():
675675
# file. TODO(sbc): We should try to reduce that amount we do here and instead
676676
# have consumers explicitly call initialization functions.
677677

678-
# Verbosity level control for any intermediate subprocess spawns from the compiler. Useful for internal debugging.
679-
# 0: disabled.
680-
# 1: Log stderr of subprocess spawns.
681-
# 2: Log stdout and stderr of subprocess spawns. Print out subprocess commands that were executed.
682-
# 3: Log stdout and stderr, and pass VERBOSE=1 to CMake configure steps.
683-
EM_BUILD_VERBOSE = int(os.getenv('EM_BUILD_VERBOSE', '0'))
684-
TRACK_PROCESS_SPAWNS = EM_BUILD_VERBOSE >= 3
685-
686678
set_version_globals()
687679

688680
CLANG_CC = os.path.expanduser(build_clang_tool_path(exe_suffix('clang')))

0 commit comments

Comments
 (0)