Skip to content
This repository has been archived by the owner on Oct 25, 2023. It is now read-only.

EnvExtension for in-code configuration #58

Closed
xubaiw opened this issue Mar 10, 2022 · 7 comments
Closed

EnvExtension for in-code configuration #58

xubaiw opened this issue Mar 10, 2022 · 7 comments
Labels
enhancement New feature or request invalid This doesn't seem right

Comments

@xubaiw
Copy link

xubaiw commented Mar 10, 2022

How about adding an EnvExtension to lake so that we can add to package configuration directly in code with CoreM?

The original thought is to trace external files in include_str, and it comes to a more generalized pattern:

  1. include_str can specify the external file to trace with this extension.
  2. lean4-alloy can notify lake to build the generated file.
  3. codes can now depend on some common packages for system library searching heuristics.
@xubaiw
Copy link
Author

xubaiw commented Mar 10, 2022

But now I'm not very clear about the type of this extension. Shall we expose a full StateT m PackageConfig or to have some restriction on that?

@tydeu tydeu added the enhancement New feature or request label Mar 10, 2022
@tydeu
Copy link
Member

tydeu commented Mar 10, 2022

To clarify, do you mean an environment extension that is is used when elaborating the lakefile or an extension that is used when elaborating source files in the package? If you mean the later, this would require some form import or plugin to augment the environment as lake doesn't currently have any direct control over source file elaboration.

@xubaiw
Copy link
Author

xubaiw commented Mar 10, 2022

Oh I made a mistake on how lake works. I mean the source file. So we may have to hack into leanc for this to work.

@tydeu tydeu added the invalid This doesn't seem right label Jun 24, 2022
@tydeu tydeu closed this as completed Jun 24, 2022
@tydeu
Copy link
Member

tydeu commented Jun 24, 2022

Fyi, I closed this as it was born from a confusion about how Lake works and that confusion has been cleared up.

@gebner
Copy link
Member

gebner commented Jun 24, 2022

This was a bit of #xy, but the original issue is still unsolved. Should we add another issue for "how to tell lake about dependencies like files read by include_str"?

@tydeu
Copy link
Member

tydeu commented Jun 24, 2022

Should we add another issue for "how to tell lake about dependencies like files read by include_str"?

@gebner Sure. A clear issue on matter explain what is desired would be good. It wasn't even clear to me that was primary proposition here. (I see that is used sort of as a motivating example, but the proposed feature was very different.)

@gebner
Copy link
Member

gebner commented Jun 24, 2022

Done. leanprover/lean4#2762

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

3 participants