Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,23 @@ else
build-sqlite-tests:
endif

FFI_BINDING_GYPS := $(wildcard test/ffi/*/binding.gyp)

FFI_BINDING_SOURCES := \
$(wildcard test/ffi/*/*.c)

# Implicitly depends on $(NODE_EXE), see the build-ffi-tests rule for rationale.
test/ffi/.buildstamp: $(ADDONS_PREREQS) \
$(FFI_BINDING_GYPS) $(FFI_BINDING_SOURCES)
@$(call run_build_addons,"$$PWD/test/ffi",$@)

.PHONY: build-ffi-tests
# .buildstamp needs $(NODE_EXE) but cannot depend on it
# directly because it calls make recursively. The parent make cannot know
# if the subprocess touched anything so it pessimistically assumes that
# .buildstamp is out of date and need a rebuild.
build-ffi-tests: | $(NODE_EXE) test/ffi/.buildstamp ## Build FFI tests.

.PHONY: clear-stalled
clear-stalled: ## Clear any stalled processes.
$(info Clean up any leftover processes but don't error if found.)
Expand All @@ -552,7 +569,7 @@ clear-stalled: ## Clear any stalled processes.
fi

.PHONY: test-build
test-build: | all build-addons build-js-native-api-tests build-node-api-tests build-sqlite-tests ## Build all tests.
test-build: | all build-addons build-js-native-api-tests build-node-api-tests build-sqlite-tests build-ffi-tests ## Build all tests.

.PHONY: test-build-js-native-api
test-build-js-native-api: all build-js-native-api-tests ## Build JS Native-API tests.
Expand Down Expand Up @@ -591,7 +608,7 @@ endif

# Related CI job: node-test-commit-arm-fanned
test-ci-native: LOGLEVEL := info ## Build and test addons without building anything else.
test-ci-native: | benchmark/napi/.buildstamp test/addons/.buildstamp test/js-native-api/.buildstamp test/node-api/.buildstamp test/sqlite/.buildstamp
test-ci-native: | benchmark/napi/.buildstamp test/addons/.buildstamp test/js-native-api/.buildstamp test/node-api/.buildstamp test/sqlite/.buildstamp test/ffi/.buildstamp
$(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap \
--mode=$(BUILDTYPE_LOWER) --flaky-tests=$(FLAKY_TESTS) \
$(TEST_CI_ARGS) $(CI_NATIVE_SUITES)
Expand All @@ -614,7 +631,7 @@ test-ci-js: | clear-stalled ## Build and test JavaScript with building anything
.PHONY: test-ci
# Related CI jobs: most CI tests, excluding node-test-commit-arm-fanned
test-ci: LOGLEVEL := info ## Build and test everything (CI).
test-ci: | clear-stalled bench-addons-build build-addons build-js-native-api-tests build-node-api-tests build-sqlite-tests doc-only
test-ci: | clear-stalled bench-addons-build build-addons build-js-native-api-tests build-node-api-tests build-sqlite-tests build-ffi-tests doc-only
out/Release/cctest --gtest_output=xml:out/junit/cctest.xml
$(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap \
--mode=$(BUILDTYPE_LOWER) --flaky-tests=$(FLAKY_TESTS) \
Expand Down
13 changes: 13 additions & 0 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1017,6 +1017,12 @@
default=None,
help='build without SQLite (disables SQLite and Web Storage API)')

parser.add_argument('--with-ffi',
action='store_true',
dest='with_ffi',
default=None,
help='build with FFI (Foreign Function Interface) support')

parser.add_argument('--experimental-quic',
action='store_true',
dest='experimental_quic',
Expand Down Expand Up @@ -2182,6 +2188,12 @@ def without_sqlite_error(option):

configure_library('sqlite', o, pkgname='sqlite3')

def configure_ffi(o):
o['variables']['node_use_ffi'] = b(options.with_ffi)
return

configure_library('ffi', o, pkgname='libffi')

def configure_quic(o):
o['variables']['node_use_quic'] = b(options.experimental_quic and
not options.without_ssl)
Expand Down Expand Up @@ -2635,6 +2647,7 @@ def make_bin_override():
configure_library('ngtcp2', output, pkgname='libngtcp2')
configure_lief(output);
configure_sqlite(output);
configure_ffi(output);
configure_library('temporal_capi', output)
configure_library('uvwasi', output)
configure_library('zstd', output, pkgname='libzstd')
Expand Down
Loading