Skip to content
This repository was archived by the owner on Feb 6, 2026. It is now read-only.

Commit 9c0fe4c

Browse files
merge: #2389
2389: Convert DEVELOPING in to separate docs (ENG-1695) r=nickgerace a=nickgerace ## View The New Docs [Click me!](https://github.com/systeminit/si/tree/nick/a72d7d8/docs) ## Commit Description - Replace all test commands from cargo into buck2 - Replace all doc commands from cargo into buck2 - Expand DEVELOPING sections into different files - Convert preparing changes file into rust tests file - Create new preparing changes files and collapse squashing/rebasing docs into it ## GIF <img src="https://media1.giphy.com/media/QAsHga1AB6dIGUsui6/giphy.gif"/> Co-authored-by: Nick Gerace <nick@systeminit.com>
2 parents fb79236 + 87fef0b commit 9c0fe4c

13 files changed

Lines changed: 253 additions & 364 deletions

README.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This is a monolithic repository containing the source for System Initiative (SI)
66

77
Running SI locally can be done in a variety of ways, but this abbreviated section will focus on a single method for
88
getting your environment ready to run the stack.
9-
For more information regarding environment setup and running SI locally, see [DEVELOPING](DEVELOPING.md).
9+
For more information regarding environment setup and running SI locally, see [DEVELOPMENT_ENVIRONMENT](./docs/DEVELOPMENT_ENVIRONMENT.md).
1010

1111
### Choose a Supported Platform
1212

@@ -135,12 +135,6 @@ Alternatively, if you wish to keep your data for later use, you can stop the con
135135
buck2 run dev:stop
136136
```
137137

138-
## Additional Information For Environment Setup and Running the Stack
139-
140-
For more information regarding the environment setup process and running the stack, refer to
141-
[DEVELOPING](./DEVELOPING.md).
142-
You can also refer to the [docs directory](./docs) for even more details.
143-
144138
## Architecture
145139

146140
The diagram (created with [asciiflow](https://asciiflow.com)) below illustrates a _very_ high-level overview of SI's calling stack.

docs/CODE_DOCUMENTATION.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,16 @@ Where do you look?
99
You can generate and open the docs in your browser to find out!
1010

1111
```bash
12-
cargo doc --no-deps --document-private-items --open
12+
buck2 run //lib/dal:doc -- --document-private-items --open
1313
```
1414

1515
Our Rust crates contain module and documentation comments that can be generated into static webpages by `rustdoc`.
16-
When in doubt, see if `cargo doc` has what you are looking for.
16+
When in doubt, see if `doc` target for a Rust-based library has what you are looking for.
1717

1818
## How Do We Generate Rust Documentation?
1919

20-
As previously mentioned, for our Rust crates, we leverage `rustdoc` for seamless integration with `cargo doc`
21-
, [IntelliJ Rust](https://www.jetbrains.com/rust/),
22-
[rust-analyzer](https://rust-analyzer.github.io/), and more.
20+
As previously mentioned, for our Rust crates, we leverage `rustdoc` for seamless integration with
21+
[IntelliJ Rust](https://www.jetbrains.com/rust/), [rust-analyzer](https://rust-analyzer.github.io/), and more.
2322

2423
## Writing Rust Documentation
2524

Lines changed: 21 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,15 @@
1-
# Developing
1+
# Development Environment
22

3-
This document contains knowledge-base-esque information related to running and developing the System Initiative software.
4-
Since this document cannot fit everything, you can check out the contents of the [docs directory](./docs) for even more information.
5-
6-
## Table of Contents
7-
8-
- [Development Environment](#development-environment)
9-
- [Learning About SI Concepts](#learning-about-si-concepts)
10-
- [Repository Structure](#repository-structure)
11-
- [Preparing Your Changes and Running Tests](#preparing-your-changes-and-running-tests)
12-
13-
## Development Environment
14-
15-
Developing SI locally can be done in a variety of ways, but the officially supported method is to use the [Nix Flake](flake.nix)
3+
Developing SI locally can be done in a variety of ways, but the officially supported method is to use the [Nix Flake](../flake.nix)
164
at the root of the repository.
175

18-
### Supported Platforms
6+
## Supported Platforms
197

208
Using the flake requires using one of the below platforms.
219
It is possible that the System Initiative software can be developed on even more platforms, but these platforms have
2210
been validated to work with `nix` and the corresponding flake.
2311

24-
#### macOS
12+
### macOS
2513

2614
macOS (Darwin) is officially supported on both x86_64 (amd64) (also known as "Intel") and aarch64 (arm64) (also known as
2715
"Apple Silicon") architectures.
@@ -33,15 +21,15 @@ You can either install it via directions from the official support page or by ru
3321

3422
On macOS, you will likely hit the [file descriptor limit](#file-descriptor-limit) problem, which requires user intervention.
3523

36-
#### Linux
24+
### Linux
3725

3826
Linux (GNU) is officially supported on both x86_64 (amd64) and aarch64 (arm64) architectures.
3927
[NixOS](https://nixos.org/) is not supported at this time, but may be desired in the future.
4028
Linux with MUSL instead of GNU is also not currently supported.
4129
For Fedora, RHEL-derivative and other [SELinux](https://en.wikipedia.org/wiki/Security-Enhanced_Linux) users, SELinux
4230
will likely need to be set to `permissive` mode or configured to work with `nix`.
4331

44-
#### Windows
32+
### Windows
4533

4634
Using native Windows is not supported at this time, but may be desired in the future.
4735
However, [WSL2](https://learn.microsoft.com/en-us/windows/wsl/) on Windows 10 and Windows 11 is officially supported on
@@ -50,7 +38,7 @@ In order to work with `nix`, `systemd` may need to be enabled in your WSL2 distr
5038

5139
On WSL2, you will likely hit the [file descriptor limit](#file-descriptor-limit) problem, which requires user intervention.
5240

53-
#### File Descriptor Limit
41+
### File Descriptor Limit
5442

5543
On some systems, you may need to significantly increasing the file descriptor limit for `buck2`.
5644
This is because `buck2` opens many more files than either `cargo` or `pnpm` do.
@@ -69,11 +57,11 @@ Here is an example of a significant limit increase, where the argument provided
6957
ulimit -n 10240
7058
```
7159

