You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: repair Docker dev-environment build and clarify native setup (#388)
* fix: repair Docker dev-environment build and clarify native setup
The documented setup was failing. The native path assumes a Debian host
with LLVM 13, but aWsm's llvm-alt bindings call LLVM C-API functions
(LLVMBuildCall, LLVMBuildLoad) removed in LLVM 15+, so the build fails to
link against newer system LLVM (e.g. LLVM 21 on Ubuntu 24.04). The Docker
route exists for exactly this reason but had bit-rotted in several places.
Dockerfile.x86_64:
- Install `hey` from focal's universe repo instead of downloading the
prebuilt binary, whose hey-release S3/GCS URLs now return 403.
- Add `git config --system --add safe.directory '*'` so the root-run
`make install` doesn't abort with "dubious ownership" on the
host-owned, bind-mounted /sledge.
- Set RUSTUP_HOME/CARGO_HOME to the dev user's install so the root-run
build can resolve the default Rust toolchain instead of failing with
"no default is configured".
Makefile:
- Make the wasm_apps symlink rule idempotent (ln -srfn). The symlink is
committed to the repo, so it already exists on a fresh clone and the
old `ln -sr` failed with "File exists", breaking `make install`.
README.md:
- Recommend the Docker route and add an explicit caveat to the native
section documenting the LLVM-13/Debian requirement and why Ubuntu 24.04
(and other non-LLVM-13 hosts) cannot use it.
Verified end-to-end via `./devenv.sh setup`: aWsm, the runtime, and all
benchmark apps build, and the runtime serves fibonacci, gocr, and
resize_image requests with correct responses.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix: support Ubuntu noble (24.04) for the Docker and native dev builds
The dev toolchain is pinned to LLVM 13 (aWsm builds against an LLVM-13 binding
fork), but apt.llvm.org never published llvm-toolchain-noble-13 and noble dropped
libtinfo5, so a plain focal->noble bump failed to build.
- install_llvm.sh: on noble, pin the focal apt.llvm.org repo for LLVM 13 and
install the focal-era libtinfo5/libffi7 the LLVM 13 packages need; skip lldb-13
(needs the absent libpython3.8). Other releases keep the upstream llvm.sh path.
- Dockerfile.x86_64: base on ubuntu:noble; drop libtinfo5 from apt (handled by
install_llvm.sh); reuse noble's stock ubuntu user at UID/GID 1000 instead of
creating a colliding dev user.
- install_deb.sh: drop libtinfo5 from apt (handled by install_llvm.sh).
- README: document the validated native build on Ubuntu incl. 24.04 noble, with
caveats (update-alternatives repoints default clang; focal-pinned packages).
Verified end-to-end on Ubuntu 24.04.4 (noble), x86_64, both in Docker and
natively: aWsm, libsledge, the runtime, and all nine sample *.wasm.so modules
build and sledgert runs.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.md
+26-10Lines changed: 26 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,18 +4,11 @@
4
4
5
5
## Setting up a development environment
6
6
7
-
### Native on Debian Host
7
+
SLEdge's `aWsm` compiler is built against a **specific LLVM version (LLVM 13)** via the `llvm-alt` Rust bindings. Those bindings use LLVM C-API functions (e.g. `LLVMBuildCall`, `LLVMBuildLoad`) that were **removed in LLVM 15+**, so the build will fail to link against newer LLVM toolchains.
**For this reason, the Docker environment below is the recommended way to build SLEdge.** It pins the exact Ubuntu + LLVM 13 + WASI SDK toolchain that the compiler needs, and works on any host with Docker (macOS, Windows/WSL2, or any Linux distribution). To build directly on a Debian or Ubuntu host instead — including Ubuntu 24.04 (noble) — see [Native build](#native-build-linux-debian-or-ubuntu-including-2404-noble) below.
17
10
18
-
### Docker
11
+
### Docker (recommended)
19
12
20
13
**Note: These steps require Docker. Make sure you've got it installed!**
21
14
@@ -75,6 +68,29 @@ If you are finished working with the SLEdge runtime and wish to remove it, run t
75
68
76
69
And then simply delete this repository.
77
70
71
+
### Native build (Linux: Debian or Ubuntu, including 24.04 noble)
72
+
73
+
`install_deb.sh` installs the full toolchain directly on the host — the apt dependencies, **LLVM 13**, the WASI SDK, and a Rust toolchain — after which `make install` builds the runtime and the sample functions.
74
+
75
+
On **Ubuntu 24.04 (noble)** neither the distro nor `apt.llvm.org/noble` provides LLVM 13, so `install_llvm.sh` automatically pins the **focal**`apt.llvm.org` repository for LLVM 13 and installs the two focal-era runtime libraries that noble dropped (`libtinfo5`, `libffi7`). This path is validated on Ubuntu 24.04.4 (noble), x86_64: `aWsm`, `libsledge`, the runtime, and all nine sample `*.wasm.so` modules compile, and the resulting `sledgert` binary runs.
-`install_deb.sh` requires `sudo` and uses `update-alternatives` to point the default `clang`, `wasm-ld`, and `llvm-config` at version 13. On a host that already runs a newer LLVM as its default (e.g. noble's system clang), this changes that default system-wide.
89
+
- On noble the toolchain is pinned to focal-era LLVM 13 packages, which are on an older support track; the `apt.llvm.org/focal` and `archive.ubuntu.com``.deb` URLs it relies on may eventually move or disappear.
90
+
- The sample functions are C, compiled with the WASI SDK's clang, so a Rust `wasm32-wasi`/`wasm32-wasip1` target is not required to build them.
91
+
92
+
On a distribution where neither the native repositories nor the focal fallback provide LLVM 13, use the Docker route above instead.
93
+
78
94
## Running your first serverless function
79
95
80
96
An SLEdge serverless function consists of a shared library (\*.so) and a JSON configuration file that determines how the runtime should execute the serverless function. As an example, here is the configuration file for our sample fibonacci function:
0 commit comments