The nREPL server bound its loopback socket through libc process symbols, which don't carry the socket entry points on Windows — they live in ws2_32.dll and aren't in joltc.exe's export table, so --nrepl-server died with "no entry for socket". Load ws2_32 before the foreign bindings there, call WSAStartup once, and use Winsock's closesocket and int-typed recv/send. Also fix SOL_SOCKET/SO_REUSEADDR, which the old macos-only check got wrong on Windows. Bake a version string into the self-contained binary at build time (from $JOLT_VERSION, else git describe) and expose it via jolt.host/jolt-version: --version / -V print it, and it shows in --help, the repl banner, and the nREPL startup line. Dev runs off bin/joltc read it from git describe. Add -e to the help output.
20 lines
1,006 B
Bash
Executable file
20 lines
1,006 B
Bash
Executable file
#!/bin/sh
|
|
# joltc — the pure-Chez jolt runtime. NO Janet.
|
|
#
|
|
# Compiles and evaluates jolt (Clojure) on Chez using the checked-in bootstrap
|
|
# seed (host/chez/seed/). With only Chez installed it runs jolt end to end:
|
|
#
|
|
# joltc -e "(+ 1 2)" evaluate an expression
|
|
# joltc run -m app.core [args] resolve deps.edn, run a namespace's -main
|
|
# joltc -M:alias [args] run an alias's :main-opts
|
|
# joltc repl | path | <task> REPL, print roots, or a deps.edn task
|
|
#
|
|
# The launcher cd's to the jolt repo root so the runtime's relative loads work;
|
|
# the user's original cwd (the project dir, where deps.edn lives) is passed in
|
|
# JOLT_PWD.
|
|
root="$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)"
|
|
export JOLT_PWD="${JOLT_PWD:-$PWD}"
|
|
# Version for --version / banners: git describe of this checkout, else "dev".
|
|
export JOLT_VERSION="${JOLT_VERSION:-$(git -C "$root" describe --tags --always --dirty 2>/dev/null || echo dev)}"
|
|
cd "$root" || exit 1
|
|
exec chez --script host/chez/cli.ss "$@"
|