authorgravatar for michael.dusan@gmail.comMichael Dusan <michael.dusan@gmail.com> 2020-01-17 00:19:59-05:00
committergravatar for michael.dusan@gmail.comMichael Dusan <michael.dusan@gmail.com> 2020-01-17 02:47:47-05:00
logaf9eb7ac13b522c1880357ae7349a0b984b83ab4
tree1dc5c7bf7bea323c1b79776d50115d55261cd746
parent0240fd91401c8a20064da0efd5b1e8955e481f1b
signaturelock-open Commit is signed but in an unrecognized format.

doc: update contributing


1 files changed, 20 insertions(+), 15 deletions(-)

CONTRIBUTING.md+20-15
...@@ -51,23 +51,28 @@ knowledge of Zig internals.**...@@ -51,23 +51,28 @@ knowledge of Zig internals.**
5151
52### Editing Source Code52### Editing Source Code
5353
54First, build the Stage 1 compiler as described in [the Building section](#building).54First, build the Stage 1 compiler as described in [Building from Source](README.md#Building-from-Source).
5555
56One modification you may want to make is adding `-DZIG_SKIP_INSTALL_LIB_FILES=ON`56Zig locates lib files relative to executable path by searching up the
57to the cmake line. If you use the build directory as a working directory to run57filesystem tree for a sub-path of `lib/zig/std/std.zig` or `lib/std/std.zig`.
58tests with, zig will find the lib files in the source directory, and they will not58Typically the former is an install and the latter a git working tree which
59be "installed" every time you run `make`. This will allow you to make modifications59contains the build directory.
60directly to the standard library, for example, and have them effective immediately.60
61Note that if you already ran `make` or `make install` with the default cmake61During development it is not necessary to perform installs when modifying
62settings, there will already be a `lib/` directory in your build directory. When62stage1 or userland sources and in fact it is faster and simpler to run,
63executed from the build directory, zig will find this instead of the source lib/63test and debug from a git working tree.
64directory. Remove the unwanted directory so that the desired one can be found.64
65- `make` is typically sufficient to build zig during development iterations.
66- `make install` performs a build __and__ install.
67- `msbuild -p:Configuration=Release INSTALL.vcxproj` on Windows performs a
68build and install. To avoid install, pass cmake option `-DZIG_SKIP_INSTALL_LIB_FILES=ON`.
6569
66To test changes, do the following from the build directory:70To test changes, do the following from the build directory:
6771
681. Run `make install` (on POSIX) or721. Run `make` (on POSIX) or
69 `msbuild -p:Configuration=Release INSTALL.vcxproj` (on Windows).73 `msbuild -p:Configuration=Release INSTALL.vcxproj` (on Windows).
702. `bin/zig build test` (on POSIX) or `bin\zig.exe build test` (on Windows).742. `$BUILD_DIR/zig build test` (on POSIX) or
75 `$BUILD_DIR/Release\zig.exe build test` (on Windows).
7176
72That runs the whole test suite, which does a lot of extra testing that you77That runs the whole test suite, which does a lot of extra testing that you
73likely won't always need, and can take upwards of 1 hour. This is what the78likely won't always need, and can take upwards of 1 hour. This is what the
...@@ -85,8 +90,8 @@ Another example is choosing a different set of things to test. For example,...@@ -85,8 +90,8 @@ Another example is choosing a different set of things to test. For example,
85not the other ones. Combining this suggestion with the previous one, you could90not the other ones. Combining this suggestion with the previous one, you could
86do this:91do this:
8792
88`bin/zig build test-std -Dskip-release` (on POSIX) or93`$BUILD_DIR/bin/zig build test-std -Dskip-release` (on POSIX) or
89`bin\zig.exe build test-std -Dskip-release` (on Windows).94`$BUILD_DIR/Release\zig.exe build test-std -Dskip-release` (on Windows).
9095
91This will run only the standard library tests, in debug mode only, for all96This will run only the standard library tests, in debug mode only, for all
92targets (it will cross-compile the tests for non-native targets but not run97targets (it will cross-compile the tests for non-native targets but not run