v0.19: Small bug fixes before gxdoc PR #1513

Merged
vyzo merged 5 commits from jay/gerbil:gxdoc-pr0-fixes into v0.19-staging 2026-10-23 10:34:46 +00:00
Member

These are small, independent fixes for problems found while building the new documentation tool for Gerbil.

Changes

  • std/list/list: Keep append-map's results in order.

append-map reversed the elements of each result before appending them, so e.g. (append-map (lambda (x) [x (* x 10)]) [1 2]) gave (10 1 20 2) instead of (1 10 2 20). The fix appends each result as returned (foldl append).

  • std/sync/channel: Pass timeouts to mutex-unlock! as times.

timeout->abs-timeout gave the deadline as a real number, which mutex-unlock! reads as seconds from now, so a timed channel-put on a full channel or a timed channel-get on an empty one waited for decades instead of timing out. The deadline is now converted with seconds->time.

  • build: Memoize completed library dependencies.

find-deps revisited each shared dependency once per path, so a graph with many repeated acyclic imports took exponential time, and a clean build stalled before compiling libgerbil. Each traversal now records the modules it has completed, separately from visited-modules, which holds the final order. Phases, exclusions and dependency order are unchanged.

  • gxpkg: Normalize path-normalize's argument, not the current directory*.

path-normalize* ignored its argument and returned the normalized current directory, so gerbil pkg uninstall PKG ran rm -rf on the caller's working directory instead of PKG's checkout. The function now normalizes its argument. pkg-new passes the current directory and is unaffected.

  • build: Do not install tool test modules as commands.

build_tools linked every tools/gx*.ss into bin as a command, so gxtags-test, gxhttpd-test, gxhttpd-ensemble-test and gxensemble-test were installed as commands. To reproduce, build and list build/bin. The loop now skips *-test.ss and quotes the file names.

Warning

LLM-assisted with Claude Opus 5.5 and gerbil-mcp

These are small, independent fixes for problems found while building the new documentation tool for Gerbil. ## Changes - **`std/list/list`: Keep append-map's results in order**. `append-map` reversed the elements of each result before appending them, so e.g. `(append-map (lambda (x) [x (* x 10)]) [1 2])` gave `(10 1 20 2)` instead of `(1 10 2 20)`. The fix appends each result as returned (`foldl append`). - **`std/sync/channel`: Pass timeouts to `mutex-unlock!` as times**. `timeout->abs-timeout` gave the deadline as a real number, which `mutex-unlock!` reads as seconds from now, so a timed `channel-put` on a full channel or a timed `channel-get` on an empty one waited for decades instead of timing out. The deadline is now converted with `seconds->time`. - **`build`: Memoize completed library dependencies**. `find-deps` revisited each shared dependency once per path, so a graph with many repeated acyclic imports took exponential time, and a clean build stalled before compiling libgerbil. Each traversal now records the modules it has completed, separately from `visited-modules`, which holds the final order. Phases, exclusions and dependency order are unchanged. - **`gxpkg`: Normalize path-normalize*'s argument, not the current directory**. `path-normalize*` ignored its argument and returned the normalized current directory, so `gerbil pkg uninstall PKG` ran `rm -rf` on the caller's working directory instead of PKG's checkout. The function now normalizes its argument. `pkg-new` passes the current directory and is unaffected. - **`build`: Do not install tool test modules as commands**. `build_tools` linked every `tools/gx*.ss` into `bin` as a command, so `gxtags-test`, `gxhttpd-test`, `gxhttpd-ensemble-test` and `gxensemble-test` were installed as commands. To reproduce, build and list `build/bin`. The loop now skips `*-test.ss` and quotes the file names. > [!WARNING] > LLM-assisted with Claude Opus 5.5 and `gerbil-mcp`
append-map reversed the elements of each result before appending them.
timeout->abs-timeout gave the deadline as a real number, which
mutex-unlock! reads as seconds from now, so a timed channel-put on a
full channel or channel-get on an empty one waited for decades.

The test runs the timed operations in a thread joined with a timeout,
so a regression fails instead of hanging the suite.
find-deps revisited each shared dependency once per path, so a graph of
repeated acyclic imports took exponential time and a clean build
stalled before compiling libgerbil. Record the modules each traversal
has completed, apart from visited-modules, which holds the final order;
phases, exclusions and dependency order are unchanged.

The large-graph test runs the ordering in a thread with a 60-second
join timeout, so a regression fails instead of hanging.
path-normalize* ignored its argument and returned the normalized
current directory, so `gerbil pkg uninstall PKG` ran rm -rf on the
caller's working directory instead of PKG's checkout. pkg-new passes
the current directory and is unaffected.
build_tools linked every tools/gx*.ss into bin as a command, so the test
modules gxtags-test, gxhttpd-test, gxhttpd-ensemble-test and
gxensemble-test were installed as commands too. Skip *-test.ss, and
quote the file names.
jay requested review from Owners 2026-10-19 18:06:22 +00:00
vyzo approved these changes 2026-10-23 10:34:40 +00:00
vyzo left a comment

thank you!

thank you!
vyzo merged commit 7688c85a8c into v0.19-staging 2026-10-23 10:34:46 +00:00
vyzo deleted branch gxdoc-pr0-fixes 2026-10-23 10:34:53 +00:00
Sign in to join this conversation.
No description provided.