@@ -170,7 +170,7 @@ with-code-cache test-code-cache:
170
170
171
171
out/Makefile : config.gypi common.gypi node.gyp \
172
172
deps/uv/uv.gyp deps/llhttp/llhttp.gyp deps/zlib/zlib.gyp \
173
- deps/simdutf/simdutf.gyp deps/ada/ada.gyp \
173
+ deps/simdutf/simdutf.gyp deps/ada/ada.gyp deps/libffi/libffi.gyp \
174
174
tools/v8_gypfiles/toolchain.gypi tools/v8_gypfiles/features.gypi \
175
175
tools/v8_gypfiles/inspector.gypi tools/v8_gypfiles/v8.gyp
176
176
$(PYTHON ) tools/gyp_node.py -f make
@@ -421,6 +421,30 @@ test/addons/.buildstamp: $(ADDONS_PREREQS) \
421
421
# TODO(bnoordhuis) Force rebuild after gyp update.
422
422
build-addons : | $(NODE_EXE ) test/addons/.buildstamp
423
423
424
+ FFI_BINDING_GYPS := \
425
+ $(filter-out test/ffi/??_* /binding.gyp, \
426
+ $(wildcard test/ffi/* /binding.gyp) )
427
+
428
+ FFI_BINDING_SOURCES := \
429
+ $(filter-out test/ffi/??_* /* .c, $(wildcard test/ffi/* /* .c) ) \
430
+ $(filter-out test/ffi/??_* /* .h, $(wildcard test/ffi/* /* .h) )
431
+
432
+ # Implicitly depends on $(NODE_EXE), see the build-ffi-tests rule for rationale.
433
+ # Depends on node-gyp package.json so that build-ffi-tests is (re)executed when
434
+ # node-gyp is updated as part of an npm update.
435
+ test/ffi/.buildstamp : $(ADDONS_PREREQS ) \
436
+ $(FFI_BINDING_GYPS ) $(FFI_BINDING_SOURCES )
437
+ @$(call run_build_addons,"$$PWD/test/ffi",$@ )
438
+
439
+ .PHONY : build-ffi-tests
440
+ # .buildstamp needs $(NODE_EXE) but cannot depend on it
441
+ # directly because it calls make recursively. The parent make cannot know
442
+ # if the subprocess touched anything so it pessimistically assumes that
443
+ # .buildstamp is out of date and need a rebuild.
444
+ # Just goes to show that recursive make really is harmful...
445
+ # TODO(bnoordhuis) Force rebuild after gyp update.
446
+ build-ffi-tests : | $(NODE_EXE ) test/ffi/.buildstamp
447
+
424
448
JS_NATIVE_API_BINDING_GYPS := \
425
449
$(filter-out test/js-native-api/??_* /binding.gyp, \
426
450
$(wildcard test/js-native-api/* /binding.gyp) )
@@ -492,7 +516,10 @@ clear-stalled:
492
516
fi
493
517
494
518
.PHONY : test-build
495
- test-build : | all build-addons build-js-native-api-tests build-node-api-tests
519
+ test-build : | all build-addons build-ffi-tests build-js-native-api-tests build-node-api-tests
520
+
521
+ .PHONY : test-build-ffi
522
+ test-build-ffi : all build-ffi-tests
496
523
497
524
.PHONY : test-build-js-native-api
498
525
test-build-js-native-api : all build-js-native-api-tests
@@ -513,7 +540,7 @@ test-all-suites: | clear-stalled test-build bench-addons-build doc-only ## Run a
513
540
$(PYTHON ) tools/test.py $(PARALLEL_ARGS ) --mode=$(BUILDTYPE_LOWER ) test/*
514
541
515
542
JS_SUITES ?= default
516
- NATIVE_SUITES ?= addons js-native-api node-api
543
+ NATIVE_SUITES ?= addons ffi js-native-api node-api
517
544
# CI_* variables should be kept synchronized with the ones in vcbuild.bat
518
545
CI_NATIVE_SUITES ?= $(NATIVE_SUITES ) benchmark
519
546
CI_JS_SUITES ?= $(JS_SUITES ) pummel
@@ -527,7 +554,7 @@ endif
527
554
# Build and test addons without building anything else
528
555
# Related CI job: node-test-commit-arm-fanned
529
556
test-ci-native : LOGLEVEL := info
530
- test-ci-native : | benchmark/napi/.buildstamp test/addons/.buildstamp test/js-native-api/.buildstamp test/node-api/.buildstamp
557
+ test-ci-native : | benchmark/napi/.buildstamp test/addons/.buildstamp test/ffi/.buildstamp test/ js-native-api/.buildstamp test/node-api/.buildstamp
531
558
$(PYTHON ) tools/test.py $(PARALLEL_ARGS ) -p tap --logfile test.tap \
532
559
--mode=$(BUILDTYPE_LOWER ) --flaky-tests=$(FLAKY_TESTS ) \
533
560
$(TEST_CI_ARGS ) $(CI_NATIVE_SUITES )
@@ -549,7 +576,7 @@ test-ci-js: | clear-stalled
549
576
.PHONY : test-ci
550
577
# Related CI jobs: most CI tests, excluding node-test-commit-arm-fanned
551
578
test-ci : LOGLEVEL := info
552
- test-ci : | clear-stalled bench-addons-build build-addons build-js-native-api-tests build-node-api-tests doc-only
579
+ test-ci : | clear-stalled bench-addons-build build-addons build-ffi-tests build- js-native-api-tests build-node-api-tests doc-only
553
580
out/Release/cctest --gtest_output=xml:out/junit/cctest.xml
554
581
$(PYTHON ) tools/test.py $(PARALLEL_ARGS ) -p tap --logfile test.tap \
555
582
--mode=$(BUILDTYPE_LOWER ) --flaky-tests=$(FLAKY_TESTS ) \
@@ -664,6 +691,16 @@ test-js-native-api-clean:
664
691
$(RM ) -r test/js-native-api/* /build
665
692
$(RM ) test/js-native-api/.buildstamp
666
693
694
+ .PHONY : test-ffi
695
+ test-ffi : test-build-ffi
696
+ $(PYTHON ) tools/test.py $(PARALLEL_ARGS ) --mode=$(BUILDTYPE_LOWER ) ffi
697
+
698
+ .PHONY : test-ffi-clean
699
+ .NOTPARALLEL : test-ffi-clean
700
+ test-ffi-clean :
701
+ $(RM ) -r test/ffi/* /build
702
+ $(RM ) test/ffi/.buildstamp
703
+
667
704
.PHONY : test-node-api
668
705
test-node-api : test-build-node-api
669
706
$(PYTHON ) tools/test.py $(PARALLEL_ARGS ) --mode=$(BUILDTYPE_LOWER ) node-api
@@ -675,7 +712,7 @@ test-node-api-clean:
675
712
$(RM ) test/node-api/.buildstamp
676
713
677
714
.PHONY : test-addons
678
- test-addons : test-build test-js-native-api test-node-api
715
+ test-addons : test-build test-ffi test- js-native-api test-node-api
679
716
$(PYTHON ) tools/test.py $(PARALLEL_ARGS ) --mode=$(BUILDTYPE_LOWER ) addons
680
717
681
718
.PHONY : test-addons-clean
@@ -684,6 +721,7 @@ test-addons-clean:
684
721
$(RM ) -r test/addons/?? _* /
685
722
$(RM ) -r test/addons/* /build
686
723
$(RM ) test/addons/.buildstamp test/addons/.docbuildstamp
724
+ $(MAKE ) test-ffi-clean
687
725
$(MAKE ) test-js-native-api-clean
688
726
$(MAKE ) test-node-api-clean
689
727
0 commit comments