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

libStd.a file not found running nix develop through flake template #4545

Closed
3 tasks done
noghartt opened this issue Jun 24, 2024 · 5 comments
Closed
3 tasks done

libStd.a file not found running nix develop through flake template #4545

noghartt opened this issue Jun 24, 2024 · 5 comments
Labels
bug Something isn't working low priority pr-welcome A PR from an external contributor, implementing the RFC as described, would be welcome.

Comments

@noghartt
Copy link

Prerequisites

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

Description

I have a Macbook M1 Pro, tried to install the Lean4 using the Nix template file, but follow this error below.

ld: warning: directory not found for option '-L/nix/store/5cm04cks3zf4aki08hxp0cp9s5nkhb7v-lean-bin-tools/lib/lean'
ld: file not found: /nix/store/3rnhnbmygslflmcyas6xadpma29pz5ny-Lean-lib/libStd.a
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)

It happens after running the command nix develop and start to build all Lean4 packages.

Context

I tried to do a derivation on this package by myself to debug but couldn't find anything, any idea how to debug it on the right way?

Steps to Reproduce

  1. Create a new Lean4 package using the Nix Flake template (nix flake new mypkg -t github:leanprover/lean4)
  2. Access the package
  3. Try to access the related nix shell running nix develop

Expected behavior:

Should be able to access the Nix shell

Actual behavior:

Be able to access Lean4's Nix shell and build the package

Versions

  • Macbook M1 Pro (Sonoma 14.5)
  • Nix v2.18.1

Additional Information

Impact

@noghartt noghartt added the bug Something isn't working label Jun 24, 2024
@nomeata
Copy link
Contributor

nomeata commented Jun 24, 2024

Thanks for your report. The nix setup to develop Lean packages isn't well supported anymore, unfortunately, and we recommend to use elan, which you can get from nixpkgs. That said, if you can debug the issue and open a PR it will likely be merged (probably just Std, which was recently added, needs to be added to some list where previously only Init and Lean was listed.)

@nomeata nomeata added low priority pr-welcome A PR from an external contributor, implementing the RFC as described, would be welcome. labels Jun 24, 2024
@noghartt
Copy link
Author

Thanks for your report. The nix setup to develop Lean packages isn't well supported anymore, unfortunately, and we recommend to use elan, which you can get from nixpkgs. That said, if you can debug the issue and open a PR it will likely be merged (probably just Std, which was recently added, needs to be added to some list where previously only Init and Lean was listed.)

Oh, I get it.

Seeing the bootstrap.nix, seems that having something wrong at the $LEAN_CC variable. It it right, it should be ${Std.staticLib}/libStd.a here on the bootstrap.nix.

https://github.com/leanprover/lean4/blob/master/nix/bootstrap.nix#L128

I'll write a derivation and test it, if everything OKs, I'll submit a PR. Thanks!

@nomeata
Copy link
Contributor

nomeata commented Jul 23, 2024

@noghartt Did you have success here? Is this related to #3811?

@noghartt
Copy link
Author

Hey @nomeata,

Did you have success here?

Not yet, I didn't have much time to take a look on it, to be honest.

Is this related to #3811?

I need to take a look on it, but seeing the diff, it seems to be related. I'll do some tests with this new merged PR.

@Kha
Copy link
Member

Kha commented Aug 1, 2024

The Nix build has been officially deprecated #4895

@Kha Kha closed this as not planned Won't fix, can't repro, duplicate, stale Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working low priority pr-welcome A PR from an external contributor, implementing the RFC as described, would be welcome.
Projects
None yet
Development

No branches or pull requests

3 participants