Skip to content

fix: link libLeanExport.a into executables that link Lake - #14963

Merged
Kha merged 1 commit into
masterfrom
lake-leanexport-link
Aug 29, 2026
Merged

fix: link libLeanExport.a into executables that link Lake#14963
Kha merged 1 commit into
masterfrom
lake-leanexport-link

Conversation

@Kha

@Kha Kha commented Aug 29, 2026

Copy link
Copy Markdown
Member

This PR fixes a link failure in downstream packages that build an executable: libLake.a references LeanExport symbols, but -lLeanExport was missing from the static link line, so linking failed with undefined initialize_LeanExport_Parse, runtime_initialize_LeanExport_Parse and l_LeanExport_parseStream.

lake challenge made Lake depend on LeanExport, and LAKESHARED_LINKER_FLAGS was updated accordingly, but LEANC_STATIC_LINKER_FLAGS was not. Lean core libs are linked statically into executables on every platform but Windows (see LeanExe.sharedLean), so this affected essentially every downstream executable importing Lake. The new linkLake Lake test builds and runs such an executable, importing Lake.All so that all of Lake's cross-library references are exercised.

This PR fixes a link failure in downstream packages that build an executable: `libLake.a` references `LeanExport` symbols, but `-lLeanExport` was missing from the static link line, so linking failed with undefined `initialize_LeanExport_Parse`, `runtime_initialize_LeanExport_Parse` and `l_LeanExport_parseStream`.

`lake challenge` made Lake depend on `LeanExport`, and `LAKESHARED_LINKER_FLAGS` was updated accordingly, but `LEANC_STATIC_LINKER_FLAGS` was not. Lean is linked statically into executables on every platform but Windows (see `LeanExe.sharedLean`), so this affected essentially every downstream executable importing Lake. The new `linkLake` Lake test builds and runs such an executable, importing `Lake.All` so that all of Lake's cross-library references are exercised.
@Kha Kha added the changelog-no Do not include this PR in the release changelog label Aug 29, 2026
@Kha
Kha requested a review from tydeu August 29, 2026 11:02
@Kha
Kha enabled auto-merge August 29, 2026 11:02
@Kha
Kha added this pull request to the merge queue Aug 29, 2026
@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 Aug 29, 2026
@mathlib-lean-pr-testing

Copy link
Copy Markdown

Mathlib CI status (docs):

  • ❗ Mathlib CI can not be attempted yet, as the nightly-testing-2026-08-29 tag does not exist there yet. We will retry when you push more commits. If you rebase your branch onto nightly-with-mathlib, Mathlib CI should run now. You can force Mathlib CI using the force-mathlib-ci label. (2026-08-29 11:20:46)

@leanprover-bot

Copy link
Copy Markdown
Collaborator

Reference manual CI status:

  • ❗ Reference manual CI can not be attempted yet, as the nightly-testing-2026-08-29 tag does not exist there yet. We will retry when you push more commits. If you rebase your branch onto nightly-with-manual, reference manual CI should run now. You can force reference manual CI using the force-manual-ci label. (2026-08-29 11:20:48)

Merged via the queue into master with commit 80e859f Aug 29, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog-no Do not include this PR in the release changelog 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.

2 participants