Requirement: admin-free self-hosted install + Windows support

Origin

Julian (via Grok Bot, 2026-11-25, Europe/Berlin): when lic is self-hosted, installation must work without admin/root rights (pure user-space) and be installable on Windows.

This issue records the requirement, an assessment of main as of f70d1357d17c (merged 2026-11-25 06:11 Europe/Berlin: refactor/carve-lig-resident-fock), and a phased checklist. No code or roadmap-file change is made here. A later Cursor cloud-agent MR can add a short roadmap bullet (proposed text at the bottom). No merge without Julian’s yes on a concrete head.

Inspected read-only: GitLab project 1 (li-langverse/lic), public main, release v0.2.0, install/packaging scripts, CI, runtime POSIX/Windows shims, and the issue/MR/branch tracker. There is no existing issue for this requirement.

Current state

Linux user-space install — mostly already there

  • scripts/install.sh delegates to scripts/install-li.sh.
  • Default prefix is already ~/.local (LI_INSTALL_PREFIX / --prefix). No sudo in the default path.
  • --system installs to /usr/local and may need sudo; that must stay optional.
  • ensure_path only prints export PATH="$HOME/.local/bin:$PATH"; it does not offer to append a user shell-profile line.
  • Prebuilt path: download lic-VERSION-linux-amd64.tar.gz from GitLab Releases and unpack under the prefix (bin/ + share/lic/).
  • From-source path still tells a non-root user to sudo bash scripts/ci-install-llvm.sh. That violates the new requirement if the user has no prebuilt and no system LLVM.
  • .deb / AUR / RPM / Snap / Flatpak are root/system channels and must remain optional, not the self-hosted default. packaging/debian/rules installs to /usr/bin.
  • The published v0.2.0 Linux asset (lic-0.2.0-linux-amd64.tar.gz, built from 1dcd91eef, not the tag commit 0e8443c) is a real compiler (lic --version → lic 0.2.0) but is dynamically linked against libz3.so.4, libzstd, and libz. A user-space install therefore still needs those libraries on the machine (or we must bundle / statically link them).
  • install-gate:linux exists and installs into a temp prefix, but the job runs as root in ubuntu:24.04 (apt-get in before_script). It is not a non-root-user acceptance test. It only runs when install/packaging files change.

Windows — scaffolding exists; no real published compiler

  • v0.2.0 has no Windows asset. The release description is explicit: “Windows: there is no Windows build for v0.2.0, and no windows-amd64 asset is attached.” (Julian accepted “no Windows stub” when the Linux asset was published, 2026-11-18.) Earlier memory that a windows-amd64 file was attached is wrong.
  • Repo still has a stub path: scripts/windows-native-stub-release.ps1 compiles scripts/stub-lic.c to lic.exe that reports lic $VERSION-stub. CI job release-stub-windows-amd64 is allow_failure and needs an unregistered homelab-windows runner. scripts/install.ps1 refuses a stub when -NativeOnly / -NoWsl is set.
  • scripts/check-release-assets.sh does require both lic-<ver>-windows-amd64.zip and lic-<ver>-linux-amd64.tar.gz (name + downloadable link). It does not check that the Windows zip is a real compiler rather than a stub. On current main, VERSION is 0.3.0 and there is no v0.3.0 tag, so the strict gate is deferred until that tag exists (version:mr / version:main comments). Tightening the gate to reject stubs should happen when a real Windows asset is first published (target: v0.3.0, not a late stub on v0.2.0).
  • Native installer scripts:
    • scripts/install.ps1 / install-native.ps1: default prefix is %USERPROFILE%\.local (Unix-like, not %LOCALAPPDATA%\Programs\lic). PATH is updated via HKCU Environment\Path only (no HKLM). Good for admin-free.
    • installer/LiCompiler.iss: PrivilegesRequired=lowest, PATH via HKCU, DefaultDirName={autopf}\Li (Inno: user-local {localappdata}\Programs when not elevated). Version strings still say 0.1.0. A setup.exe is not on the v0.2.0 release.
    • Scoop / Winget / Chocolatey manifests exist but are placeholders at 0.1.0 with PLACEHOLDER_SHA256_* and no published zips.
  • Default Windows docs still push WSL as the way to get a full compiler. install-li.sh --from-source exits on native Windows and tells the user to use WSL. That is incompatible with “installable on Windows” as a first-class, admin-free path.
  • scripts/build.ps1 / setup-llvm-dev.ps1 already describe a user-space Windows toolchain: download the official clang+llvm-22.*-x86_64-pc-windows-msvc tarball into tools/llvm-22 (no admin, not C:\Program Files\LLVM), then CMake+Ninja with clang/clang++ (not cl.exe). Git Bash is required. This is the right direction; it is not exercised by a required CI job today.
  • Windows CI (install-gate:windows, release-artifacts:windows) is allow_failure: true, tagged homelab-windows (runner not registered), and the remaining rules still mention the deleted branch cursor/lic-install-distribution. These jobs do not run on ordinary MRs to main.

