Skip to content

perf: lazy third-party typedefs#372

Merged
ivov merged 1 commit into
mainfrom
lazy-third-party-typedefs-v2
May 9, 2026
Merged

perf: lazy third-party typedefs#372
ivov merged 1 commit into
mainfrom
lazy-third-party-typedefs-v2

Conversation

@ivov
Copy link
Copy Markdown
Owner

@ivov ivov commented May 9, 2026

Adds lazy generation of typedefs for third-party Go deps.

lis add, lis check, lis run and lis build now populate a project's typedef cache only for the pkgs that user code imports, rather than every public package of every reachable Go module. Until now, any CLI command that touched the cache (re)generated it eagerly, e.g. lis add github.com/golang-migrate/migrate/v4 walked the full dep tree and generated typedefs for all driver and SDK pkgs even if unimported.

In the new lazy setup:

  • lisette.toml is the allowlist. The manifest declares every Go module any future import can reach.
  • The cache at target/.lisette/typedefs/ is the working set, grows lazily as users write imports.
  • lis sync warms the cache from source for offline or CI use, exits non-zero when bindgen fails.

Blank imports follow Go's semantics: import _ "go:github.com/foo/bar" validates that the module is declared but never reads or generates the typedef, so side-effect-only deps stay link-only.

A project-scoped lock at target/.lisette/.lis-target.lock serializes concurrent lis check/run/build/sync and LSP analysis so they do not race on target/go.mod while bindgen is running. The LSP shares the bindgen runner with the CLI, so opening a file on a fresh checkout fills the cache as the editor discovers imports.

@ivov ivov merged commit 5b4a849 into main May 9, 2026
11 checks passed
@ivov ivov mentioned this pull request May 9, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Released in lisette-v0.2.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant