Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
3 tasks done
KislyjKisel opened this issue Jun 25, 2024 · 0 comments · Fixed by #4566
Closed
3 tasks done

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

KislyjKisel opened this issue Jun 25, 2024 · 0 comments · Fixed by #4566
Labels
bug Something isn't working

Comments

@KislyjKisel
Copy link

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.

@KislyjKisel KislyjKisel added the bug Something isn't working label Jun 25, 2024
github-merge-queue bot pushed a commit that referenced this issue Jun 27, 2024
Addresses a few issues with precompile library computation. 

* Fixes a bug where Lake would always precompile the package of a
module.
* If a module is precompiled, it now precompiles its imports.
Previously, it would only do this if imported.

Closes #4565.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant