leanprover / leanprover/lean4

System c++ stdlib is not detected by default

Open
#12,658 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug P-low
Dominant language
Lean
Stars
9.2k
Forks
990
Avg merge
1d 17h
Merged PRs (30d)
175

Description

Prerequisites
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
  1. Compile lean without passing the correct -DLEAN_CXX_STDLIB manually.
  2. lake init
  3. lake 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.