Permalink
Newer
100644
168 lines (130 sloc)
7.18 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.
19
go get -d github.com/cockroachdb/cockroach
20
cd $GOPATH/src/github.com/cockroachdb/cockroach
21
```
24
that the first time you run `make`, it can take some time to download and
25
install various dependencies. After running `make build`, the `cockroach`
26
executable will be in your current directory and can be run as shown in the
31
- The default binary contains core open-source functionally covered by the
32
Apache License 2 (APL2) and enterprise functionality covered by the
33
CockroachDB Community License (CCL). To build a pure open-source (APL2)
34
version excluding enterprise functionality, use `make buildoss`. See this
35
[blog post] for more details.
36
37
[blog post]: https://www.cockroachlabs.com/blog/how-were-building-a-business-to-last/
39
- If you edit a `.proto` or `.ts` file, you will need to manually regenerate
40
the associated `.pb.{go,cc,h}` or `.js` files using `go generate ./pkg/...`.
42
- We advise to run `go generate` using our embedded Docker setup.
43
`build/builder.sh` is a wrapper script designed to make this convenient. You
44
can run `build/builder.sh go generate ./pkg/...` from the repository root to
45
get the intended result.
49
- To add or update a Go dependency:
50
- See [`build/README.md`](build/README.md) for details on adding or updating
51
dependencies.
52
- Run `go generate ./pkg/...` to update generated files.
53
- Create a PR with all the changes.
61
+ All contributors need to sign the [Contributor License Agreement]
62
(https://cla-assistant.io/cockroachdb/cockroach).
71
+ Hack away and commit your changes locally using `git add` and `git commit`.
72
Remember to write tests! The following are helpful for running specific
83
When you're ready to commit, be sure to write a Good Commit Message™. Consult
84
https://github.com/erlang/otp/wiki/Writing-good-commit-messages if you're
85
not sure what constitutes a Good Commit Message™.
86
In addition to the general rules referenced above, please also prefix your
87
commit subject line with the affected package, if one can easily be chosen.
88
For example, the subject line of a commit mostly affecting the
89
`server/serverpb` package might read: "server/serverpb: made great again".
90
Commits which affect many packages as a result of a shared dependency change
91
should probably begin their subjects with the name of the shared dependency.
92
Finally, some commits may need to affect many packages in a way which does
93
not point to a specific package; those commits may begin with "*:" or "all:"
94
to indicate their reach.
96
+ Run the test suite locally:
97
98
`go generate ./pkg/... && make check test testrace`
100
+ When you’re ready for review, groom your work: each commit should pass tests
101
and contain a substantial (but not overwhelming) unit of work. You may also
102
want to `git fetch origin` and run
103
`git rebase -i --exec "make check test" origin/master` to make sure you're
104
submitting your changes on top of the newest version of our code. Next, push
110
(https://help.github.com/articles/creating-a-pull-request). If you know of
111
another GitHub user particularly suited to reviewing your pull request, be
112
sure to mention them in the pull request body. If you possess the necessary
113
GitHub privileges, please also [assign them to the pull request using
114
GitHub's UI] (https://help.github.com/articles/assigning-issues-and-pull-requests-to-other-github-users/).
115
This will help focus and expedite the code review process.
117
+ If you get a test failure in CircleCI, check the Test Failure tab to see why
118
the test failed. When the failure is logged in `excerpt.txt`, you can find
119
the file from the Artifacts tab and see log messages. (You need to sign in to
122
+ Address feedback by amending your commits. If your change contains multiple
123
commits, address each piece of feedback by amending that commit to which the
124
particular feedback is aimed. Wait (or ask) for new feedback on those
125
commits if they are not straightforward. An `LGTM` ("looks good to me") by
126
someone qualified is usually posted when you're free to go ahead and merge.
127
Most new contributors aren't allowed to merge themselves; in that case, we'll
134
* the [net/trace](https://godoc.org/golang.org/x/net/trace) endpoint at
135
`/debug/requests`. It has a breakdown of the recent traced requests, in
136
particularly slow ones. Two families are traced: `node` and `coord`, the
137
former (and likely more interesting one) containing what happens inside of
138
`Node`/`Store`/`Replica` and the other inside of the coordinator
144
(https://software.intel.com/en-us/blogs/2014/05/10/debugging-performance-issues-in-go-programs)
145
goes into even more detail. Two caveats: the `cockroach` binary passed to
146
`pprof` must be the same as the one creating the profile (not true on OSX in
147
acceptance tests!), and the HTTP client used by `pprof` doesn't simply
148
swallow self-signed certs (relevant when using SSL). For the latter, a
150
151
```
152
go tool pprof cockroach <(curl -k https://$(hostname):26257/debug/pprof/profile)
153
```
161
make acceptance TESTS='TestPut$$' TESTFLAGS='-v -d 1200s -l .' TESTTIMEOUT=1210s
162
```
163