Skip to content

fix: pass Lake module setup to highlighted extractor#222

Open
ejgallego wants to merge 4 commits into
leanprover:mainfrom
ejgallego:codex/highlighted-lake-setup
Open

fix: pass Lake module setup to highlighted extractor#222
ejgallego wants to merge 4 commits into
leanprover:mainfrom
ejgallego:codex/highlighted-lake-setup

Conversation

@ejgallego

@ejgallego ejgallego commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Fix highlighted source extraction for modules whose Lake build context includes setup data, such as dynamic libraries.

The highlighted module facet now passes Lake's module setup file to subverso-extract-mod when Lake exposes one. The extractor loads that setup before elaboration, so extraction sees the same imports, options, plugins, import artifacts, dynamic libraries, and package metadata as the module build. Older Lake versions continue using the existing extractor arguments.

This adds an FFI regression fixture that builds a dynamic library and checks Ffi:highlighted. The fixture runs on Lean 4.27 and newer; setup files exist in some earlier module-system releases, but this fixture's extern #eval fails during the module build before SubVerso extraction runs there.

Related: #221 , thanks to @kim-em for submitting the report and a preliminary fix.

@ejgallego
ejgallego force-pushed the codex/highlighted-lake-setup branch from 3e0dad3 to a1eb3e3 Compare July 3, 2026 17:38
@ejgallego ejgallego changed the title [codex] fix highlighted facet Lake module setup fix: honor Lake module setup in highlighted facet Jul 3, 2026
@ejgallego
ejgallego force-pushed the codex/highlighted-lake-setup branch 2 times, most recently from c809243 to feb86d0 Compare July 3, 2026 18:44
@ejgallego ejgallego changed the title fix: honor Lake module setup in highlighted facet fix: pass Lake module setup to highlighted extractor Jul 6, 2026
@ejgallego
ejgallego marked this pull request as ready for review July 6, 2026 11:44
@ejgallego

Copy link
Copy Markdown
Contributor Author

CI problems seem to be also present upstream, investigating. Otherwise this PR is ready for review.

@ejgallego
ejgallego force-pushed the codex/highlighted-lake-setup branch from db5981c to af2adcc Compare July 7, 2026 14:28
@ejgallego

Copy link
Copy Markdown
Contributor Author

CI problems seem to be also present upstream, investigating. Otherwise this PR is ready for review.

Fixed by #223

@kim-em , let me know if this PR works for you, then I think we can merge.

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