Point download-v8 at the cache directly, drop the v8/ symlink

The prebuilt archive already lives at .lp-cache/prebuilt-v8/<version>.a;
the v8/libc_v8.a symlink was redundant indirection. build.zig has no
implicit lookup, so the Makefile passes -Dprebuilt_v8_path explicitly
anyway. Point it straight at the cached file, dropping the symlink step,
the v8/ dir, and its .gitignore entry. Keep the version-keyed filename so
bumping the V8 pin fetches a new file instead of clobbering.
This commit is contained in:
Navid EMAD
2026-05-22 15:16:57 +02:00
parent fc795c3b56
commit 47bebded55
2 changed files with 7 additions and 10 deletions

1
.gitignore vendored
View File

@@ -1,6 +1,5 @@
/.zig-cache/
/.lp-cache/
/v8/
/zig-pkg/
zig-out
lightpanda.id

View File

@@ -43,13 +43,12 @@ V8_VERSION := $(shell awk -F\' '/^ v8:/{f=1} f&&/default:/{print $$2; exit}' $(
ZIG_V8_TAG := $(shell awk -F\' '/^ zig-v8:/{f=1} f&&/default:/{print $$2; exit}' $(V8_ACTION))
V8_ARCHIVE := libc_v8_$(V8_VERSION)_$(OS)_$(ARCH).a
V8_CACHE := .lp-cache/prebuilt-v8/$(V8_ARCHIVE)
V8_LINK := v8/libc_v8.a
# If the prebuilt archive is in place and the caller hasn't set ZIGFLAGS, link
# against it (the same flag CI passes) rather than building V8 from source.
# If the prebuilt archive is in place and the caller hasn't set ZIGFLAGS, point
# the build at it rather than building V8 from source.
ifeq ($(strip $(ZIGFLAGS)),)
ifneq ($(wildcard $(V8_LINK)),)
ZIGFLAGS := -Dprebuilt_v8_path=$(V8_LINK)
ifneq ($(wildcard $(V8_CACHE)),)
ZIGFLAGS := -Dprebuilt_v8_path=$(V8_CACHE)
endif
endif
@@ -77,14 +76,13 @@ help:
## Download the prebuilt V8 archive (skips the 10+ min source build)
download-v8:
@mkdir -p $(dir $(V8_CACHE)) $(dir $(V8_LINK))
@mkdir -p $(dir $(V8_CACHE))
@test -f $(V8_CACHE) || ( \
printf "\033[36mDownloading prebuilt V8 $(V8_VERSION) ($(ZIG_V8_TAG))...\033[0m\n"; \
curl -fL --progress-bar -o $(V8_CACHE) \
https://github.com/lightpanda-io/zig-v8-fork/releases/download/$(ZIG_V8_TAG)/$(V8_ARCHIVE) \
|| (rm -f $(V8_CACHE); printf "\033[33mDownload ERROR\033[0m\n"; exit 1) )
@ln -sf $(abspath $(V8_CACHE)) $(V8_LINK)
@printf "\033[33mV8 ready: %s -> %s\033[0m\n" "$(V8_LINK)" "$(V8_CACHE)"
@printf "\033[33mV8 ready: %s\033[0m\n" "$(V8_CACHE)"
## Build v8 snapshot
build-v8-snapshot:
@@ -130,7 +128,7 @@ end2end:
@test -d ../demo
cd ../demo && go run runner/main.go
## Remove build artifacts (keeps v8/ and zig-pkg/ — slow to re-fetch)
## Remove build artifacts (keeps .lp-cache/ and zig-pkg/ — slow to re-fetch)
clean:
rm -rf zig-out .zig-cache src/snapshot.bin
cd src/html5ever && cargo clean