Skip to content

Commit 729c00a

Browse files
committed
Fix CI: Add mesa-vulkan-drivers and use runtime packages
Critical fixes for CI test failures: 1. Added mesa-vulkan-drivers (critical runtime dependency for GPU rendering) 2. Changed test jobs from dev packages (-dev) to runtime packages - smoke-test and integration-test now use runtime packages - build-binary job keeps dev packages (needed for compilation) Dependencies changed: - Build: libcurl4-openssl-dev, libglfw3-dev, libuv1-dev, libz-dev - Runtime: mesa-vulkan-drivers, libcurl4, libglfw3, libuv1, zlib1g Updated docs/CI.md: - Clear distinction between build-time and runtime dependencies - Added tables showing which packages are needed when - Updated 'Testing Locally' section with both options - Added troubleshooting for missing mesa-vulkan-drivers This aligns with defencewest-site working configuration.
1 parent fbc70ae commit 729c00a

2 files changed

Lines changed: 107 additions & 44 deletions

File tree

.github/workflows/release.yml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,15 @@ jobs:
5454
steps:
5555
- uses: actions/checkout@v4
5656

57-
- name: Install system dependencies
57+
- name: Install system dependencies (runtime)
5858
run: |
5959
sudo apt-get update
6060
sudo apt-get install -y \
61-
libcurl4-openssl-dev \
62-
pkg-config \
63-
libglfw3-dev \
64-
libuv1-dev \
65-
libz-dev
61+
mesa-vulkan-drivers \
62+
libcurl4 \
63+
libglfw3 \
64+
libuv1 \
65+
zlib1g
6666
6767
- name: Setup tools with mise
6868
uses: jdx/mise-action@v2
@@ -91,6 +91,8 @@ jobs:
9191
run: |
9292
echo "Testing basic render functionality..."
9393
uv run python -c "
94+
import os
95+
os.environ['MLNATIVE_DEBUG'] = '1'
9496
from mlnative import Map
9597
with Map(256, 256) as m:
9698
png = m.render(center=[0, 0], zoom=1)
@@ -108,15 +110,15 @@ jobs:
108110
steps:
109111
- uses: actions/checkout@v4
110112

111-
- name: Install system dependencies
113+
- name: Install system dependencies (runtime)
112114
run: |
113115
sudo apt-get update
114116
sudo apt-get install -y \
115-
libcurl4-openssl-dev \
116-
pkg-config \
117-
libglfw3-dev \
118-
libuv1-dev \
119-
libz-dev
117+
mesa-vulkan-drivers \
118+
libcurl4 \
119+
libglfw3 \
120+
libuv1 \
121+
zlib1g
120122
121123
- name: Setup tools with mise
122124
uses: jdx/mise-action@v2

docs/CI.md

Lines changed: 93 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -73,26 +73,59 @@ The project uses GitHub Actions for continuous integration and deployment. The w
7373

7474
## System Requirements
7575

76-
### For Rendering (Smoke/Integration Tests)
76+
### Build-Time Dependencies (for compiling the Rust binary)
7777

78-
The native renderer requires:
78+
Required when building the native renderer from source:
7979

80-
1. **libcurl4-openssl-dev**: For HTTP tile requests
81-
2. **pkg-config**: For build configuration
82-
3. **libglfw3-dev**: GLFW library for windowing
83-
4. **libuv1-dev**: libuv for async I/O
84-
5. **libz-dev**: zlib compression library
85-
6. **Network access**: Must reach tiles.openfreemap.org
80+
| Package | Purpose |
81+
|---------|---------|
82+
| **Rust 1.70+** | Compiler toolchain |
83+
| **libcurl4-openssl-dev** | HTTP client library (development headers) |
84+
| **pkg-config** | Build configuration tool |
85+
| **libglfw3-dev** | GLFW windowing library (development headers) |
86+
| **libuv1-dev** | Async I/O library (development headers) |
87+
| **libz-dev** | zlib compression (development headers) |
88+
| **CMake** | Build system generator |
8689

