|
| 1 | +# Introduction |
| 2 | + |
| 3 | +Welcome to the codetracer-desktop wiki. Here you can find information on almost every topic |
| 4 | +regarding codetracer development and usage. |
| 5 | + |
| 6 | +## What is codetracer |
| 7 | +Codetracer is a debugging environment, based on the concept of record and replay, developed as a powerful tool to easily |
| 8 | +debug complex applications. |
| 9 | + |
| 10 | +## Installation |
| 11 | +> [!CAUTION] |
| 12 | +> Codetracer can only be installed on Linux and macOS. |
| 13 | +
|
| 14 | +### Prerequisites |
| 15 | +On systems that are not NixOS, you need to install `direnv` and `nix`. |
| 16 | + |
| 17 | +Nix should not be installed through your distribution's package manager, but from [here](https://nixos.org/download/). |
| 18 | + |
| 19 | +Direnv should be set up in your shell, as shown [here](https://direnv.net/docs/hook.html). |
| 20 | + |
| 21 | +### Installation |
| 22 | +1. Setup SSH with our private GitLab instance: <https://gitlab.metacraft-labs.com> |
| 23 | +1. Clone the repository with submodules: `git clone [email protected]:codetracer/codetracer-desktop.git --recursive` |
| 24 | +1. Enter the created directory |
| 25 | +1. For first-time setup: |
| 26 | + - Create a PAT from [here](https://gitlab.metacraft-labs.com/-/user_settings/personal_access_tokens) |
| 27 | + - Create a new token with at least `read_api` and `read_repository` access |
| 28 | + - Add the following text to `~/.config/nix/nix.conf` |
| 29 | + ``` |
| 30 | + access-tokens = gitlab.metacraft-labs.com=PAT:<token> |
| 31 | + experimental-features = nix-command flakes |
| 32 | + ``` |
| 33 | + - And replace `<token>` with your PAT |
| 34 | +1. Run `nix develop` |
| 35 | +1. Run `direnv allow` |
| 36 | +1. To build codetracer simply run `just build` |
| 37 | +1. Now every time you enter the `codetracer-desktop` directory your environment should be updated |
| 38 | + |
| 39 | +<!-- Question: Is an access token required for GitHub right now? It might be needed if we use the GitHub API more than a couple of times a second |
| 40 | +TODO: |
| 41 | +1. Change repository URL |
| 42 | +1. Remove references to GitLab |
| 43 | +--> |
| 44 | + |
| 45 | + |
| 46 | +> [!TIP] |
| 47 | +> Users of Visual Studio Code might encounter issues when using `code .`. To fix them do the following: |
| 48 | +> 1. Run `direnv deny` |
| 49 | +> 1. Run `code .` |
| 50 | +> 1. Run `direnv allow` |
| 51 | +
|
| 52 | +### Building and running the tests |
| 53 | +To start running tests do the following: |
| 54 | + |
| 55 | +1. Run `tester build` - Builds tester |
| 56 | +1. Run `tester parallel` - Runs the tests |
| 57 | + |
| 58 | +### Enabling `cachix` |
| 59 | +> [!NOTE] |
| 60 | +> This step is optional |
| 61 | +
|
| 62 | +<!-- TODO: Scrap or completely rewrite the cachix instructions for end users. Alternatively, make this an internal developer guide --> |
| 63 | + |
| 64 | +Cachix is a cache for nix that allows you to save time on compiling codetracer and related projects. To enable `cachix` do the following: |
| 65 | + |
| 66 | +1. Log into [cachix](https://www.cachix.org/) with your personal GitHub account |
| 67 | +1. Create an authentication token |
| 68 | +1. Run `cachix authtoken --stdin` |
| 69 | +1. Paste the token and click enter |
| 70 | +1. Press `CTRL + D` to save the token |
| 71 | +1. Run `cachix use metacraft-labs-codetracer` |
| 72 | +1. Run `direnv allow`, `nix develop`, or `just build-nix` to auto-download cached binaries if available |
| 73 | + |
| 74 | +### Explicit `cachix` setup |
| 75 | +> [!NOTE] |
| 76 | +> You have to be an admin for the private cache. Ask an administrator to get added. |
| 77 | +
|
| 78 | +Our current `cachix` setup pushes binaries from CI, but if you want to manually push to `cachix` as well, or want to know how pushing works, you can do the following: |
| 79 | + |
| 80 | +1. Go to [this page](https://app.cachix.org/organization/metacraft-labs/cache/metacraft-labs-codetracer/settings/authtokens) |
| 81 | +1. Create an auth token with `Read+Write` permissions |
| 82 | +1. Locally register it as described in the above heading |
| 83 | + |
| 84 | +To push the dev shell to `cachix` use either one of the following commands: |
| 85 | + |
| 86 | +1. Automatically: `just cachix-push-devshell` |
| 87 | +1. Manually: `cachix push metacraft-labs-codetracer "$(nix build --print-out-paths .#devshells.x86_64-linux.default)"` |
| 88 | + |
0 commit comments