ci: bootstrap jerbuild + stage libjerboa_native for interpreter tests
ober
31b5c057047cb44b5cd72b4cfed2dc2f6eec97c5
--- a/.build.yml +++ b/.build.yml @@ -40,6 +40,16 @@ tasks: make -j$(nproc) sudo make install scheme --version + - jerbuild: | + # The build switched to a jerbuild-based flow (jerboa-browser commit + # 1eda9c4) but CI was never updated to provide jerbuild. Its source lives + # in the jerboa repo (jerbuild.ss); build it with the Chez installed above + # and put it on PATH so `make binary` / `make test-*` can find it. + cd jerboa + SCHEME="$(command -v scheme)" sh support/build-jerbuild.sh + sudo install -m 0755 jerbuild /usr/local/bin/jerbuild + jerbuild --version + jerbuild --jerboa-home >/dev/null # extract the bundled stdlib into the cache - build: | cd jerboa-browser qmake6 --version || true --- a/Makefile +++ b/Makefile @@ -8,6 +8,20 @@ $(error jerbuild not found on PATH (or '$(JERBUILD) --jerboa-home' failed). Inst endif JEXEC := $(JERBUILD) exec --libdirs $(CURDIR)/scheme:$(JH)/lib +# Modules that use (std crypto native-rust) need libjerboa_native dlopen-able +# when run in the interpreter (jerbuild exec: tests, repl); the compiled binary +# registers those symbols statically and needs none. native-rust probes +# ./lib/libjerboa_native.* (CWD-relative), so stage a symlink there from where +# jerbuild built it (its cache, after `make binary`) or a sibling jerboa checkout. +SOEXT := $(if $(filter Darwin,$(shell uname -s)),dylib,so) +NATIVE_SRC := $(firstword $(wildcard \ + $(JH)/jerboa-native-rs/target/release/libjerboa_native.$(SOEXT) \ + $(CURDIR)/../jerboa/lib/libjerboa_native.$(SOEXT))) +lib/libjerboa_native.$(SOEXT): + @mkdir -p lib + @if [ -n "$(NATIVE_SRC)" ]; then ln -sf "$(NATIVE_SRC)" $@ && echo "staged $@ -> $(NATIVE_SRC)"; \ + else echo "note: libjerboa_native.$(SOEXT) not found yet (run 'make binary' first); crypto tests may fail"; fi + .PHONY: all build binary run test test-keymap test-minibuffer test-commands test-keys test-nav test-hint test-pass test-polish test-securestore test-adblock test-gui test-buffers repl clean help .DEFAULT_GOAL := help @@ -23,6 +37,10 @@ build: binary run: binary ./jerboa-browser $(ARGS) +# The crypto-using interpreter suites load (std crypto native-rust), so stage the +# Rust crypto lib (rule above) as a prerequisite of each. +test-securestore test-commands test-keys test-nav test-hint test-pass test-polish test-adblock: lib/libjerboa_native.$(SOEXT) + # Run the (browser) test suite in the interpreter (no binary needed). Depends on # the pure secure-store unit tests so they run as part of `make test`. test: test-securestore