Skip to content
Merged
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
8 changes: 3 additions & 5 deletions .github/workflows/vhttpd-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ jobs:
env:
VHTTPD_VJSX_ROOT: /usr/local/share/vhttpd/vjsx
V_REPO: https://github.com/guweigang/vlang
V_REF: 06438457b7fed78397588e7c0797b9e0d7483257
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -96,12 +95,11 @@ jobs:
unzip -q /tmp/v-bootstrap.zip -d /tmp/v-bootstrap
rm -rf /tmp/v
git clone "$V_REPO" /tmp/v
git -C /tmp/v checkout "$V_REF"
chmod +x /tmp/v-bootstrap/v/v
(
cd /tmp/v
/tmp/v-bootstrap/v/v -o v cmd/v
./v -o v cmd/v
/tmp/v-bootstrap/v/v -cc cc -o v cmd/v
./v -cc cc -o v cmd/v
)
chmod +x /tmp/v/v
echo "/tmp/v" >> "$GITHUB_PATH"
Expand Down Expand Up @@ -158,7 +156,7 @@ jobs:
shell: bash
run: |
set -euo pipefail
make prod VPHP_V_GC=boehm WITH_DB=1
make prod V_CC=cc VPHP_V_GC=boehm WITH_DB=1

- name: Smoke test
shell: bash
Expand Down
17 changes: 9 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
ROOT := $(CURDIR)
SRC_DIR := $(ROOT)/src
VHTTPD_BIN ?= $(ROOT)/vhttpd
V_CC ?= cc
VPHP_V_GC ?= auto
VPHP_V_GC_STRIPPED := $(strip $(VPHP_V_GC))
RESOLVED_VPHP_V_GC := $(shell if [ -n "$(VPHP_V_GC_STRIPPED)" ] && [ "$(VPHP_V_GC_STRIPPED)" != "auto" ]; then printf "%s" "$(VPHP_V_GC_STRIPPED)"; elif pkg-config --exists bdw-gc 2>/dev/null; then printf boehm; else printf none; fi)
Expand Down Expand Up @@ -79,12 +80,12 @@ ifeq ($(WITH_DB),1)
endif

build: prepare-build-src
v $(V_FLAGS) $(V_DB_FLAGS) $(V_GC_FLAG) -o $(VHTTPD_BIN) $(BUILD_STAGE_DIR)
v -cc $(V_CC) $(V_FLAGS) $(V_DB_FLAGS) $(V_GC_FLAG) -o $(VHTTPD_BIN) $(BUILD_STAGE_DIR)

vhttpd: build

prod: prepare-build-src
v $(V_FLAGS) $(V_DB_FLAGS) $(V_GC_FLAG) $(V_PROD_FLAGS) $(V_NOCACHE_FLAGS) -o $(VHTTPD_BIN) $(BUILD_STAGE_DIR)
v -cc $(V_CC) $(V_FLAGS) $(V_DB_FLAGS) $(V_GC_FLAG) $(V_PROD_FLAGS) $(V_NOCACHE_FLAGS) -o $(VHTTPD_BIN) $(BUILD_STAGE_DIR)

build-prod: prod

Expand Down Expand Up @@ -127,22 +128,22 @@ psr-matrix:
test: test-fast

test-fast:
v test $(FAST_TEST_FILES)
v -cc $(V_CC) test $(FAST_TEST_FILES)

test-inproc:
v test $(INPROC_TEST_FILES)
v -cc $(V_CC) test $(INPROC_TEST_FILES)

test-codexbot:
v test $(CODEXBOT_TEST_FILES)
v -cc $(V_CC) test $(CODEXBOT_TEST_FILES)

test-codexbot-fast:
v test $(CODEXBOT_FAST_TEST_FILES)
v -cc $(V_CC) test $(CODEXBOT_FAST_TEST_FILES)

test-codexbot-lifecycle:
v test $(CODEXBOT_LIFECYCLE_TEST_FILES)
v -cc $(V_CC) test $(CODEXBOT_LIFECYCLE_TEST_FILES)

test-profile-codexbot:
@/bin/zsh $(ROOT)/tools/profile_codexbot_tests.sh $(ROOT)

test-all:
v test $(SRC_DIR)
v -cc $(V_CC) test $(SRC_DIR)
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ Practical summary:
`vhttpd` now splits local dependencies into install profiles so you do not need to guess the full system package list up front.

- `core`: base build dependencies for `vhttpd`
- `vjsx`: embedded runtime support, including the required QuickJS archive placement under `~/.vmodules/vjsx/libs/`
- `vjsx`: embedded runtime build support, including the required QuickJS archive placement under `~/.vmodules/vjsx/libs/`
- `db`: alias for the default DB-capable dependency surface
- `full`: everything above

Expand Down Expand Up @@ -242,15 +242,16 @@ What these targets do:

- `make deps-core`: installs `openssl`, `Boehm GC`, `pkg-config`, and basic build tooling
- `make deps-core` also installs SQLite/MySQL/PostgreSQL client development packages because default `vhttpd` builds now include DB support
- `make deps-vjsx`: ensures `~/.vmodules/vjsx` exists and, on Linux, builds QuickJS and places it at `~/.vmodules/vjsx/libs/qjs_linux_x64.a`
- `make deps-vjsx`: ensures the local `vjsx` module checkout exists for builds and, on Linux, builds QuickJS and places it at `~/.vmodules/vjsx/libs/qjs_linux_x64.a`
- `make deps-db`: alias for the same default DB-capable build dependency set
- `make doctor`: checks the current machine for the required commands, `pkg-config` entries, and `vjsx` QuickJS archive placement

Important `vjsx` note:
Important `vjsx` build note:

- On Linux, `vjsx` does not just need "QuickJS installed somewhere".
- The archive must exist at [~/.vmodules/vjsx/libs/qjs_linux_x64.a](/Users/guweigang/.vmodules/vjsx/libs/qjs_linux_x64.a).
- `make deps-vjsx` is the supported way to prepare that path locally.
- This is a build-time module layout. Packaged `vhttpd` binaries do not need a local `~/.vmodules/vjsx` checkout just to load embedded JavaScript or TypeScript runtime assets.

## Build

Expand Down Expand Up @@ -344,7 +345,7 @@ The binary is rewritten during packaging so it prefers these bundled copies:

That means end users no longer need to preinstall MySQL/PostgreSQL/OpenSSL/Boehm runtime packages just to launch the release binary.

`vjsx` runtime JS assets are embedded into the `vjsx` binary integration, so packaged `vhttpd` releases no longer need to ship `runtime/vjsx` JS files. `VJSX_ASSET_ROOT` is still supported as an explicit development override when you need to test a local replacement for built-in `vjsx` runtime JS.
`vjsx` runtime assets, including the TypeScript compiler runtime under `thirdparty/typescript/lib`, are embedded into the `vjsx` binary integration. Packaged `vhttpd` releases no longer need to ship `runtime/vjsx` JS files or a local `~/.vmodules/vjsx/thirdparty/typescript` tree. `VJSX_ASSET_ROOT` is still supported as an explicit development override when you need to test a local replacement for built-in `vjsx` runtime assets.

After installation, users can verify the machine with:

Expand Down
Loading
Loading