| ... | @@ -229,37 +229,20 @@ use stage 1. | ... | @@ -229,37 +229,20 @@ use stage 1. |
| 229 | ### Standard Library | 229 | ### Standard Library |
| 230 | | 230 | |
| 231 | First, build the Stage 1 compiler as described in [the Building section](#building). | 231 | First, build the Stage 1 compiler as described in [the Building section](#building). |
| | 232 | Then, make your changes to the standard library files in `std` (note: not |
| | 233 | `build/lib/zig/std`). To test changes to the standard library, do the following |
| | 234 | from the build directory: |
| 232 | | 235 | |
| 233 | Then, make your changes to the standard library files in `std`. After every change, | 236 | 1. Run `make install` (on POSIX) or `msbuild -p:Configuration=Release INSTALL.vcxproj` |
| 234 | (from the build directory you used to build the compiler) run either `make install` | 237 | (on Windows). |
| 235 | (on POSIX) or `msbuild -p:Configuration=Release INSTALL.vcxproj` (on Windows) as | 238 | 2. Test your changes with `bin/zig test <changed file>` (e.g. `bin/zig test std/heap.zig`). |
| 236 | well as the relevant tests using `bin/zig test <file>`. | | |
| 237 | | 239 | |
| 238 | Once your changes are finished, run all the zig tests (while skipping the longer | 240 | Once your changes are finished, run all the zig tests from the build directory: |
| 239 | test process for all possible platforms) by running the following (also from the | | |
| 240 | build directory you used to build the compiler): | | |
| 241 | | 241 | |
| 242 | ``` | 242 | ``` |
| 243 | bin/zig build --build-file ../build.zig test -Dskip-release | 243 | bin/zig build --build-file ../build.zig test -Dskip-release |
| 244 | ``` | 244 | ``` |
| 245 | | 245 | |
| 246 | For example, when making changes to `std/heap.zig` on POSIX: | 246 | *Note: The `-Dskip-release` flag will skip running the longer test process that tests |
| 247 | | 247 | all possible build configurations. This shorter test process is good enough when |
| 248 | ```sh | 248 | submitting pull requests* |
| 249 | # build and install compiler in 'build' directory | | |
| 250 | mkdir build | | |
| 251 | cd build | | |
| 252 | ... | | |
| 253 | # make changes to std/heap.zig | | |
| 254 | nano ../std/heap.zig | | |
| 255 | # install and test changes | | |
| 256 | make install | | |
| 257 | bin/zig test std/heap.zig | | |
| 258 | # more changes to std/heap.zig | | |
| 259 | nano ../std/heap.zig | | |
| 260 | # install and test changes | | |
| 261 | make install | | |
| 262 | bin/zig test std/heap.zig | | |
| 263 | # run all the tests | | |
| 264 | bin/zig build --build-file ../build.zig test -Dskip-release | | |
| 265 | ``` | | |