authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-05-28 14:50:02-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-05-28 14:50:02-04:00
loga37ea5acf3d98824c64c2859ed72d6203c4de4bb
tree64785d8df48d4166dd4cea60d97d1fe14e422832
parent8a65478801f8d41d3e62826e99ec23163051a9f0
signaturelock-open Commit is signed but in an unrecognized format.

extract CONTRIBUTING.md from README.md


2 files changed, 91 insertions(+), 92 deletions(-)

CONTRIBUTING.md created+91
...@@ -0,0 +1,91 @@
1## Contributing
2
3### Start a Project Using Zig
4
5One of the best ways you can contribute to Zig is to start using it for a
6personal project. Here are some great examples:
7
8 * [Oxid](https://github.com/dbandstra/oxid) - arcade style game
9 * [TM35-Metronome](https://github.com/TM35-Metronome) - tools for modifying and randomizing Pokémon games
10 * [trOS](https://github.com/sjdh02/trOS) - tiny aarch64 baremetal OS thingy
11
12Without fail, these projects lead to discovering bugs and helping flesh out use
13cases, which lead to further design iterations of Zig. Importantly, each issue
14found this way comes with real world motivations, so it is easy to explain
15your reasoning behind proposals and feature requests.
16
17Ideally, such a project will help you to learn new skills and add something
18to your personal portfolio at the same time.
19
20### Spread the Word
21
22Another way to contribute is to write about Zig, or speak about Zig at a
23conference, or do either of those things for your project which uses Zig.
24Here are some examples:
25
26 * [Iterative Replacement of C with Zig](http://tiehuis.github.io/blog/zig1.html)
27 * [The Right Tool for the Right Job: Redis Modules & Zig](https://www.youtube.com/watch?v=eCHM8-_poZY)
28
29Zig is a brand new language, with no advertising budget. Word of mouth is the
30only way people find out about the project, and the more people hear about it,
31the more people will use it, and the better chance we have to take over the
32world.
33
34### Finding Contributor Friendly Issues
35
36Please note that issues labeled
37[Proposal](https://github.com/ziglang/zig/issues?q=is%3Aissue+is%3Aopen+label%3Aproposal)
38but do not also have the
39[Accepted](https://github.com/ziglang/zig/issues?q=is%3Aissue+is%3Aopen+label%3Aaccepted)
40label are still under consideration, and efforts to implement such a proposal
41have a high risk of being wasted. If you are interested in a proposal which is
42still under consideration, please express your interest in the issue tracker,
43providing extra insights and considerations that others have not yet expressed.
44The most highly regarded argument in such a discussion is a real world use case.
45
46The issue label
47[Contributor Friendly](https://github.com/ziglang/zig/issues?q=is%3Aissue+is%3Aopen+label%3A%22contributor+friendly%22)
48exists to help contributors find issues that are "limited in scope and/or
49knowledge of Zig internals."
50
51### Editing Source Code
52
53First, build the Stage 1 compiler as described in [the Building section](#building).
54
55When making changes to the standard library, be sure to edit the files in the
56`std` directory and not the installed copy in the build directory. If you add a
57new file to the standard library, you must also add the file path in
58CMakeLists.txt.
59
60To test changes, do the following from the build directory:
61
621. Run `make install` (on POSIX) or
63 `msbuild -p:Configuration=Release INSTALL.vcxproj` (on Windows).
642. `bin/zig build --build-file ../build.zig test` (on POSIX) or
65 `bin\zig.exe build --build-file ..\build.zig test` (on Windows).
66
67That runs the whole test suite, which does a lot of extra testing that you
68likely won't always need, and can take upwards of 2 hours. This is what the
69CI server runs when you make a pull request.
70
71To save time, you can add the `--help` option to the `zig build` command and
72see what options are available. One of the most helpful ones is
73`-Dskip-release`. Adding this option to the command in step 2 above will take
74the time down from around 2 hours to about 6 minutes, and this is a good
75enough amount of testing before making a pull request.
76
77Another example is choosing a different set of things to test. For example,
78`test-std` instead of `test` will only run the standard library tests, and
79not the other ones. Combining this suggestion with the previous one, you could
80do this:
81
82`bin/zig build --build-file ../build.zig test-std -Dskip-release` (on POSIX) or
83`bin\zig.exe build --build-file ..\build.zig test-std -Dskip-release` (on Windows).
84
85This will run only the standard library tests, in debug mode only, for all
86targets (it will cross-compile the tests for non-native targets but not run
87them).
88
89When making changes to the compiler source code, the most helpful test step to
90run is `test-behavior`. When editing documentation it is `docs`. You can find
91this information and more in the `--help` menu.
README.md-92
...@@ -96,95 +96,3 @@ use stage 1....@@ -96,95 +96,3 @@ use stage 1.
96```96```
97./stage2/bin/zig build --build-file ../build.zig install -Drelease-fast97./stage2/bin/zig build --build-file ../build.zig install -Drelease-fast
98```98```
99
100## Contributing
101
102### Start a Project Using Zig
103
104One of the best ways you can contribute to Zig is to start using it for a
105personal project. Here are some great examples:
106
107 * [Oxid](https://github.com/dbandstra/oxid) - arcade style game
108 * [TM35-Metronome](https://github.com/TM35-Metronome) - tools for modifying and randomizing Pokémon games
109 * [trOS](https://github.com/sjdh02/trOS) - tiny aarch64 baremetal OS thingy
110
111Without fail, these projects lead to discovering bugs and helping flesh out use
112cases, which lead to further design iterations of Zig. Importantly, each issue
113found this way comes with real world motivations, so it is easy to explain
114your reasoning behind proposals and feature requests.
115
116Ideally, such a project will help you to learn new skills and add something
117to your personal portfolio at the same time.
118
119### Spread the Word
120
121Another way to contribute is to write about Zig, or speak about Zig at a
122conference, or do either of those things for your project which uses Zig.
123Here are some examples:
124
125 * [Iterative Replacement of C with Zig](http://tiehuis.github.io/blog/zig1.html)
126 * [The Right Tool for the Right Job: Redis Modules & Zig](https://www.youtube.com/watch?v=eCHM8-_poZY)
127
128Zig is a brand new language, with no advertising budget. Word of mouth is the
129only way people find out about the project, and the more people hear about it,
130the more people will use it, and the better chance we have to take over the
131world.
132
133### Finding Contributor Friendly Issues
134
135Please note that issues labeled
136[Proposal](https://github.com/ziglang/zig/issues?q=is%3Aissue+is%3Aopen+label%3Aproposal)
137but do not also have the
138[Accepted](https://github.com/ziglang/zig/issues?q=is%3Aissue+is%3Aopen+label%3Aaccepted)
139label are still under consideration, and efforts to implement such a proposal
140have a high risk of being wasted. If you are interested in a proposal which is
141still under consideration, please express your interest in the issue tracker,
142providing extra insights and considerations that others have not yet expressed.
143The most highly regarded argument in such a discussion is a real world use case.
144
145The issue label
146[Contributor Friendly](https://github.com/ziglang/zig/issues?q=is%3Aissue+is%3Aopen+label%3A%22contributor+friendly%22)
147exists to help contributors find issues that are "limited in scope and/or
148knowledge of Zig internals."
149
150### Editing Source Code
151
152First, build the Stage 1 compiler as described in [the Building section](#building).
153
154When making changes to the standard library, be sure to edit the files in the
155`std` directory and not the installed copy in the build directory. If you add a
156new file to the standard library, you must also add the file path in
157CMakeLists.txt.
158
159To test changes, do the following from the build directory:
160
1611. Run `make install` (on POSIX) or
162 `msbuild -p:Configuration=Release INSTALL.vcxproj` (on Windows).
1632. `bin/zig build --build-file ../build.zig test` (on POSIX) or
164 `bin\zig.exe build --build-file ..\build.zig test` (on Windows).
165
166That runs the whole test suite, which does a lot of extra testing that you
167likely won't always need, and can take upwards of 2 hours. This is what the
168CI server runs when you make a pull request.
169
170To save time, you can add the `--help` option to the `zig build` command and
171see what options are available. One of the most helpful ones is
172`-Dskip-release`. Adding this option to the command in step 2 above will take
173the time down from around 2 hours to about 6 minutes, and this is a good
174enough amount of testing before making a pull request.
175
176Another example is choosing a different set of things to test. For example,
177`test-std` instead of `test` will only run the standard library tests, and
178not the other ones. Combining this suggestion with the previous one, you could
179do this:
180
181`bin/zig build --build-file ../build.zig test-std -Dskip-release` (on POSIX) or
182`bin\zig.exe build --build-file ..\build.zig test-std -Dskip-release` (on Windows).
183
184This will run only the standard library tests, in debug mode only, for all
185targets (it will cross-compile the tests for non-native targets but not run
186them).
187
188When making changes to the compiler source code, the most helpful test step to
189run is `test-behavior`. When editing documentation it is `docs`. You can find
190this information and more in the `--help` menu.