Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: staged CMake build with Lake as a plugin #6929

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tydeu
Copy link
Member

@tydeu tydeu commented Feb 3, 2025

This PR passes the previous stages Lake as a plugin to the next stage's Lake in the CMake build. This enables Lake to use its own builtin elaborators / initializers at build time.

The Lake plugin is stored as lib/lean/Lake.(dll|dynlib|so), which is just a copy of the Lake shared library (libLake_shared). The shared library cannot be used directly because its naming scheme is not compatible with --plugin (which requires the module name and library name to match exactly).

@tydeu tydeu added the changelog-lake Lake label Feb 3, 2025
@github-actions github-actions bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Feb 3, 2025
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Feb 3, 2025
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Feb 3, 2025
@leanprover-community-bot leanprover-community-bot added the builds-mathlib CI has verified that Mathlib builds against this PR label Feb 3, 2025
@leanprover-community-bot
Copy link
Collaborator

Mathlib CI status (docs):

@tydeu
Copy link
Member Author

tydeu commented Feb 4, 2025

@Kha Due to naming constraints I did not reuse libLake_shared. Alternatively, I could just rename it (but then it would not following the naming conventions of the other libraries). What do you think?

@tydeu tydeu marked this pull request as ready for review February 4, 2025 00:36
@tydeu tydeu requested a review from Kha February 4, 2025 00:36
@Kha
Copy link
Member

Kha commented Feb 4, 2025

I think we should just strip _shared suffixes in --plugin

@tydeu
Copy link
Member Author

tydeu commented Feb 4, 2025

@Kha lib prefixes as well?

@Kha
Copy link
Member

Kha commented Feb 4, 2025

Right, I suppose so. I don't see a downside at least, these would be weird prefixes/suffixes for a module name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
builds-mathlib CI has verified that Mathlib builds against this PR changelog-lake Lake toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants