about summary refs log tree commit diff
path: root/tvix/docs/src/getting-started.md
blob: 1cbb6de7d4f7a31ea0b3db2b3be0a543ac956ce9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Getting Started

## Getting the code, a developer shell, & building the CLI

Tvix can be built with the Rust standard `cargo build`. A Nix shell is provided
with the correctly-versioned tooling to build.

### TVL monorepo

```console
$ git clone https://code.tvl.fyi/depot.git
$ cd depot
```

[Direnv][] is highly recommended in order to enable [`mg`][mg], a tool for
workflows in monorepos. Follow the [Direnv installation
instructions][direnv-inst], then after it’s set up continue with:

```console
$ direnv allow
$ mg shell //tvix:shell
$ cd tvix
$ cargo build
```

### Or just Tvix

At present, this option isn’t suitable for contributions & lacks the tooling of
the monorepo, but still provides a `shell.nix` which can be used for building
the Tvix project.

```console
$ git clone https://code.tvl.fyi/depot.git:workspace=views/tvix.git
$ cd tvix
$ nix-shell
$ cargo build
```


# Builds & tests

All projects are built using [Nix][] to avoid ‘build pollution’ via the user’s
local environment.

If you have Nix installed and are contributing to a project tracked in this
repository, you can usually build the project by calling `nix-build -A
path.to.project`.

For example, to build a project located at `//tools/foo` you would call
`nix-build -A tools.foo`

If the project has tests, check that they still work before submitting your
change.


[Direnv]: https://direnv.net
[direnv-inst]: https://direnv.net/docs/installation.html
[Nix]: https://nixos.org/nix/
[mg]: https://code.tvl.fyi/tree/tools/magrathea