Toolchain / POSIX / runtime

Area State on main
Build on Windows Intended: Clang + Ninja + LLVM 22 MSVC-style prebuilt (user-local tools/llvm-22 or Program Files). CMake has MSYS2/MinGW definition workarounds. Historical li-chem ABI bugs on MSVC-hosted Li program codegen (docs/handoff-lic-windows-abi-and-build-memory.md, mid-2026) are still a risk for Windows-hosted lic output, even though default lic builds no longer embed li-chem/GTO.
li_rt process fork/waitpid already shimmed with _spawnvp on _WIN32. li_rt_exec_native_ir_build is explicitly unsupported on Windows.
Sockets runtime/li_rt_posix_compat.h + li_rt_winsock.c: Winsock, WSAPoll, closesocket, nonblocking, setsockopt wrappers. Unmerged June branches (fix/windows-winsock-runtime, fix/windows-msys2-build, …) look partly superseded by what is already on main; treat them as audit material, not merge-as-is (they are stale: 2026-06-03/04, merged=false).
epoll / httpd packages/li-net epoll path is Linux-real; non-Linux gets stubs (epoll_create1 → -1). li-httpd is a package (packages/li-net-httpd); default listen in examples/README is 8080, TLS examples 8443 (unprivileged). No setcap in installer scripts. Homelab deploy TOML may use /etc/li-httpd/certs — that is cluster deploy, not the compiler install. Self-hosted compiler install must not require ports < 1024. Full Windows IOCP/httpd parity is out of scope for the first install milestone.
mmap / AF_UNIX Still used in some package natives (e.g. llm cache mmap, net reactor unix sockets). Need #ifdef or shims before those packages are part of a Windows default runtime.
Lean / AutoVC Pin is leanprover/lean4:v4.35.0. elan works on Windows in principle; there is no Windows Lean CI job. Basic install smoke (lic --version, compile examples/hello.li) must not require Lean. Full --lean verify on Windows is a later phase.
Path handling Prefix layout is portable ($prefix/bin, $prefix/share/lic). Compiler must keep locating std/runtime via LI_REPO_ROOT / install prefix, never /usr/local or C:\Program Files hardcoded.

Roadmap / tracker

  • No root ROADMAP.md. Canonical ecosystem roadmap is pointed at docs/ecosystem/vision-and-roadmap.md (stub → li-langverse/roadmap). Install guides: docs/guide/install.md, install-linux.md, install-windows.md.
  • GitLab labels in lic: P0, R1, bug, ci, flaky, hardening, paper, parked, priority::high, security, soundness, spec, v0.2.0, verify. There is no roadmap label, so this issue is filed unlabelled rather than inventing one.
  • No open issue already covers admin-free install or first-class Windows support.

Blockers (ordered)

  1. No real Windows lic.exe release asset — this is the critical path. Stub machinery must not be published as the official windows-amd64 artifact.
  2. No required Windows CI runner (homelab-windows unregistered). Acceptance needs a non-admin Windows job (self-hosted or a cloud Windows runner Julian approves).
  3. Residual POSIX in default runtime/packages (epoll no-ops, li_rt_exec_native_ir_build, mmap/AF_UNIX in optional packages) and historical Windows ABI risk for generated code.
  4. Linux prebuilt is not fully self-contained (dynamic libz3 / libzstd / libz); from-source still documents sudo for LLVM.
  5. Packaging placeholders (scoop/winget/choco/Inno version 0.1.0, placeholder hashes) and Windows default prefix ~\.local rather than %LOCALAPPDATA%\Programs\lic.
  6. check-release-assets.sh will accept a stub zip if one is attached under the expected name. Must be tightened when a real asset ships.
  7. Lean/AutoVC on Windows is unverified (not a blocker for install smoke).

Phases and effort

