Skip to content

Commit 0f41222

Browse files
enghitaloclaude
andcommitted
vanilla: build pinned V 0.5.1 from source (pinned vc bootstrap)
Build V from source at the 0.5.1 tag instead of the prebuilt release zip. Plain `make` can't build an old tag: its latest_vc step `git pull`s the newest vlang/vc bootstrap, which no longer matches 0.5.1's vlib (fails with `unknown ident \`native\``). So pin vc to the commit cut for 0.5.1 (vlang/vc f461dfeb = "[v:master] 0c3183c - V 0.5.1") and run make's own bootstrap recipe (cc -> v1 -> v2 -> v). Drop curl/unzip from the build deps. Pinned by tag, not a master commit, because post-0.5.1 master carries a codegen regression (single-element array push 4-7x slower, vlang/v#27468). Both backends; verified the source-built compiler serves /json and /pipeline correctly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 44fa661 commit 0f41222

2 files changed

Lines changed: 36 additions & 10 deletions

File tree

frameworks/vanilla-epoll/Dockerfile

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,26 @@ FROM debian:stable-slim AS build
22

33
RUN apt-get -qq update && \
44
apt-get -qy install --no-install-recommends \
5-
ca-certificates curl unzip build-essential git libpq-dev liburing-dev && \
5+
ca-certificates build-essential git libpq-dev liburing-dev && \
66
rm -rf /var/lib/apt/lists/*
77

8-
# Pinned, reproducible V 0.5.1 (prebuilt release binary — no source build, and it
9-
# avoids the `git checkout <tag> && make` vc-mismatch problem).
10-
RUN curl -fsSL https://github.com/vlang/v/releases/download/0.5.1/v_linux.zip -o /tmp/v.zip && \
11-
unzip -q /tmp/v.zip -d /opt && rm /tmp/v.zip && \
8+
# Pinned, reproducible V 0.5.1, built from source. Plain `make` can't build an old
9+
# tag — its `latest_vc` step `git pull`s the newest vlang/vc bootstrap, which no
10+
# longer matches 0.5.1's vlib ("unknown ident `native`"). So pin the vc bootstrap
11+
# to the commit cut for 0.5.1 (vlang/vc f461dfeb = "[v:master] 0c3183c - V 0.5.1")
12+
# and run make's own bootstrap recipe (cc -> v1 -> v2 -> v). Pinned by tag, not a
13+
# master commit, because post-0.5.1 master has a codegen regression (single-element
14+
# array push 4-7x slower, vlang/v#27468).
15+
RUN git clone --branch 0.5.1 --depth 1 https://github.com/vlang/v /opt/v && \
16+
git clone --filter=blob:none --quiet https://github.com/vlang/vc /opt/v/vc && \
17+
git -C /opt/v/vc checkout -q f461dfebcdfa && \
18+
git clone --filter=blob:none --quiet --branch thirdparty-linux-amd64 \
19+
https://github.com/vlang/tccbin /opt/v/thirdparty/tcc && \
20+
cd /opt/v && \
21+
cc -std=c99 -w -o v1 vc/v.c -lm -lpthread && \
22+
./v1 -no-parallel -o v2 cmd/v && \
23+
./v2 -nocache -o v cmd/v && \
24+
rm -f v1 v2 && \
1225
ln -s /opt/v/v /usr/local/bin/v
1326

1427
# Install the vanilla HTTP server as the `vanilla` module (import vanilla.http_server).

frameworks/vanilla-io_uring/Dockerfile

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,26 @@ FROM debian:stable-slim AS build
22

33
RUN apt-get -qq update && \
44
apt-get -qy install --no-install-recommends \
5-
ca-certificates curl unzip build-essential git libpq-dev liburing-dev && \
5+
ca-certificates build-essential git libpq-dev liburing-dev && \
66
rm -rf /var/lib/apt/lists/*
77

8-
# Pinned, reproducible V 0.5.1 (prebuilt release binary — no source build, and it
9-
# avoids the `git checkout <tag> && make` vc-mismatch problem).
10-
RUN curl -fsSL https://github.com/vlang/v/releases/download/0.5.1/v_linux.zip -o /tmp/v.zip && \
11-
unzip -q /tmp/v.zip -d /opt && rm /tmp/v.zip && \
8+
# Pinned, reproducible V 0.5.1, built from source. Plain `make` can't build an old
9+
# tag — its `latest_vc` step `git pull`s the newest vlang/vc bootstrap, which no
10+
# longer matches 0.5.1's vlib ("unknown ident `native`"). So pin the vc bootstrap
11+
# to the commit cut for 0.5.1 (vlang/vc f461dfeb = "[v:master] 0c3183c - V 0.5.1")
12+
# and run make's own bootstrap recipe (cc -> v1 -> v2 -> v). Pinned by tag, not a
13+
# master commit, because post-0.5.1 master has a codegen regression (single-element
14+
# array push 4-7x slower, vlang/v#27468).
15+
RUN git clone --branch 0.5.1 --depth 1 https://github.com/vlang/v /opt/v && \
16+
git clone --filter=blob:none --quiet https://github.com/vlang/vc /opt/v/vc && \
17+
git -C /opt/v/vc checkout -q f461dfebcdfa && \
18+
git clone --filter=blob:none --quiet --branch thirdparty-linux-amd64 \
19+
https://github.com/vlang/tccbin /opt/v/thirdparty/tcc && \
20+
cd /opt/v && \
21+
cc -std=c99 -w -o v1 vc/v.c -lm -lpthread && \
22+
./v1 -no-parallel -o v2 cmd/v && \
23+
./v2 -nocache -o v cmd/v && \
24+
rm -f v1 v2 && \
1225
ln -s /opt/v/v /usr/local/bin/v
1326

1427
# Install the vanilla HTTP server as the `vanilla` module (import vanilla.http_server).

0 commit comments

Comments
 (0)