|
5 | 5 | Hypatia Engineering Processes
|
6 | 6 | =============================
|
7 | 7 |
|
8 |
| -Discuss engineering processes used in Hypatia. |
| 8 | +Hypatia code is collaboratively developed using a standard set |
| 9 | +of open source tools: |
| 10 | + |
| 11 | +* Revision control uses the https://git-scm.org[`git`] source |
| 12 | + control tool |
| 13 | +* The system is hosted on |
| 14 | + https://github.com/hypatia-hypervisor/hypatia.git[Github] |
| 15 | +* We use the github pull-request model and code review tools |
| 16 | + for collaborative development |
| 17 | +* The bulk of the software is written in Rust, with some parts |
| 18 | + written in assembly language. |
| 19 | +
|
| 20 | +Prerequisites |
| 21 | +------------- |
| 22 | +To work on Hypatia, one must first install a small set of |
| 23 | +prerequisites. Notably, one must install the `git` tools for |
| 24 | +revision control, and the Rust toolchain. Consult your local |
| 25 | +system documentation for the preferred way to install `git`; |
| 26 | +most engineers use the https://rustup.sh[`rustup`] tool to |
| 27 | +maintain the Rust installation. |
| 28 | + |
| 29 | +It can be very useful to install `qemu` for testing. Again, |
| 30 | +consult your local package manager documentation for details. |
| 31 | + |
| 32 | +Source Control |
| 33 | +-------------- |
| 34 | +The source code is hosted under the `hypatia-hypervisor` project |
| 35 | +on Github, in the `hypatia` repository; the canonical repository |
| 36 | +location is: |
| 37 | + |
| 38 | +https://github.com/hypatia-hypervisor/hypatia.git |
| 39 | + |
| 40 | +To check out the code, one may use: |
| 41 | + |
| 42 | +``` |
| 43 | +git clone https://github.com/hypatia-hypervisor/hypatia.git |
| 44 | +``` |
| 45 | + |
| 46 | +Building Hypatia |
| 47 | +---------------- |
| 48 | +We use the `cargo` tool with the `xtask` polyfill to build most |
| 49 | +the system. Run, |
| 50 | + |
| 51 | +``` |
| 52 | +cargo xtask --help |
| 53 | +``` |
| 54 | + |
| 55 | +to see what subcommands are available and their options. |
| 56 | +Highlights include, |
| 57 | + |
| 58 | +`cargo xtask build`:: Builds hypatia |
| 59 | +`cargo xtask test`:: Run unit tests |
| 60 | +`cargo xtask qemu`:: Boot hypatia under qemu (requires KVM) |
| 61 | +`cargo xtask clippy`:: Run the `clippy` linter |
| 62 | + |
| 63 | +Additionally, the `cargo check` command is supported for editor integration. |
| 64 | + |
| 65 | +Documentation |
| 66 | +------------- |
| 67 | +Hypatia is documented in Hypatia Design Proposals, or HDPs --- |
| 68 | +like the one that you are currently reading. These are either |
| 69 | +Markdown or asciidoc source files in numbered subdirectories |
| 70 | +under the `docs` directory in the repository root. |
| 71 | + |
| 72 | +General Development Workflows |
| 73 | +----------------------------- |
| 74 | +The Hypatia repository follows a linear history model; changes |
| 75 | +are rebased onto the `main` branch. |
| 76 | + |
| 77 | +In general, one will do local development in a branch of their |
| 78 | +choosing, and, once they feel that they are ready for a commit |
| 79 | +they will submit a pull request for integration into `main`. |
| 80 | +All non-trivial changes must be reviewed and approved by another |
| 81 | +engineer. There is also continuous integration support that |
| 82 | +runs workflows that enforce that code is lint-free, |
| 83 | +well-formatted, and that all tests pass. |
| 84 | + |
| 85 | +Each commit should have a well-written, grammatically correct |
| 86 | +change message that gives a high-level overview of commit's |
| 87 | +contents and the purpose of the change. Commit messages may |
| 88 | +freely reference Github issues, mark things as fixed, etc. All |
| 89 | +commits must be signed-off by the author (`git -s`). |
| 90 | + |
| 91 | +Multi-commit changes are allowed. However, each commit should |
| 92 | +stand alone in the sense that compiles and passes all tests, and |
| 93 | +the commits in the pull request should be logically related. |
| 94 | +Put colloquially, the commits in a request should "tell a |
| 95 | +story." Each such commit must be separately signed-off on. |
| 96 | + |
| 97 | +A common development practice is to do rough development work in |
| 98 | +a `wip` branch, committing frequently, possibly with less than |
| 99 | +stellar commit messages, and then squash-merge this the result |
| 100 | +into one or more commits with proper commit messages in a new |
| 101 | +branch when ready for sending a PR: this gives a developer |
| 102 | +flexibility to checkpoint their work often, be experimental, and |
| 103 | +generally explore the problem space before committing to a |
| 104 | +stable solution, while also keeping the overall commit history |
| 105 | +clean. |
0 commit comments