readme: Simplify instructions for making changes to the standard library

This commit is contained in:
Ryan Liptak 2019-04-21 21:53:35 -07:00
parent e64c0dee35
commit af7daae26b

View file

@ -229,37 +229,20 @@ use stage 1.
### Standard Library ### Standard Library
First, build the Stage 1 compiler as described in [the Building section](#building). First, build the Stage 1 compiler as described in [the Building section](#building).
Then, make your changes to the standard library files in `std` (note: not
`build/lib/zig/std`). To test changes to the standard library, do the following
from the build directory:
Then, make your changes to the standard library files in `std`. After every change, 1. Run `make install` (on POSIX) or `msbuild -p:Configuration=Release INSTALL.vcxproj`
(from the build directory you used to build the compiler) run either `make install` (on Windows).
(on POSIX) or `msbuild -p:Configuration=Release INSTALL.vcxproj` (on Windows) as 2. Test your changes with `bin/zig test <changed file>` (e.g. `bin/zig test std/heap.zig`).
well as the relevant tests using `bin/zig test <file>`.
Once your changes are finished, run all the zig tests (while skipping the longer Once your changes are finished, run all the zig tests from the build directory:
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 bin/zig build --build-file ../build.zig test -Dskip-release
``` ```
For example, when making changes to `std/heap.zig` on POSIX: *Note: The `-Dskip-release` flag will skip running the longer test process that tests
all possible build configurations. This shorter test process is good enough when
```sh submitting pull requests*
# 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
```