System c++ stdlib is not detected by default
Nobody has claimed this yet.
- Dominant language
- Lean
- Stars
- 9.2k
- Forks
- 990
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 175
Description
Prerequisites
- Check that your issue is not already filed:
https://github.com/leanprover/lean4/issues - Reduce the issue to a minimal, self-contained, reproducible test case.
Avoid dependencies to Mathlib or Batteries. - Test your test case against the latest nightly release, for example on
https://live.lean-lang.org/#project=lean-nightly
(You can also use the settings there to switch to “Lean nightly”)
Description
LEAN_CXX_STDLIB is hardcoded based on the target instead of detected from the default system c++ stdlib.
Context
I have confirmed that applying a patch to the system package works, but it would be better if it was detected correctly upstream with no local/distro patch required.
Steps to Reproduce
- Compile lean without passing the correct
-DLEAN_CXX_STDLIBmanually. lake initlake build
Expected behavior: Build completed successfully (8 jobs).
Actual behavior: trace log prints a cc command with the wrong c++ stdlib, and fails to link with many undefined references.
Versions
Lean (version 4.23.0, x86_64-pc-linux-gnu, Release)
6.18.9-gentoo
Additional Information
$ eselect profile show
Current /etc/portage/make.profile symlink:
default/linux/amd64/23.0/llvm/systemd
Impact
Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating where LEAN_CXX_STDLIB is selected from the target during the Lean build configuration. Reproduce with the reported Gentoo system using lake init and lake build, then inspect the traced cc command. Done means the default system C++ standard library is detected and the build completes without undefined-reference linker errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100