2019-06-17 13:44:08 +03:00
|
|
|
# Contributing to Urbit
|
|
|
|
|
2019-08-28 19:10:50 +03:00
|
|
|
Thank you for your interest in contributing to Urbit.
|
2019-06-17 13:44:08 +03:00
|
|
|
|
2020-09-01 04:35:52 +03:00
|
|
|
See [urbit.org/using/install][start] for basic orientation and usage
|
2019-08-28 19:10:50 +03:00
|
|
|
instructions. You may also want to subscribe to [urbit-dev][list], the Urbit
|
|
|
|
development mailing list. For specific information on contributing to the Urbit
|
2019-08-28 19:00:04 +03:00
|
|
|
interface, see its [contribution guidelines][interface].
|
2019-06-17 13:44:08 +03:00
|
|
|
|
2020-09-01 04:35:52 +03:00
|
|
|
For information on Arvo's maintainers, see [pkg/arvo][main].
|
|
|
|
|
2022-01-05 00:20:29 +03:00
|
|
|
For more extensive information on Urbit development, such as how to set up an
|
|
|
|
environment and how to submit a grant, see the [developer documentation][dev].
|
|
|
|
|
2020-09-01 04:35:52 +03:00
|
|
|
[start]: https://urbit.org/using/install
|
2019-08-28 19:00:04 +03:00
|
|
|
[interface]: /pkg/interface/CONTRIBUTING.md
|
2022-01-05 00:20:29 +03:00
|
|
|
[dev]: https://urbit.org/docs/development
|
2019-06-17 13:44:08 +03:00
|
|
|
|
|
|
|
## Fake ships
|
|
|
|
|
|
|
|
You may have an identity on the live network, but doing all your development on
|
|
|
|
the live network would be cumbersome and unnecessary. Standard practice in
|
2019-08-28 19:10:50 +03:00
|
|
|
Urbit development is to work on a fake `~zod`. Fake ships use deterministic
|
2019-06-17 13:44:08 +03:00
|
|
|
keys (derived from the ship address) and don't talk to the live network. They
|
|
|
|
can talk to each other over the local loopback.
|
|
|
|
|
|
|
|
To start a fake ship, simply specify the name with `-F`:
|
|
|
|
|
|
|
|
```
|
|
|
|
$ urbit -F zod
|
|
|
|
```
|
|
|
|
|
|
|
|
You can also pass a name for the *pier* (or ship directory):
|
|
|
|
|
|
|
|
```
|
|
|
|
$ urbit -F zod -c my-fake-zod
|
|
|
|
```
|
|
|
|
|
|
|
|
To resume a fake ship, just pass the name of the pier:
|
|
|
|
|
|
|
|
```
|
|
|
|
$ urbit my-fake-zod
|
|
|
|
```
|
|
|
|
|
2020-09-29 04:58:35 +03:00
|
|
|
Fake ships by default use the same pre-compiled kernelspace ('pills') as livenet
|
|
|
|
ships do: boot pills, which are not always current with `master`. If you wish to
|
|
|
|
develop using code off the master branch, run the following from the repo
|
|
|
|
directory:
|
|
|
|
|
|
|
|
```
|
|
|
|
git lfs install
|
|
|
|
git lfs pull
|
|
|
|
urbit -F zod -B "bin/solid.pill" -A "pkg/arvo"
|
|
|
|
```
|
|
|
|
|
2019-06-17 13:44:08 +03:00
|
|
|
## Git practice
|
|
|
|
|
2019-08-28 17:32:44 +03:00
|
|
|
### Contributing
|
2019-06-17 13:44:08 +03:00
|
|
|
|
2019-10-06 18:03:26 +03:00
|
|
|
The canonical source tree is the `master` branch of
|
2019-08-28 17:32:44 +03:00
|
|
|
[https://github.com/urbit/urbit][repo]. You should typically branch off of
|
2022-01-05 00:20:29 +03:00
|
|
|
`master` when commencing new work. Most pull requests should be merging into
|
|
|
|
one of the `next/*` branches, depending on what part of the system the pull
|
|
|
|
request is targeting.
|
2019-06-17 13:44:08 +03:00
|
|
|
|
2020-09-01 04:35:52 +03:00
|
|
|
Since we use GitHub, we request you contribute via a GitHub pull request. Tag
|
|
|
|
the [maintainer][main] for the component. If you have a question for the
|
|
|
|
maintainer, you can direct message them from your Urbit ship using that
|
|
|
|
information.
|
2019-06-17 13:44:08 +03:00
|
|
|
|
2019-10-06 17:57:47 +03:00
|
|
|
When contributing changes, via whatever means, make sure you describe them
|
|
|
|
appropriately. You should attach a reasonably high-level summary of what the
|
|
|
|
changes are and what they do; reference any useful background material that may
|
|
|
|
exist, e.g. a GitHub issue, a mailing list discussion, a UP, etc. [Here][jbpr]
|
|
|
|
is a good example of a pull request with a useful, concise description.
|
|
|
|
|
|
|
|
If your changes replace significant extant functionality, be sure to compare
|
2020-09-01 04:35:52 +03:00
|
|
|
them with the thing you're replacing. You may also want to cc reviewers,
|
|
|
|
or other parties who might have a particular interest in what you're
|
2019-10-06 17:57:47 +03:00
|
|
|
contributing.
|
|
|
|
|
|
|
|
[jbpr]: https://github.com/urbit/urbit/pull/1782
|
|
|
|
|
2019-08-28 17:32:44 +03:00
|
|
|
### Hygiene
|
2019-06-17 13:44:08 +03:00
|
|
|
|
2019-08-28 17:32:44 +03:00
|
|
|
Commits should generally be relevant, atomic, and have descriptions formatted
|
|
|
|
in the following manner:
|
2019-06-17 13:44:08 +03:00
|
|
|
|
2019-08-28 18:51:22 +03:00
|
|
|
> component: short description
|
2019-08-28 17:32:44 +03:00
|
|
|
>
|
2019-08-28 18:51:22 +03:00
|
|
|
> long description
|
2019-06-17 13:44:08 +03:00
|
|
|
|
2019-08-28 17:32:44 +03:00
|
|
|
The 'component' is a short prefix of what area of the codebase the commit
|
|
|
|
applies to. If a commit patches `%gall`, for example, the description should
|
|
|
|
be prefixed by 'gall'. If it touches `:aqua`, it should be prefixed by 'aqua'.
|
|
|
|
If it touches multiple components, then separate these by commas, e.g. "gall,
|
|
|
|
aqua, ph" -- but note that this may be a warning that too many changes are
|
2019-08-28 18:51:22 +03:00
|
|
|
being packed into a single commit. The 'component' and 'short description'
|
|
|
|
combined should be no more than 50 characters.
|
2019-06-17 13:44:08 +03:00
|
|
|
|
2019-11-07 12:14:41 +03:00
|
|
|
A lengthier description is encouraged, where useful, but is not always strictly
|
|
|
|
required. You should use the longer description to give any useful background
|
|
|
|
on or motivation for the commit, provide a summary of what it does, link to
|
|
|
|
relevant issues, proposals, or other commits, and so on.
|
2019-06-17 13:44:08 +03:00
|
|
|
|
2019-11-07 12:14:41 +03:00
|
|
|
Here is an example of our commit format, taken from a commit in the history:
|
2019-06-17 13:44:08 +03:00
|
|
|
|
2019-08-28 17:32:44 +03:00
|
|
|
> zuse: remove superfluous 'scup' and 'culm' types.
|
|
|
|
>
|
|
|
|
> %zuse includes definitions for 'scup' and 'culm', both of which are
|
|
|
|
> superfluous. 'scup' is simply (pair ship desk) and is used only in
|
|
|
|
> the definition of 'culm', a tagged union in which three of the four
|
|
|
|
> branches are commented out (i.e. are unused).
|
|
|
|
>
|
|
|
|
> This commit deletes 'scup' and 'culm' and refactors what little code
|
|
|
|
> made use of them.
|
2019-06-17 13:44:08 +03:00
|
|
|
|
2019-11-07 12:14:41 +03:00
|
|
|
Note that the short description is prefixed by `zuse:`, which is what the
|
|
|
|
commit touches. Otherwise it just includes a summary of the change.
|
|
|
|
|
|
|
|
Here's another example:
|
|
|
|
|
|
|
|
> build: give arvo a high priority
|
|
|
|
>
|
|
|
|
> 0bdced981e4 introduced the 'arvo-ropsten' derivation. Attempting to
|
|
|
|
> install both 'arvo' and 'arvo-ropsten' via nix-env will result in a
|
|
|
|
> priority error; this assigns a higher priority to 'arvo' to resolve the
|
|
|
|
> conflict.
|
|
|
|
>
|
|
|
|
> Fixes #1912.
|
|
|
|
|
|
|
|
Note that it cites a previous relevant commit, `0bdced981e4`, in its summary,
|
|
|
|
and also points at the issue that it resolves.
|
|
|
|
|
2019-08-28 17:32:44 +03:00
|
|
|
If you're in doubt about how to format your commit descriptions, take a look at
|
|
|
|
the recent history and try to mimic the style that you can see others broadly
|
|
|
|
follow there.
|
|
|
|
|
|
|
|
When we say commits should be "atomic", we mean with respect to some distinct
|
|
|
|
logical unit, e.g. a type definition used across many files, or a single file,
|
|
|
|
or just a single function in a single file. Commits should be atomic at the
|
|
|
|
level of *code*, not of entire features. You don't have to squash your commits
|
|
|
|
into a single one that captures everything you're trying to do -- the history
|
|
|
|
will never make for pleasant bedtime reading, so focus instead on making your
|
|
|
|
commits useful for tools like `git-blame` and `git-bisect`.
|
|
|
|
|
|
|
|
Your contribution must apply cleanly to `master` in order to be considered
|
|
|
|
mergeable. You may want to regularly [rebase your changes][reba] onto `master`
|
|
|
|
in order to both clean up any intermediate "development" commits you make and
|
|
|
|
to ensure that you're up to date.
|
|
|
|
|
|
|
|
If you're making a GitHub pull request, it's good practice to make it from a
|
|
|
|
topic branch, rather than `master`, on your fork.
|
|
|
|
|
|
|
|
### Pills
|
|
|
|
|
|
|
|
Any contribution that touches the kernel (i.e., anything in `pkg/arvo/sys`),
|
|
|
|
should be accompanied by an updated [solid pill](#the-kernel-and-pills). Pills
|
|
|
|
are tracked in the repository via [git LFS][git-lfs].
|
|
|
|
|
|
|
|
Whenever you make a contribution to the kernel, please create a new solid pill
|
|
|
|
via:
|
2019-06-17 13:44:08 +03:00
|
|
|
|
|
|
|
```
|
2019-08-28 17:32:44 +03:00
|
|
|
sh/update-solid-pill
|
2019-06-17 13:44:08 +03:00
|
|
|
```
|
|
|
|
|
2019-11-07 12:14:41 +03:00
|
|
|
and include it along with your contribution.
|
|
|
|
|
|
|
|
Historically, we've sometimes included these updated pills in separate,
|
|
|
|
standalone commits (you will see plenty of "pills: update solid" and similar
|
|
|
|
commits if you look through the history), but this practice is considered to be
|
|
|
|
deprecated -- you should usually just include the updated pill in the same
|
|
|
|
commit that updates the source.
|
2019-08-28 17:32:44 +03:00
|
|
|
|
|
|
|
## Releases
|
2019-06-17 13:44:08 +03:00
|
|
|
|
2020-03-16 10:32:55 +03:00
|
|
|
We typically create releases by tagging appropriate commits on `master`, so any
|
|
|
|
given commit in `master` may not actually be present in the latest release.
|
2019-06-17 13:44:08 +03:00
|
|
|
|
2019-08-28 17:32:44 +03:00
|
|
|
We perform updates by pushing releases over-the-air to `~zod` approximately
|
|
|
|
once per week, so any contribution that can be deployed OTA will usually find
|
|
|
|
its way onto the network pretty rapidly.
|
|
|
|
|
2019-09-28 13:43:31 +03:00
|
|
|
If you want to propose a hotfix (i.e. a small, OTA-updateable change, usually a
|
|
|
|
bugfix, to some currently-deployed release) then simply make it clear that your
|
|
|
|
contribution -- whether it be a pull request, patch, or whatever -- is intended
|
|
|
|
to be a hotfix. A maintainer can then deploy it to the network outside of the
|
|
|
|
normal release schedule.
|
|
|
|
|
2019-08-28 17:32:44 +03:00
|
|
|
Less frequently we release new Vere versions, which requires users to download
|
|
|
|
new binaries, and occasionally, while Urbit is still in early development, we
|
|
|
|
breach network continuity in order to release large changes that are difficult
|
|
|
|
to push out over-the-air. Contributions to Vere, or non-OTA-able updates to
|
|
|
|
Arvo, will find their way into releases before terribly long.
|
2019-06-17 13:44:08 +03:00
|
|
|
|
2019-08-28 17:38:17 +03:00
|
|
|
## Code style
|
|
|
|
|
2019-08-28 19:10:50 +03:00
|
|
|
The Urbit project uses two-space indentation and avoids tab characters.
|
2019-06-17 13:44:08 +03:00
|
|
|
In C code, it should not be too difficult to mimic the style of the code
|
|
|
|
around you, which is just fairly standard K&R with braces on every
|
|
|
|
compound statement. One thing to watch out for is top-level sections in
|
|
|
|
source files that are denoted by comments and are actually indented one
|
|
|
|
level.
|
|
|
|
|
2019-08-28 18:59:50 +03:00
|
|
|
Hoon will be a less familiar language to many contributors. We've published
|
|
|
|
some [style guidelines for Hoon][hoon], but above all you should try to mimic
|
|
|
|
the style of the code around you. With regards to the style used throughout
|
|
|
|
the codebase: the more recently the code was written, the more standard and
|
|
|
|
accepted its style is likely to be.
|
2019-06-17 13:44:08 +03:00
|
|
|
|
|
|
|
## Kernel development
|
|
|
|
|
|
|
|
Working on either C or non-kernel Hoon should not bring any surprises, but the
|
2019-07-15 13:40:53 +03:00
|
|
|
Hoon kernel (anything under [`pkg/arvo/sys/`][sys]) is bootstrapped from a
|
|
|
|
so-called *pill*, and must be recompiled if any changes are made. This should
|
2019-06-17 13:44:08 +03:00
|
|
|
happen automatically when you make changes, but if it doesn't, the command to
|
|
|
|
manually recompile and install the new kernel is `|reset` in `dojo`. This
|
2022-03-06 19:55:55 +03:00
|
|
|
rebuilds from the `sys` directory in the `base` desk in `%clay`.
|
2019-06-17 13:44:08 +03:00
|
|
|
|
|
|
|
Currently, `|reset` does not reload apps like `dojo` itself, which will still
|
|
|
|
reference the old kernel. To force them to reload, make a trivial edit to their
|
|
|
|
main source file (under the `app` directory) in `%clay`.
|
|
|
|
|
2019-07-15 13:40:53 +03:00
|
|
|
[arvo]: https://github.com/urbit/urbit/tree/master/pkg/arvo
|
|
|
|
[sys]: https://github.com/urbit/urbit/tree/master/pkg/arvo/sys
|
2019-06-17 13:44:08 +03:00
|
|
|
|
|
|
|
## The kernel and pills
|
|
|
|
|
|
|
|
Urbit bootstraps itself using a binary blob called a pill (you can see it being
|
|
|
|
fetched from `bootstrap.urbit.org` on boot). This is the compiled version of
|
2019-07-15 13:40:53 +03:00
|
|
|
the kernel (which you can find in the `sys` directory of [Arvo][arvo]), along
|
|
|
|
with a complete copy of the Arvo source.
|
2019-06-17 13:44:08 +03:00
|
|
|
|
|
|
|
The procedure for creating a pill is often called "soliding." It is somewhat
|
|
|
|
similar to `|reset`, but instead of replacing your running kernel, it writes
|
|
|
|
the compiled kernel to a file. The command to solid is:
|
|
|
|
|
|
|
|
```
|
|
|
|
> .urbit/pill +solid
|
|
|
|
```
|
|
|
|
|
|
|
|
When the compilation finishes, your pill will be found in the
|
|
|
|
`[pier]/.urb/put/` directory as `urbit.pill`.
|
|
|
|
|
|
|
|
You can boot a new ship from your local pill with `-B`:
|
|
|
|
|
|
|
|
```
|
|
|
|
$ urbit -F zod -B path/to/urbit.pill my-fake-zod
|
|
|
|
```
|
|
|
|
|
2019-08-28 17:46:35 +03:00
|
|
|
Release pills, i.e. those corresponding to vere releases, are cached at
|
|
|
|
`https://bootstrap.urbit.org` and are indexed by the vere version number, e.g.
|
|
|
|
`urbit-0.8.2.pill`.
|
2019-07-15 13:40:53 +03:00
|
|
|
|
|
|
|
Pills are also cached in version control via [git LFS][git-lfs]. You can find
|
2019-08-28 17:46:35 +03:00
|
|
|
the latest solid pill, as well as the latest so-called *brass* and *ivory*
|
|
|
|
pills, in the `bin/` directory at the repository root. Note that you'll need
|
|
|
|
to initialise git LFS in order to check these pills out:
|
2019-07-15 13:40:53 +03:00
|
|
|
|
|
|
|
```
|
|
|
|
$ git lfs init
|
|
|
|
$ git lfs pull
|
2019-06-17 13:44:08 +03:00
|
|
|
```
|
|
|
|
|
2019-07-15 13:40:53 +03:00
|
|
|
[git-lfs]: https://git-lfs.github.com
|
|
|
|
|
2019-08-28 18:20:09 +03:00
|
|
|
## Issues
|
|
|
|
|
|
|
|
The [GitHub tracker][issu] is our canonical source of truth around issues,
|
|
|
|
bugs, performance problems, feature requests, and so on. If you encounter any
|
2019-08-28 19:10:50 +03:00
|
|
|
issues when developing on Urbit, feel free to submit a report about it here.
|
2019-08-28 18:20:09 +03:00
|
|
|
|
|
|
|
A good bug report, description of a crash, etc., should ideally be
|
2019-08-28 19:01:38 +03:00
|
|
|
*reproducible*, with clear steps as to how another developer can replicate and
|
|
|
|
examine your problem. That said, this isn't always possible -- some bugs
|
|
|
|
depend on having created a complicated or unusual state, or can otherwise
|
|
|
|
simply be difficult to trigger again (say, you encountered it in the last
|
|
|
|
continuity era).
|
2019-08-28 18:20:09 +03:00
|
|
|
|
|
|
|
Your issue should thus at a minimum be *informative*. The best advice here is
|
|
|
|
probably "don't write bad issues," where "bad" is a matter of judgment and
|
|
|
|
taste. Issues that the maintainers don't judge to be sufficiently useful or
|
|
|
|
informative may be closed.
|
|
|
|
|
|
|
|
Feature requests are welcome, but they should include sufficient detail and
|
|
|
|
explanation, as well as a discussion of perceived benefits one could expect
|
|
|
|
from them. "It would be cool if.." probably does not, in itself, constitute a
|
|
|
|
good feature request; instead, try to be specific about what you're requesting,
|
|
|
|
and what your desired feature would accomplish.
|
2019-06-17 13:44:08 +03:00
|
|
|
|
|
|
|
## Staying in touch
|
|
|
|
|
|
|
|
Questions or other communications about contributing to Urbit can go to
|
|
|
|
[support@urbit.org][mail].
|
|
|
|
|
|
|
|
[mail]: mailto:support@urbit.org
|
2019-08-28 17:32:44 +03:00
|
|
|
[list]: https://groups.google.com/a/urbit.org/forum/#!forum/dev
|
|
|
|
[repo]: https://github.com/urbit/urbit
|
2019-12-18 14:59:22 +03:00
|
|
|
[reba]: https://git-rebase.io/
|
2019-08-28 18:20:09 +03:00
|
|
|
[issu]: https://github.com/urbit/urbit/issues
|
2022-01-05 00:20:29 +03:00
|
|
|
[hoon]: https://urbit.org/docs/hoon/reference/style
|
|
|
|
[main]: https://github.com/urbit/urbit/tree/master/pkg/arvo#maintainers
|