Skip to content

extern_lib targets from dependencies aren't loaded when compiling lean files  #4565

@KislyjKisel

Description

@KislyjKisel

Prerequisites

Please put an X between the brackets as you perform the following steps:

Description

When making an extern_lib that uses symbols from an extern_lib in a dependency, an error occurs while compiling a lean file.

Context

Prior discussion on the Lean Zulip.

Steps to Reproduce

  1. Define extern_lib referencing a symbol in a dependency's extern_lib
  2. Build

MWE

Expected behavior: Build succeeds.

Actual behavior:

trace: .> LEAN_PATH=././.lake/packages/b/.lake/build/lib:././.lake/build/lib LD_LIBRARY_PATH=././.lake/build/lib:././.lake/build/lib /home/oopa/.elan/toolchains/stable/bin/lean ././././A.lean -R ./././. -o ././.lake/build/lib/A.olean -i ././.lake/build/lib/A.ilean -c ././.lake/build/ir/A.c --load-dynlib=././.lake/build/lib/libleanffia.so --json
info: stderr:
libc++abi: terminating due to uncaught exception of type lean::exception: error loading library, ././.lake/build/lib/libleanffia.so: undefined symbol: b_class
error: Lean exited with code 134
Some builds logged failures:
- A
error: build failed

Versions

"4.8.0"
"4.10.0-nightly-2024-06-25"
Fedora Linux 6.8.9-300.fc40.x86_64

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