Skip to content

Commit c8be90c

Browse files
danbevMylesBorins
authored andcommitted
build: for --enable-static, run only cctest
Currently when building with --enable-static and running the test target the following error will be reported: Building addon /node/test/addons/01_function_arguments/ env: ./node: No such file or directory make[1]: *** [test/addons/.buildstamp] Error 1 Note that this is with a clean build where no prior node executable was built. This commit suggests only running the cctest target when --enable-static is specified. PR-URL: #14892 Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Lance Ball <[email protected]>
1 parent 77dfa73 commit c8be90c

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

Makefile

+5
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,10 @@ v8:
192192
tools/make-v8.sh
193193
$(MAKE) -C deps/v8 $(V8_ARCH).$(BUILDTYPE_LOWER) $(V8_BUILD_OPTIONS)
194194

195+
ifeq ($(NODE_TARGET_TYPE),static_library)
196+
test: all
197+
$(MAKE) cctest
198+
else
195199
test: all
196200
$(MAKE) build-addons
197201
$(MAKE) build-addons-napi
@@ -200,6 +204,7 @@ test: all
200204
$(CI_JS_SUITES) \
201205
$(CI_NATIVE_SUITES)
202206
$(MAKE) lint
207+
endif
203208

204209
test-parallel: all
205210
$(PYTHON) tools/test.py --mode=release parallel -J

configure

+2
Original file line numberDiff line numberDiff line change
@@ -1419,6 +1419,8 @@ config = {
14191419
'BUILDTYPE': 'Debug' if options.debug else 'Release',
14201420
'USE_XCODE': str(int(options.use_xcode or 0)),
14211421
'PYTHON': sys.executable,
1422+
'NODE_TARGET_TYPE': variables['node_target_type'] if options.enable_static \
1423+
else '',
14221424
}
14231425

14241426
if options.prefix:

vcbuild.bat

+4-2
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ if /i "%1"=="download-all" set download_arg="--download=all"&goto arg-ok
107107
if /i "%1"=="ignore-flaky" set test_args=%test_args% --flaky-tests=dontcare&goto arg-ok
108108
if /i "%1"=="enable-vtune" set enable_vtune_arg=1&goto arg-ok
109109
if /i "%1"=="dll" set dll=1&goto arg-ok
110-
if /i "%1"=="static" set enable_static=1&goto arg-ok
110+
if /i "%1"=="static" set enable_static=1&goto arg-ok
111111
if /i "%1"=="no-NODE-OPTIONS" set no_NODE_OPTIONS=1&goto arg-ok
112112
if /i "%1"=="debug-http2" set debug_http2=1&goto arg-ok
113113
if /i "%1"=="debug-nghttp2" set debug_nghttp2=1&goto arg-ok
@@ -445,8 +445,9 @@ if "%config%"=="Debug" set test_args=--mode=debug %test_args%
445445
if "%config%"=="Release" set test_args=--mode=release %test_args%
446446
echo running 'cctest %cctest_args%'
447447
"%config%\cctest" %cctest_args%
448+
REM when building a static library there's no binary to run tests
449+
if defined enable_static goto test-v8
448450
call :run-python tools\test.py %test_args%
449-
goto test-v8
450451

451452
:test-v8
452453
if not defined custom_v8_test goto cpplint
@@ -494,6 +495,7 @@ set "localcppfilelist=%localcppfilelist% %1"
494495
goto exit
495496

496497
:jslint
498+
if defined enable_static goto exit
497499
if defined jslint_ci goto jslint-ci
498500
if not defined jslint goto exit
499501
if not exist tools\eslint\bin\eslint.js goto no-lint

0 commit comments

Comments
 (0)