72-
### Dependencies
60+
## Dependencies
7361

7462
For all supported platforms, there are two dependencies that must be installed, `nix` (preferably from [Zero to Nix](https://zero-to-nix.com/start/install)) and `docker`.
7563

76-
#### Nix
64+
### Nix
7765

7866
We use `nix` as our package manager for the repository.
7967
It ensures that our developers are all using the same versions of all packages and libraries for developing SI.
@@ -82,12 +70,12 @@ Regardless of how `nix` is installed, it must have the [flakes](https://nixos.wi
8270
We highly recommend using the [Zero to Nix](https://zero-to-nix.com/start/install) installer over the
8371
official installer; one reason being that the former will enable flakes by default.
8472

85-
> You can use `direnv` (version >= 2.30) with our [Nix flake](./flake.nix) for both ease of running commands
73+
> You can use `direnv` (version >= 2.30) with our [Nix flake](../flake.nix) for both ease of running commands
8674
> and for editor integration.
87-
>
75+
>
8876
> For more information, see the **Direnv** section.
8977
90-
#### Docker
78+
### Docker
9179

9280
We use `docker` to run our dependent services for the SI stack.
9381
It can either be installed via [Docker Desktop](https://www.docker.com/products/docker-desktop/) or
@@ -96,10 +84,10 @@ directly via [Docker Engine](https://docs.docker.com/engine/).
9684
For Docker Desktop, the version corresponding to your native architecture should be used (e.g. install the aarch64
9785
(arm64) version on a Apple-Silicon-equipped MacBook Pro).
9886

99-
WSL2 users should be able to use either Docker Desktop for WSL2 or Docker Engine (i.e. installing and using
87+
WSL2 users should be able to use either Docker Desktop for WSL2 or Docker Engine (i.e. installing and using
10088
`docker` within the distro and not interacting with the host).
10189

102-
#### (Optional) Direnv
90+
### (Optional) Direnv
10391

10492
[Direnv](https://direnv.net/) (version >= 2.30) with [nix-direnv](https://github.com/nix-community/nix-direnv) can
10593
automatically set up your shell, which means you don't need to enter a subshell with `nix develop`, or prefix all
@@ -129,7 +117,7 @@ There are also plugins to integrate `direnv` with common editors.
129117
- (Neo)Vim: [direnv.vim](https://github.com/direnv/direnv.vim)
130118
- Visual Studio Code: [direnv](https://marketplace.visualstudio.com/items?itemName=mkhl.direnv)
131119

132-
### How to Run Commands
120+
## How to Run Commands
133121

134122
All commands need to be run from the `nix` environment.
135123
There are two primary options to do so:
@@ -139,7 +127,7 @@ There are two primary options to do so:
139127
2. Otherwise, you can execute `nix develop` to enter the environment, `nix develop --command <command>` to
140128
execute a command, or use the environment in whatever way your prefer.
141129

142-
### Troubleshooting Potential Service Conflicts
130+
## Troubleshooting Potential Service Conflicts
143131

144132
SI uses external services in conjunction with its native components.
145133
These external services are deployed via [`docker compose`](https://docs.docker.com/compose/) and are configured to stick to their default settings as
@@ -155,55 +143,19 @@ Potentially conflicting services include, but are not limited to, the following:
155143
In the case of a port conflict, a good strategy is to temporarily disable the host service until SI is no longer being
156144
run.
157145

158-
### How Will I Know That Each Component Is Ready?
146+
## How Will I Know That Each Component Is Ready?
159147

160148
For backend services like `veritech` and `sdf`, there will usually be an `INFO`-level log indicating that the
161149
webserver has bound to a port and is ready to receive messages.
162150
This may be subject to change (e.g. underlying library is upgraded to a new major version and the startup sequence
163151
changes) and will vary from component to component.
164152

165-
### Using CLion Run Configurations Instead of Terminal Panes
153+
## (Outdated) Using CLion Run Configurations Instead of Terminal Panes
154+
155+
_Please note: this section is a work in progress._
166156

167157
This repository contains CLion run configurations for most of these targets, in addition to a `Run SI` compound target
168158
for running all the targets at once. They should be listed on the run menu automatically and are called
169159
`Prepare`, `Run [SDF | Veritech | Pinga | Web]` and `Teardown` (which is related to the next topic).
170160

171-
Using them you should be able to run the whole stack via CLion's Run tool window instead of using multiple shells!
172-
173-
## Learning About SI Concepts
174-
175-
As referenced in [CODE_DOCUMENTATION](docs/CODE_DOCUMENTATION.md), the `rustdoc` static webpages are an entrypoint
176-
into learning about the Rust modules and structs that back many SI concepts.
177-
178-
Let's say you want to learn about what a `Component` is.
179-
You can generate and open the Rust documentation locally via the following command:
180-
181-
```bash
182-
cargo doc --no-deps --document-private-items --open
183-
```
184-
185-
Moreover, there are resources in [docs](./docs), [designs](./designs), our Miro boards, and our Figma projects that
186-
may prove useful as well.
187-
188-
## Repository Structure
189-
190-
While there are other directories in the project, these are primarily where
191-
most of the interesting source code lives and how they are generally organized:
192-
193-
| Directory | Description |
194-
|--------------|----------------------------------------------------------------|
195-
| `app/` | Web front ends, GUIs, or other desktop applications |
196-
| `bin/` | Backend programs, CLIs, servers, etc. |
197-
| `component/` | Docker container images and other ancillary tooling |
198-
| `lib/` | Supporting libraries and packages for services or applications ||
199-
200-
## Preparing Changes and Running Tests
201-
202-
We highly recommend following the [Convential Commits](https://www.conventionalcommits.org/en/v1.0.0/#specification) format when committing changes.
203-
Our prefixes are derived from the official specification as well as the those found in [commitlint](https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional), based on [Angular's commit conventions](https://github.com/angular/angular/blob/master/CONTRIBUTING.md).
204-
When in doubt, use `feat`, `fix`, or `chore`!
205-
206-
Moreover, please sign your commits using `git commit -s`.
207-
You can amend an existing commit with `git commit -s --amend`, if needed.
208-
209-
Please see [the relevant document](docs/PREPARING_CHANGES_AND_RUNNING_TESTS.md) for more information.
161+
Using them you should be able to run the whole stack via CLion's Run tool window instead of using multiple shells!

docs/EDITORS_AND_IDES.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Editors and IDEs
2+
3+
This document contains information related to using editors and IDEs when developing the System Initiative software.
4+
5+
## Seeing Errors Related to Procedural Macros
6+
7+
In your editor, you may find that you'll see errors like `"YourEnum does not implement Display"` if you are using
8+
[`Display` from the `strum` crate](https://docs.rs/strum/latest/strum/derive.Display.html).
9+
This is because your editor may not have proc (procedural) macros enabled.
10+
11+
As of 15 September 2022, this feature is not enabled in [IntelliJ Rust](https://www.jetbrains.com/rust/) by default and
12+
can cause the [aforementioned issue](https://github.com/intellij-rust/intellij-rust/issues/8847) to occur (which
13+
affects all [JetBrains](https://www.jetbrains.com/) IDEs, such as [CLion](https://www.jetbrains.com/clion/)).
14+
Thus, you will have to use the experimental proc macros feature or wait for stable proc macros support.
15+
16+
## Direnv
17+
18+
For notes on using plugins with `direnv`, see [`DEVELOPMENT_ENVIRONMENT`](./DEVELOPMENT_ENVIRONMENT.md).

docs/LEARNING_ABOUT_SI_CONCEPTS.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Learning About SI Concepts
2+
3+
As referenced in [CODE_DOCUMENTATION](./CODE_DOCUMENTATION.md), the `rustdoc` static webpages are an entrypoint
4+
into learning about the Rust modules and structs that back many SI concepts.
5+
6+
Let's say you want to learn about what a `Component` is.
7+
You may want to open the docs for the [dal](../lib/dal) as it is the center of many SI concepts.
8+
9+
You can generate and open the Rust documentation locally via the following command:
10+
11+
```bash
12+
buck2 run lib/dal:doc -- --document-private-items --open
13+
```

0 commit comments

Comments
 (0)