87-
### For Building
90+
**Ubuntu/Debian:**
91+
```bash
92+
sudo apt-get install -y \
93+
libcurl4-openssl-dev \
94+
pkg-config \
95+
libglfw3-dev \
96+
libuv1-dev \
97+
libz-dev \
98+
cmake
99+
```
100+
101+
### Runtime Dependencies (for using pre-built wheels)
102+
103+
Required when using mlnative from PyPI (pre-built wheels):
104+
105+
| Package | Purpose | Critical |
106+
|---------|---------|----------|
107+
| **mesa-vulkan-drivers** | Vulkan graphics drivers | **YES** |
108+
| **libcurl4** | HTTP client library | Yes |
109+
| **libglfw3** | GLFW windowing library | Yes |
110+
| **libuv1** | Async I/O library | Yes |
111+
| **zlib1g** | zlib compression | Yes |
112+
| **Network access** | Must reach tiles.openfreemap.org | Yes |
113+
114+
**⚠️ CRITICAL:** `mesa-vulkan-drivers` is required for GPU rendering. Without it, the renderer will crash immediately.
88115

89-
1. **Rust 1.70+**: For compiling the native renderer
90-
2. **libcurl4-openssl-dev**: System dependency
91-
3. **pkg-config**: Build configuration
92-
4. **libglfw3-dev**: GLFW library
93-
5. **libuv1-dev**: libuv for async I/O
94-
6. **libz-dev**: zlib compression
95-
7. **CMake**: Required by maplibre-native build
116+
**Ubuntu/Debian:**
117+
```bash
118+
sudo apt-get install -y \
119+
mesa-vulkan-drivers \
120+
libcurl4 \
121+
libglfw3 \
122+
libuv1 \
123+
zlib1g
124+
```
125+
126+
**Why different packages?**
127+
- Build uses `-dev` packages (headers + libraries)
128+
- Runtime uses base packages (libraries only, smaller/faster)
96129

97130
## Network Requirements
98131

@@ -111,41 +144,69 @@ Error: `cannot find -lcurl`
111144
Solution: Install `libcurl4-openssl-dev`
112145

113146
### Graphics/Display Issues
114-
Error: `Failed to initialize graphics`
115-
Solution: Ensure all graphics libraries are installed (`libglfw3-dev`, `libuv1-dev`)
147+
Error: `Failed to initialize graphics` or `Renderer process closed unexpectedly`
148+
Solution: Install **mesa-vulkan-drivers** (critical runtime dependency):
149+
```bash
150+
sudo apt-get install -y mesa-vulkan-drivers
151+
```
152+
153+
### Missing System Libraries
154+
Error: `cannot find -lcurl` (during build)
155+
Solution: Install development package:
156+
```bash
157+
sudo apt-get install -y libcurl4-openssl-dev
158+
```
116159

117160
### Network Timeouts
118161
Error: `Failed to fetch tile`
119162
Solution: Ensure outbound HTTPS is allowed and OpenFreeMap is accessible
120163

121164
## Testing Locally
122165

123-
To run the same tests as CI:
166+
### Option 1: Using Pre-built Wheel (Recommended for testing)
167+
168+
If you just want to test rendering without building:
124169

125170
```bash
126-
# Install system dependencies (Ubuntu/Debian)
171+
# Install runtime dependencies only
127172
sudo apt-get install -y \
128-
libcurl4-openssl-dev \
129-
pkg-config \
130-
libglfw3-dev \
131-
libuv1-dev \
132-
libz-dev
173+
mesa-vulkan-drivers \
174+
libcurl4 \
175+
libglfw3 \
176+
libuv1 \
177+
zlib1g
133178

134-
# Build the binary
135-
just build-rust
179+
# Install mlnative from PyPI
180+
pip install mlnative
136181

137-
# Run unit tests
138-
just test-unit
139-
140-
# Run smoke test
182+
# Run tests
141183
python -c "
142184
from mlnative import Map
143185
with Map(256, 256) as m:
144186
png = m.render(center=[0, 0], zoom=1)
145187
print(f'Rendered: {len(png)} bytes')
146188
"
189+
```
190+
191+
### Option 2: Building from Source
192+
193+
If you need to modify and build the Rust binary:
147194

148-
# Run integration tests
195+
```bash
196+
# Install build dependencies
197+
sudo apt-get install -y \
198+
libcurl4-openssl-dev \
199+
pkg-config \
200+
libglfw3-dev \
201+
libuv1-dev \
202+
libz-dev \
203+
cmake
204+
205+
# Build the binary
206+
just build-rust
207+
208+
# Run tests
209+
just test-unit
149210
pytest tests/ -m integration -v
150211
```
151212

0 commit comments

Comments
 (0)