Merge pull request #252 from zorp-corp/la/dev-docs

DEVELOPERS: update the removal of references to Nix and old Urbit code
This commit is contained in:
Edward Amsden 2024-08-22 13:27:03 -05:00 committed by GitHub
commit cd3e90bbd1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,27 +1,5 @@
# Developing Sword # Developing Sword
## Nix
Sword uses a Nix developer shell to set up the environment for rust builds. Please [Install Nix](https://nixos.org/download#download-nix).
With Nix installed, you can run
```bash
nix develop
```
in `rust/` or any subdirectory, and you will be dropped into a BASH shell with the build environment set up. This will provide proper versions of non-rust dependencies, as well as the rust environment.
If you receive the error
```
error: experimental Nix feature 'nix-command' is disabled; use '--extra-experimental-features nix-command' to override
```
edit your `$HOME/.config/nix/nix.conf` to include the line
```
extra-experimental-features = nix-command
```
## Rust ## Rust
### Build ### Build
@ -34,23 +12,6 @@ cargo build
to build the Sword executable. This will place the built executable at `target/debug/sword` under the `rust/sword` directory. to build the Sword executable. This will place the built executable at `target/debug/sword` under the `rust/sword` directory.
### Run
Sword is made to run as an urbit "serf", meaning it is intended to be invoked by a "king" which sends it commands and performs side-effects specified by its output. We use the Vere king.
To run the Vere king with Sword as serf, it's necessary to modify the Vere king to launch Sword instead of its own serf. This is done by modifying the executable of the serf protocol in the `u3_lord_init` function in `lord.c` of the Vere source:
```C
// arg_c[0] = god_u->bin_c;
arg_c[0] = "/path/to/sword/repo/rust/sword/target/debug/sword";
```
Then, it is necessary to follow the [Vere build instrcutions](https://github.com/urbit/vere/blob/develop/INSTALL.md). (You should exit the `nix develop` shell first for such a build.) Afterwards, it's possible to launch Vere with Sword as the serf using the usual commands:
```bash
bazel-bin/pkg/vere/urbit -F zod
```
#### Pills #### Pills
Sword development and testing, unlike regular development and ship operation, currently requires careful control over what pill is used to launch a ship. Currently, there are several pills available in `resources/pills/`: Sword development and testing, unlike regular development and ship operation, currently requires careful control over what pill is used to launch a ship. Currently, there are several pills available in `resources/pills/`: