From 2c9ef8283ab065ee34cdf2b05655476b8c5a8cf9 Mon Sep 17 00:00:00 2001 From: Noah Pederson Date: Fri, 27 Oct 2023 19:32:09 -0500 Subject: [PATCH 1/3] Adds doc with suggestions for stdlib dev. --- doc/guide/hacking-on-the-stdlib.md | 33 ++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 doc/guide/hacking-on-the-stdlib.md diff --git a/doc/guide/hacking-on-the-stdlib.md b/doc/guide/hacking-on-the-stdlib.md new file mode 100644 index 000000000..909830423 --- /dev/null +++ b/doc/guide/hacking-on-the-stdlib.md @@ -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 encountere 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. From 33ba35ee3170f162457556eabf865a30c2e39dee Mon Sep 17 00:00:00 2001 From: Noah Pederson Date: Fri, 27 Oct 2023 19:40:52 -0500 Subject: [PATCH 2/3] Add new md file to site --- doc/.vuepress/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/.vuepress/config.js b/doc/.vuepress/config.js index f0ad75af1..da17864b2 100644 --- a/doc/.vuepress/config.js +++ b/doc/.vuepress/config.js @@ -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/': [ From 874caef0aafba7c071b085b057af52cab7057f76 Mon Sep 17 00:00:00 2001 From: Noah Pederson Date: Fri, 27 Oct 2023 19:46:42 -0500 Subject: [PATCH 3/3] Fixes typo --- doc/guide/hacking-on-the-stdlib.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/guide/hacking-on-the-stdlib.md b/doc/guide/hacking-on-the-stdlib.md index 909830423..4f2c9ca7b 100644 --- a/doc/guide/hacking-on-the-stdlib.md +++ b/doc/guide/hacking-on-the-stdlib.md @@ -2,7 +2,7 @@ Gerbil is a growing project and your contributions are welcome! -When working on modifications to the standard library, it's common to encountere errors +When working on modifications to the standard library, it's common to encounter errors such as: ```