authorgravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2019-04-21 15:14:42-07:00
committergravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2019-04-21 15:21:19-07:00
loge64c0dee35a6da1f9e538cc822f52e800a4cef99
treefe515e12801ac73d906f77bb84488ff92e4cb12d
parent0f8fc3b924ac0d971a800bc6e3b6c931612e06a6

readme: Add instructions for making changes to the standard library

Closes #2324

1 files changed, 40 insertions(+), 0 deletions(-)

README.md+40
...@@ -223,3 +223,43 @@ use stage 1....@@ -223,3 +223,43 @@ use stage 1.
223```223```
224./stage2/bin/zig build --build-file ../build.zig install -Drelease-fast224./stage2/bin/zig build --build-file ../build.zig install -Drelease-fast
225```225```
226
227## Developing Zig
228
229### Standard Library
230
231First, build the Stage 1 compiler as described in [the Building section](#building).
232
233Then, make your changes to the standard library files in `std`. After every change,
234(from the build directory you used to build the compiler) run either `make install`
235(on POSIX) or `msbuild -p:Configuration=Release INSTALL.vcxproj` (on Windows) as
236well as the relevant tests using `bin/zig test <file>`.
237
238Once your changes are finished, run all the zig tests (while skipping the longer
239test process for all possible platforms) by running the following (also from the
240build directory you used to build the compiler):
241
242```
243bin/zig build --build-file ../build.zig test -Dskip-release
244```
245
246For example, when making changes to `std/heap.zig` on POSIX:
247
248```sh
249# build and install compiler in 'build' directory
250mkdir build
251cd build
252...
253# make changes to std/heap.zig
254nano ../std/heap.zig
255# install and test changes
256make install
257bin/zig test std/heap.zig
258# more changes to std/heap.zig
259nano ../std/heap.zig
260# install and test changes
261make install
262bin/zig test std/heap.zig
263# run all the tests
264bin/zig build --build-file ../build.zig test -Dskip-release
265```