Building from source
Most people should install a release. Build Tessel from source if you want to work on the compiler, the runtime or the IDE, or try changes that aren’t released yet.
Tessel’s compiler is written in Rust and uses LLVM, so building it needs Rust and LLVM 22. (Programs written in Tessel never need either.)
-
Install the command line developer tools, if you haven’t already. Tessel uses the system’s
ccto link your apps.Terminal window xcode-select --install -
Install Rust from rustup.rs. Tessel uses the Rust 2024 edition, so an up-to-date stable Rust is needed.
-
Install LLVM 22 with Homebrew:
Terminal window brew install llvm@22The repository’s
.cargo/config.tomlpoints the build at/opt/homebrew/opt/llvm@22, which is where Homebrew puts it on Apple silicon Macs. If yours is somewhere else (for example on an Intel Mac), setLLVM_SYS_221_PREFIXbefore building:Terminal window export LLVM_SYS_221_PREFIX="$(brew --prefix llvm@22)" -
Get the source and build it:
Terminal window git clone https://github.com/alexiusacademia/tesselcd tesselcargo build --releaseThis builds two things in
target/release/: thetesselcommand, andlibtessel_runtime.a, the runtime library that every Tessel app is linked with. -
Put
tesselon yourPATH. Add thetarget/releasefolder itself to yourPATH, for example in~/.zshrc:Terminal window export PATH="$HOME/path/to/tessel/target/release:$PATH"
Windows
Section titled “Windows”Building on Windows follows the same steps as Tessel’s CI, which builds and tests every change on Windows.
-
Install Visual Studio Build Tools with the “Desktop development with C++” workload. Rust needs it, and Tessel uses its linker (
link.exe) to link your apps. -
Install Rust from rustup.rs.
-
Install LLVM 22. Download the prebuilt archive
clang+llvm-22.1.8-x86_64-pc-windows-msvc.tar.xzfrom the LLVM releases page and unpack it, for example intoC:\llvm. This archive is what Tessel’s CI uses; it includes the libraries andllvm-configthat building against LLVM needs, which the regular LLVM Windows installer leaves out. -
Tell the build where LLVM is by setting
LLVM_SYS_221_PREFIXto the unpacked folder, in PowerShell:Terminal window $env:LLVM_SYS_221_PREFIX = "C:\llvm\clang+llvm-22.1.8-x86_64-pc-windows-msvc" -
Build for the
x86_64-pc-windows-msvctarget:Terminal window git clone https://github.com/alexiusacademia/tesselcd tesselcargo build --release --target x86_64-pc-windows-msvcNaming the target explicitly matters. LLVM’s Windows build uses the static C runtime, and
.cargo/config.tomlmakes Tessel use it too, but only when a target is given. A side benefit: Tessel apps need no extra C runtime DLLs.The result is in
target\x86_64-pc-windows-msvc\release\:tessel.exeandtessel_runtime.lib. Add that folder to yourPATH.
Check your build
Section titled “Check your build”tessel check examples/countertessel run examples/counterRelease or debug build?
Section titled “Release or debug build?”You can build Tessel with a plain cargo build too; the result goes to
target/debug/. It works the same, but use the release build for real use:
tessel build links your app with the runtime library that sits next to the
tessel executable, so a release tessel makes much smaller and faster
apps. On macOS, the todo example is about 12 MB when built with a release
tessel, and about 55 MB with a debug one.
How releases are built
Section titled “How releases are built”Release packages are built by .github/workflows/release.yml when a version
tag is pushed. It links LLVM into tessel statically (from LLVM’s official
static build), so the packaged tessel needs no LLVM, Rust or Homebrew,
and uploads the packages to Google Cloud Storage.