Effort: S ≈ days, M ≈ 1–2 weeks, L ≈ multi-week / needs a runner or substantial port.

  • Phase A — Linux admin-free hardening (S). Keep tarball + install.sh --prefix=$HOME/.local as the official self-hosted path (no sudo). Optionally append a user profile PATH line when asked. Document or bundle/static-link libz3/libzstd/libz so a non-root machine can run the prebuilt. From-source: user-local LLVM (already the pattern in scripts/llvm-env.sh / tools/) instead of sudo ci-install-llvm.sh. CI: install-and-smoke as a non-root user in a container (drop privileges after image setup; prefix under $HOME/.local; lic --version + lic build examples/hello.li). .deb/system packages stay optional.
  • Phase B — Real Windows compiler, no stub (L, critical path). Make scripts/setup-llvm-dev.ps1 + scripts/build.ps1 produce a non-stub lic.exe + li_rt and stage lic-VERSION-windows-amd64.zip. Audit stale June fix/windows-* / fix/winsock-* branches against current main (do not merge wholesale). Re-check Windows-hosted codegen ABI on a small smoke (hello + a non-chem contract). Leave li-httpd/epoll feature parity for Phase E. Do not attach a stub to a tagged release.
  • Phase C — Windows admin-free installer (M, after a real zip). Official prefix %LOCALAPPDATA%\Programs\lic (or document ~\.local as a compat alias). PATH via HKCU / user environment only; no HKLM, no admin MSI. Ship zip + Scoop manifest + Winget user-scope portable installer; Inno PrivilegesRequired=lowest only if we also ship Setup.exe. Refresh 0.1.0 placeholders. install.ps1 -NativeOnly must succeed without WSL and must fail closed on a stub. Self-update: extend install-upgrade / Install-LiUpgradePurge to the Windows zip path (partially present).
  • Phase D — Lean / AutoVC on Windows (M, optional for install). elan + lean-toolchain 4.35.0 in user space; a CI verify job can start as allow_failure. Not required to close the install requirement.
  • Phase E — li-httpd / net on Windows (M–L, after B). Keep defaults on unprivileged ports (8080/8443). Replace epoll stubs with a WSAPoll/IOCP reactor only as needed. Unix sockets / privileged ports / setcap / system systemd units stay out of the default install.
  • Phase F — Release-asset honesty + required gates (M, when a tag exists). check-release-assets must require a non-stub windows-amd64 zip (e.g. lic --version inside the unpacked zip must not match *-stub). Turn on a required Windows non-admin install-and-smoke job once a runner exists. Do not weaken the gate; do not publish a stub to satisfy it.

Acceptance criteria

  • A non-root Linux user in a container can install with install-li.sh --prefix="$HOME/.local" (no sudo) and run lic --version plus a hello-world build.
  • A non-admin Windows user can install from a published lic-*-windows-amd64.zip (or Scoop/Winget user-scope) into a user prefix, get a User-PATH update without HKLM, and run lic --version plus hello-world without WSL and without a stub.
  • CI jobs exist for both cases (Windows job may start optional until a runner is registered, then become required).
  • Tagged releases that check-release-assets covers include a real Windows zip, or the Windows name is not listed as satisfied by a stub.
  • Self-hosted docs lead with the admin-free path; --system / .deb / WSL are clearly optional.

Librebase compatibility

  • lic must stay Librebase-compatible: do not hardcode /usr/local, /opt, /etc, or C:\Program Files into compiler or runtime lookup. Keep the existing prefix layout ($prefix/bin, $prefix/share/lic with std/runtime) and LI_REPO_ROOT / LI_INSTALL_PREFIX so Librebase can invoke lic from a user prefix on PATH.
  • Default lic already opts out of li-chem / studio embeds (LI_WITH_LI_CHEM / LI_WITH_STUDIO off). Windows/Linux install artifacts should stay on that slim default.
  • A Librebase self-host as a user service must not require root to install or upgrade lic.
  • Code changes only via Cursor cloud-agent MRs; no merge without Julian’s OK on a concrete head.

Proposed roadmap bullet (do not edit files in this issue)

For a later MR to docs/guide/install.md and, if maintainers want, li-langverse/roadmap:

Self-hosted lic: installation must work without admin/root (user-space prefix: ~/.local on Unix, %LOCALAPPDATA%\Programs\lic on Windows) and must be a first-class Windows install (real lic.exe, no stub, no WSL required). System packages and WSL remain optional. See lic#NNN.

Suggested first cloud-agent MR

Phase A only (Linux non-root install-and-smoke CI + prebuilt dependency/docs + no-sudo from-source LLVM hint). Small, does not wait on a Windows runner, and delivers half of Julian’s requirement with low risk.

Phase B (real Windows lic.exe) is the critical path after that; it needs either a registered homelab-windows runner or another Windows CI Julian approves, and should be a separate MR.