aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorRyan Liptak <squeek502@hotmail.com>2019-04-21 15:14:42 -0700
committerRyan Liptak <squeek502@hotmail.com>2019-04-21 15:21:19 -0700
commite64c0dee35a6da1f9e538cc822f52e800a4cef99 (patch)
treefe515e12801ac73d906f77bb84488ff92e4cb12d /README.md
parent0f8fc3b924ac0d971a800bc6e3b6c931612e06a6 (diff)
downloadzig-e64c0dee35a6da1f9e538cc822f52e800a4cef99.tar.gz
zig-e64c0dee35a6da1f9e538cc822f52e800a4cef99.zip
readme: Add instructions for making changes to the standard library
Closes #2324
Diffstat (limited to 'README.md')
-rw-r--r--README.md40
1 files changed, 40 insertions, 0 deletions
diff --git a/README.md b/README.md
index 197c80fb18..520efb221f 100644
--- a/README.md
+++ b/README.md
@@ -223,3 +223,43 @@ use stage 1.
```
./stage2/bin/zig build --build-file ../build.zig install -Drelease-fast
```
+
+## Developing Zig
+
+### Standard Library
+
+First, build the Stage 1 compiler as described in [the Building section](#building).
+
+Then, make your changes to the standard library files in `std`. After every change,
+(from the build directory you used to build the compiler) run either `make install`
+(on POSIX) or `msbuild -p:Configuration=Release INSTALL.vcxproj` (on Windows) as
+well as the relevant tests using `bin/zig test <file>`.
+
+Once your changes are finished, run all the zig tests (while skipping the longer
+test process for all possible platforms) by running the following (also from the
+build directory you used to build the compiler):
+
+```
+bin/zig build --build-file ../build.zig test -Dskip-release
+```
+
+For example, when making changes to `std/heap.zig` on POSIX:
+
+```sh
+# build and install compiler in 'build' directory
+mkdir build
+cd build
+...
+# make changes to std/heap.zig
+nano ../std/heap.zig
+# install and test changes
+make install
+bin/zig test std/heap.zig
+# more changes to std/heap.zig
+nano ../std/heap.zig
+# install and test changes
+make install
+bin/zig test std/heap.zig
+# run all the tests
+bin/zig build --build-file ../build.zig test -Dskip-release
+```