Skip to content

Commit 51baddd

Browse files
committed
Remove luajit, use pre-built Luau binary instead of building from source
1 parent fd2c508 commit 51baddd

5 files changed

Lines changed: 11 additions & 31 deletions

File tree

‎CONTRIBUTING.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Thanks for contributing to Prometheus.
1212

1313
## Running Tests
1414

15-
Tests run inside a Docker container with lua5.1, upstream LuaJIT (built from source), and Luau:
15+
Tests run inside a Docker container with lua5.1 and Luau:
1616

1717
```bash
1818
./scripts/run-tests.sh # Run all tests (default: 10 iterations)

‎Dockerfile‎

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,19 @@ FROM ubuntu:24.04
33
RUN apt-get update && apt-get install -y \
44
lua5.1 \
55
git \
6-
build-essential \
7-
cmake \
8-
ninja-build \
96
unzip \
107
curl \
118
&& rm -rf /var/lib/apt/lists/*
129

13-
# Build upstream LuaJIT from source (apt version has fatal bugs incompatible with Prometheus)
14-
RUN git clone https://luajit.org/git/luajit.git /opt/luajit-src \
15-
&& cd /opt/luajit-src \
16-
&& make -j$(nproc) \
17-
&& make install \
18-
&& ldconfig \
19-
&& rm -rf /opt/luajit-src
20-
21-
# Build Luau from source
22-
RUN git clone https://github.com/luau-lang/luau.git /opt/luau-src \
23-
&& cd /opt/luau-src \
24-
&& mkdir build && cd build \
25-
&& cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release \
26-
&& ninja \
27-
&& cp luau /usr/local/bin/luau \
28-
&& cp luau-analyze /usr/local/bin/luau-analyze 2>/dev/null || true \
29-
&& cp luau-compile /usr/local/bin/luau-compile 2>/dev/null || true \
30-
&& cp luau-reduce /usr/local/bin/luau-reduce 2>/dev/null || true \
31-
&& rm -rf /opt/luau-src
10+
# Download pre-built Luau binary
11+
RUN curl -sSLo /tmp/luau-ubuntu.zip \
12+
https://github.com/luau-lang/luau/releases/latest/download/luau-ubuntu.zip \
13+
&& unzip -j /tmp/luau-ubuntu.zip luau -d /usr/local/bin \
14+
&& chmod +x /usr/local/bin/luau \
15+
&& rm /tmp/luau-ubuntu.zip
3216

3317
# Verify installations
34-
RUN lua5.1 -v && luajit -v && printf 'print("luau OK")\n' > /tmp/luau_check.lua && luau /tmp/luau_check.lua && rm /tmp/luau_check.lua
18+
RUN lua5.1 -v && printf 'print("luau OK")\n' > /tmp/luau_check.lua && luau /tmp/luau_check.lua && rm /tmp/luau_check.lua
3519

3620
WORKDIR /app
3721
COPY . /app

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ For more advanced use cases, configuration, and presets, see the [documentation]
138138

139139
## Tests
140140

141-
The test suite runs inside Docker with lua5.1, upstream LuaJIT (built from source), and Luau:
141+
The test suite runs inside Docker with lua5.1 and Luau:
142142

143143
```bash
144144
./scripts/run-tests.sh # Run all tests (default: 10 iterations)

‎docker-test-runner.lua‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ local RUNTIMES = {
2929
name = "lua5.1",
3030
cmd = "lua5.1",
3131
},
32-
{
33-
name = "luajit",
34-
cmd = "luajit",
35-
},
3632
{
3733
name = "luau",
3834
cmd = "luau",

‎scripts/run-tests.sh‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ usage() {
1414
cat <<EOF
1515
Usage: $0 [OPTIONS]
1616
17-
Run Prometheus tests inside a Docker container with lua5.1, upstream luajit, and luau.
17+
Run Prometheus tests inside a Docker container with lua5.1 and luau.
1818
1919
Options:
2020
-n N Number of iterations per test/preset (default: 10)
@@ -27,7 +27,7 @@ Options:
2727
-h, --help Show this help
2828
2929
Runtimes available in the container:
30-
lua5.1, luajit (upstream, built from source), luau (built from source)
30+
lua5.1, luau (built from source)
3131
3232
EOF
3333
exit 0

0 commit comments

Comments
 (0)