Skip to content

Commit

Permalink
Adds doc with suggestions for stdlib dev. (#1028)
Browse files Browse the repository at this point in the history
  • Loading branch information
chiefnoah authored Oct 28, 2023
1 parent 2d75e50 commit 407c994
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion doc/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {
'/guide/': [
{
title: 'Guide',
children: ['', 'intro', 'getting-started', 'ffi', 'emacs', 'shell', 'env-vars', 'package-manager', 'docker', 'macos', 'nix', 'r7rs']
children: ['', 'intro', 'getting-started', 'ffi', 'emacs', 'shell', 'env-vars', 'package-manager', 'docker', 'macos', 'nix', 'r7rs', 'hacking-on-the-stdlib']
}
],
'/tutorials/': [
Expand Down
33 changes: 33 additions & 0 deletions doc/guide/hacking-on-the-stdlib.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Hacking on the Standard Library

Gerbil is a growing project and your contributions are welcome!

When working on modifications to the standard library, it's common to encounter errors
such as:

```
*** ERROR IN gx#core-expand-import%__% --
*** ERROR IN "file.ss"@1.9
--- Syntax Error: Cannot find library module
... form: :std/my/module
```
This typically because the `gxi` or `gxc` being used is looking at the installed
standard library which will not contain your changes. To address this, run your
environment with the `build.sh` script after building.

Example build:

```shell
./build.sh
```

To test your local changes rebuild the stdlib and then use the locally built `gxi` with
the following commands:

```shell
./build.sh stdlib
./build.sh env gxi ../your-test-file.ss
```
**NOTE:** the execution environment when using `./build.sh env` is in the `src/` folder
in the root of the Gerbil repo. Absolute paths work as normal, but relative paths must
be adjusted for `PWD` change.

0 comments on commit 407c994

Please sign in to comment.