Install · x86_64 Linux
Install the alpha.
These steps install Tide's admission driver, tide-admit, through the
repository's Nix flake, build and run one example, and run its generated test in the kernel
sandbox. The alpha has no tide command. tide-admit is the whole
toolchain, with Tide's std as its default.
You need an x86_64 Linux machine with curl, xz and
git, and about 10 GB of free disk space, 7 GB of it for /nix. Nix
provides the Rust toolchain and the C linker, so no step uses rustup or the system's C
compiler. The full guide is docs/install.md.
Try it
Open in GitHub Codespaces
In the browser, with nothing installed. The codespace builds the repository's dev container. In its terminal, run nix run .#tide-demo. The dev container has no gdb, so there the demo skips step 5, the replay under a debugger. The rustup path runs it on a machine with a gdb built with Python on PATH.
-
With rustup and no Nix. On x86_64 Linux with rustup 1.28 or later, git, and a C toolchain at
/usr/bin/ccand/usr/bin/ld(on Debian or Ubuntu,build-essential).rustup toolchain installfetches the nightly thatrust-toolchain.tomlpins, withrustc-devandrust-src. A rustup older than 1.28 installs it at the first cargo run, so skip that line there.git clone https://github.com/luccahuguet/tide tide && cd tide rustup toolchain install cargo run -p tide-demo -
With Nix and no clone. It needs no rustup and no system C compiler. Add
--extra-experimental-features 'nix-command flakes'unless both are enabled.nix run github:luccahuguet/tide#tide-demo -
With Docker, a local fallback for macOS and Windows. In a clone, build the try image locally, then run it. The Tide image is built locally rather than pulled from a registry.
docker build --platform linux/amd64 --target try -t tide-try . docker run --rm --platform linux/amd64 tide-try
Each path runs the demo. The sizes and the times measured for each path, with their conditions, are in the README's try-it table.
The steps below install the driver itself, for building your own programs.
1. Install Nix
In bash or zsh:
sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install) --no-daemon
. ~/.nix-profile/etc/profile.d/nix.sh
This is Nix's single-user install. It asks for sudo only to create
/nix. The second line puts nix on this shell's PATH.
2. Get the repository and build the driver
git clone https://github.com/luccahuguet/tide tide
cd tide
nix --extra-experimental-features 'nix-command flakes' build .#tidelang-admit
The first build downloads the pinned Rust nightly and Nix's C toolchain, and compiles the
driver and Tide's std from source, which takes a few minutes.
result/bin/tide-admit is the driver.
3. Build and run an example
examples/contracts/sorted_insert.rs states a function's contract once, with
#[requires] and #[ensures], and has no hand-written test.
result/bin/tide-admit --crate-type=bin --emit=link --crate-name=sorted_insert \
--out-dir target/quickstart examples/contracts/sorted_insert.rs
target/quickstart/sorted_insert
The program prints [3, 7, 9, 14, 20]. Code that breaks a Tide rule fails
admission with a named code instead, such as
examples/capabilities/ambient_read.rs with TD0501.
4. Run its test in the sandbox
result/bin/tide-admit --test --emit=link --crate-name=sorted_insert \
--out-dir target/quickstart-tests examples/contracts/sorted_insert.rs \
--tide-run-test __tide_contract_tests::insert_sorted_3
The test build generates one test from the function's contract, and
--tide-run-test runs it under Landlock and seccomp. Before the test starts, the
driver prints the sandbox level. The output ends:
sandbox: full (Linux …, Landlock ABI …)
running 1 test
property __tide_contract_tests::r#insert_sorted_3: 100/100 cases passed (accepted/generated)
test __tide_contract_tests::insert_sorted_3 ... ok
full means Landlock and seccomp both confine the test. When the kernel lacks
them, the line reads sandbox: partial, not enforced: … and names what is
missing. Builds themselves are not sandboxed.
macOS or Windows: a Linux container
The repository's Dockerfile builds Tide by the same route in a pinned Ubuntu
24.04 build stage and makes two images from it. The try image in the try-it block above holds
only the demo's closure and runs the demo.
For a shell with the driver, build the dev image, which needs Docker, a clone of the
repository and about 10 GB of free disk space. In the clone:
docker build --platform linux/amd64 --target dev -t tide .
docker run --rm -it --platform linux/amd64 tide
The container starts a shell in ~/tide with the driver built at
result/bin/tide-admit, so steps 3 and 4 run as written above. The Tide images
are built locally rather than pulled from a registry.
The image is linux/amd64 only, and Apple-silicon Macs run it under emulation.
The sandbox level depends on the kernel of Docker's Linux VM, so read the line your run
prints. The image was checked on Linux only. No macOS or Windows run has been observed. The
full notes are in docs/docker.md.
Next
How Tide works runs each feature from the same checkout. To work
on Tide itself, nix develop enters a shell with the pinned toolchain, where
cargo run -p tide-demo runs the replay demo.