Permalink
Newer
100644
182 lines (141 sloc)
7.64 KB
3
- [Prerequisites](#prerequisites)
4
- [Getting and Building](#getting-and-building)
5
- [Style Guide](#style-guide)
6
- [Code Review Workflow](#code-review-workflow)
7
- [Debugging](#debugging)
8
9
## Prerequisites
10
11
Before you start contributing, review these [basic guidelines](https://www.cockroachlabs.com/docs/stable/contribute-to-cockroachdb.html) on finding a project, determining its complexity, and learning what to expect in your collaboration with the Cockroach Labs team.
12
15
1. Install the following prerequisites, as necessary:
16
- A C++ compiler that supports C++11. Note that GCC prior to 6.0 doesn't
19
the Makefile enforces the specific version required, as it is updated
20
frequently.
21
- Git 1.8+
22
- Bash (4+ is preferred)
23
- GNU Make (3.81+ is known to work)
24
- CMake 3.1+
25
- Autoconf 2.68+
26
- Optional: NodeJS 6.x and Yarn 0.22.0+. Required when compiling protocol
33
```shell
34
go get -d github.com/cockroachdb/cockroach
35
cd $GOPATH/src/github.com/cockroachdb/cockroach
36
```
39
that the first time you run `make`, it can take some time to download and
40
install various dependencies. After running `make build`, the `cockroach`
41
executable will be in your current directory and can be run as shown in the
46
- The default binary contains core open-source functionally covered by the
47
Apache License 2 (APL2) and enterprise functionality covered by the
48
CockroachDB Community License (CCL). To build a pure open-source (APL2)
49
version excluding enterprise functionality, use `make buildoss`. See this
50
[blog post] for more details.
51
52
[blog post]: https://www.cockroachlabs.com/blog/how-were-building-a-business-to-last/
59
can run `build/builder.sh make generate` from the repository root to get the
60
intended result.
64
- To add or update a Go dependency:
65
- See [`build/README.md`](build/README.md) for details on adding or updating
66
dependencies.
76
- All contributors need to sign the [Contributor License Agreement](https://cla-assistant.io/cockroachdb/cockroach).
79
If you are working on your own fork, see [this tip](http://blog.campoy.cat/2014/03/github-and-go-forking-pull-requests-and.html)
98
# Run a specific sql logic subtest
99
make test PKG=./pkg/sql TESTS='TestLogic$$/select$$'
104
Logs are disabled during tests by default. To enable them, include
105
`TESTFLAGS="-v -show-logs"` as an argument the test command:
106
107
```shell
108
make test ... TESTFLAGS="-v -show-logs"
109
```
110
111
When you're ready to commit, be sure to write a Good Commit Message™. Consult
112
https://github.com/erlang/otp/wiki/Writing-good-commit-messages if you're
113
not sure what constitutes a Good Commit Message™.
114
In addition to the general rules referenced above, please also prefix your
115
commit subject line with the affected package, if one can easily be chosen.
116
For example, the subject line of a commit mostly affecting the
117
`server/serverpb` package might read: "server/serverpb: made great again".
118
Commits which affect many packages as a result of a shared dependency change
119
should probably begin their subjects with the name of the shared dependency.
120
Finally, some commits may need to affect many packages in a way which does
121
not point to a specific package; those commits may begin with "*:" or "all:"
122
to indicate their reach.
133
and contain a substantial (but not overwhelming) unit of work. You may also
134
want to `git fetch origin` and run
141
- Then [create a pull request using GitHub’s UI](https://help.github.com/articles/creating-a-pull-request). If you know of
142
another GitHub user particularly suited to reviewing your pull request, be
143
sure to mention them in the pull request body. If you possess the necessary
144
GitHub privileges, please also [assign them to the pull request using
145
GitHub's UI](https://help.github.com/articles/assigning-issues-and-pull-requests-to-other-github-users/).
149
contains multiple commits, address each piece of feedback by amending that
150
commit to which the particular feedback is aimed. Wait (or ask) for new
151
feedback on those commits if they are not straightforward. An `LGTM` ("looks
152
good to me") by someone qualified is usually posted when you're free to go
153
ahead and merge. Most new contributors aren't allowed to merge themselves;
154
in that case, we'll do it for you.
161
`/debug/requests`. It has a breakdown of the recent traced requests, in
162
particularly slow ones. Two families are traced: `node` and `coord`, the
163
former (and likely more interesting one) containing what happens inside of
164
`Node`/`Store`/`Replica` and the other inside of the coordinator
167
heap and cpu profiles; [this golang blog post](http://blog.golang.org/profiling-go-programs) explains it extremely well and
168
[this one by Dmitry Vuykov](https://software.intel.com/en-us/blogs/2014/05/10/debugging-performance-issues-in-go-programs)
175
make acceptance TESTS='TestPut$$' TESTFLAGS='-v -d 1200s -l .' TESTTIMEOUT=1210s
176
```
177