Permalink
Newer
100644
178 lines (139 sloc)
7.48 KB
8
- A Go environment with a recent 64-bit version of the toolchain. Note that
9
the Makefile enforces the specific version required, as it is updated
10
frequently.
15
- XZ Utils (5.2.3+ is known to work), except on macOS, where xz support is
16
built in to `tar`.
17
- Optional: NodeJS 6.x and Yarn 0.22.0+. Required when compiling protocol
18
buffers.
25
go get -d github.com/cockroachdb/cockroach
26
cd $GOPATH/src/github.com/cockroachdb/cockroach
27
```
30
that the first time you run `make`, it can take some time to download and
31
install various dependencies. After running `make build`, the `cockroach`
32
executable will be in your current directory and can be run as shown in the
37
- The default binary contains core open-source functionally covered by the
38
Apache License 2 (APL2) and enterprise functionality covered by the
39
CockroachDB Community License (CCL). To build a pure open-source (APL2)
40
version excluding enterprise functionality, use `make buildoss`. See this
41
[blog post] for more details.
42
43
[blog post]: https://www.cockroachlabs.com/blog/how-were-building-a-business-to-last/
50
can run `build/builder.sh make generate` from the repository root to get the
51
intended result.
55
- To add or update a Go dependency:
56
- See [`build/README.md`](build/README.md) for details on adding or updating
57
dependencies.
67
+ All contributors need to sign the [Contributor License Agreement](https://cla-assistant.io/cockroachdb/cockroach).
70
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)
75
+ Hack away and commit your changes locally using `git add` and `git commit`.
76
Remember to write tests! The following are helpful for running specific
89
# Run a specific sql logic subtest
90
make test PKG=./pkg/sql TESTS='TestLogic$$/select$$'
95
Logs are disabled during tests by default. To enable them, include
96
`TESTFLAGS="-v -show-logs"` as an argument the test command:
97
98
```shell
99
make test ... TESTFLAGS="-v -show-logs"
100
```
101
102
When you're ready to commit, be sure to write a Good Commit Message™. Consult
103
https://github.com/erlang/otp/wiki/Writing-good-commit-messages if you're
104
not sure what constitutes a Good Commit Message™.
105
In addition to the general rules referenced above, please also prefix your
106
commit subject line with the affected package, if one can easily be chosen.
107
For example, the subject line of a commit mostly affecting the
108
`server/serverpb` package might read: "server/serverpb: made great again".
109
Commits which affect many packages as a result of a shared dependency change
110
should probably begin their subjects with the name of the shared dependency.
111
Finally, some commits may need to affect many packages in a way which does
112
not point to a specific package; those commits may begin with "*:" or "all:"
113
to indicate their reach.
123
+ When you’re ready for review, groom your work: each commit should pass tests
124
and contain a substantial (but not overwhelming) unit of work. You may also
125
want to `git fetch origin` and run
132
+ Then [create a pull request using GitHub’s UI](https://help.github.com/articles/creating-a-pull-request). If you know of
133
another GitHub user particularly suited to reviewing your pull request, be
134
sure to mention them in the pull request body. If you possess the necessary
135
GitHub privileges, please also [assign them to the pull request using
136
GitHub's UI](https://help.github.com/articles/assigning-issues-and-pull-requests-to-other-github-users/).
139
+ If you get a test failure in CircleCI, check the Test Failure tab to see why
140
the test failed. When the failure is logged in `excerpt.txt`, you can find
141
the file from the Artifacts tab and see log messages. (You need to sign in to
144
+ Address feedback by amending your commits. If your change contains multiple
145
commits, address each piece of feedback by amending that commit to which the
146
particular feedback is aimed. Wait (or ask) for new feedback on those
147
commits if they are not straightforward. An `LGTM` ("looks good to me") by
148
someone qualified is usually posted when you're free to go ahead and merge.
149
Most new contributors aren't allowed to merge themselves; in that case, we'll
156
* the [net/trace](https://godoc.org/golang.org/x/net/trace) endpoint at
157
`/debug/requests`. It has a breakdown of the recent traced requests, in
158
particularly slow ones. Two families are traced: `node` and `coord`, the
159
former (and likely more interesting one) containing what happens inside of
160
`Node`/`Store`/`Replica` and the other inside of the coordinator
163
heap and cpu profiles; [this golang blog post](http://blog.golang.org/profiling-go-programs) explains it extremely well and
164
[this one by Dmitry Vuykov](https://software.intel.com/en-us/blogs/2014/05/10/debugging-performance-issues-in-go-programs)
171
make acceptance TESTS='TestPut$$' TESTFLAGS='-v -d 1200s -l .' TESTTIMEOUT=1210s
172
```
173