NTS WSL Integration
Core Rule
Read the repository AGENTS.md before making changes. If it forbids writes outside the working directory, ask the user to lift that rule before creating ~/.local/bin/func or editing ~/.bashrc.
Use The Linux Func Path
Prefer Linux Azure Functions Core Tools under the repository .tools/ directory. Do not rely on Windows func.exe for the integration harness: it can start the Functions host, but WSL may not reach the Windows loopback listener at 127.0.0.1:<port>.
Use Docker Desktop's WSL CLI whenever Docker is needed:
/mnt/wsl/docker-desktop/cli-tools/usr/bin/docker
Setup Workflow
From the repository root:
- Verify the repo rules:
sed -n '1,180p' AGENTS.md
- If home-directory writes are allowed or the user explicitly lifts the rule, run the setup script:
bash .codex/skills/nts-wsl-integration/scripts/setup_wsl_integration.sh
- If home-directory writes are not allowed yet, install only repo-local tools first:
bash .codex/skills/nts-wsl-integration/scripts/setup_wsl_integration.sh --skip-shim --skip-bashrc
- Verify without modifying files:
bash .codex/skills/nts-wsl-integration/scripts/setup_wsl_integration.sh --verify-only
- Run the integration project with the expected output levels:
PATH="/mnt/wsl/docker-desktop/cli-tools/usr/bin:$HOME/.local/bin:$PATH" dotnet build tests/NTS.Tests.Integration/NTS.Tests.Integration.csproj -v:q
PATH="/mnt/wsl/docker-desktop/cli-tools/usr/bin:$HOME/.local/bin:$PATH" dotnet test tests/NTS.Tests.Integration/NTS.Tests.Integration.csproj -v:m
Expected Installed Pieces
.tools/node: local Linux Node runtime used for npm/extraction..tools/npm: local npm prefix containingazure-functions-core-tools..tools/npm/node_modules/azure-functions-core-tools/bin/func: Linuxfuncbinary.~/.local/bin/func: optional shim pointing at the repository-local Linuxfunc.~/.bashrc: optional PATH line placing Docker Desktop's WSL CLI and~/.local/binfirst.
.tools/ is local machine state and should stay git-ignored.
Common Failures
func: command not found: create or repair the shim after user approval for home-directory writes.- Docker reports
client version 1.43 is too old: use/mnt/wsl/docker-desktop/cli-tools/usr/bin/dockerinstead of/usr/bin/docker. MongoDB connection string is null: usually caused by launching Windowsfunc.exe; switch to Linuxfunc.Nexus HTTP did not become healthywhile Functions lists routes: often Windowsfunc.exeloopback isolation; switch to Linuxfunc.- Azurite storage errors: start the
azuriteDocker container on ports10000,10001, and10002.
Script Notes
The setup script downloads a large Functions Core Tools zip from Microsoft's CDN and extracts about 1.3 GB under .tools/. This can be slow on /mnt/* drives. Prefer checking whether .tools/npm/node_modules/azure-functions-core-tools/bin/func --version works before repeating the download.
Source: Not-Endurance/not-timing-system — distributed by TomeVault.