Zulip Chat Archive

Stream: mathlib4

Topic: Can I use `buildLeanPackage` with custom lean leanmake lake


Alissa Tung (Dec 23 2023 at 09:07):

and leanc?

In the official repo of Lean4 contains a flake, it has an output package buildLeanPackage. I can call buildLeanPackage with custom lean leanmake lake leanc? They comes from I package I had already made

Joachim Breitner (Dec 23 2023 at 09:41):

The nix setup is not very actively used and maintained, so if you want to go that route, you probably have to answer many questions yourself.

Alissa Tung (Dec 23 2023 at 09:46):

Joachim Breitner 发言道

The nix setup is not very actively used and maintained, so if you want to go that route, you probably have to answer many questions yourself.

I will try to write a plain drv to do that, where as the build result in $out will just contains .lake... I am not sure whether this is acceptable for using libraries as dependencies for daily development, and how can I use it though

Joachim Breitner (Dec 23 2023 at 10:05):

Worth a try. In the long run we probably want a nix setup that builds on top of lake, rather than replicating some of its work; sounds like that is what you have in mind.

Alissa Tung (Dec 23 2023 at 15:35):

After some inspection on the structure of Nix build outputs, I decide to write a lake2nix package. Wish it goes okay

Eric Wieser (Dec 23 2023 at 17:05):

Joachim Breitner said:

Worth a try. In the long run we probably want a nix setup that builds on top of lake, rather than replicating some of its work; sounds like that is what you have in mind.

This presumably would need some way to query a dependency graph from lake before building, and a way to ask lake to generate trace files when invoked on a single target?

Joachim Breitner (Dec 23 2023 at 18:18):

Or forfeit fine-grained derivations, and map lake packages to nix derivations, or even full projects. Kinda sad. It'd not be useful for developing, but for testing , packaging and deployment only, I fear

Joachim Breitner (Dec 23 2023 at 18:19):

Alissa Tung said:

After some inspection on the structure of Nix build outputs, I decide to write a lake2nix package. Wish it goes okay

Prior (and AFAIK) discontinued work at https://github.com/Kha/nale


Last updated: May 02 2025 at 03:31 UTC