Skip to content

Compiler crashes on modules that import both a precompiled library and Lake.CLI #11827

@zqy1018

Description

@zqy1018

Prerequisites

Description

When Lean compiles a file that imports both Lake.CLI and a module from a package that uses precompiled modules, it crashes with SIGSEGV.

Steps to Reproduce

  1. Download Archive.zip. It's the archive of a minimal Lean project to reproduce this issue.
  2. Unzip it, go into the directory and run lake build Mini.

Expected behavior: Build succeeded.

Actual behavior: Build failed with error: Lean exited with code 139.

Versions

  • Lean version: lean4-nightly:nightly-2025-12-28
  • OS version: MacOS 26.1 (arm64)

Additional Information

This seems related to #7388 (fixed by #8383), but that issue was closed, so I'm opening a new issue.

For the MWE above, the issue disappears if either precompileModules is disabled, or if import Lake.CLI is moved from Mini.lean into Mini/Basic.lean.

I cannot reproduce this issue on a Linux machine.

Impact

Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions