Skip to content

doc(lake): expand require ... with <opts> documentation and -K propagation guidance#14006

Open
kim-em wants to merge 1 commit into
leanprover:masterfrom
kim-em:doc/lake-require-with-opts
Open

doc(lake): expand require ... with <opts> documentation and -K propagation guidance#14006
kim-em wants to merge 1 commit into
leanprover:masterfrom
kim-em:doc/lake-require-with-opts

Conversation

@kim-em

@kim-em kim-em commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

This PR expands the documentation around Lake's require X from … with <options> channel, which is currently mentioned in one sentence in src/lake/README.md and is the only sanctioned way for a workspace-root -K name=value flag to reach a dependency's get_config?. Three edits:

  • src/lake/README.md — expand the "Lean require" section with a worked example that forwards a root -K leanLibDir=… value into a dependency by computing the NameMap String from get_config? at the require site. State explicitly that -K populates only the root package's get_config? and that require … with is the documented per-edge forwarding channel. Briefly note the underspecified conflict semantics when two requires resolve to the same dep with different opts.
  • src/lake/Lake/Config/Dependency.lean — expand the Dependency.opts doc-string from a single line to point at the DSL surface (require … with), the reader (get_config?), and the README section.
  • src/lake/Lake/CLI/Help.lean — extend the -K long-form help blurb to note that the flag's scope is the workspace-root package and to signpost require … with for cross-package forwarding.

The current docs left at least one downstream consumer (leanprover/lp#170 follow-up) iterating through several broken workarounds (env-var fallbacks via @[init], CI-side hacks copying the toolchain archive over system paths) before discovering the existing feature.

Companion design issue for the conflict-semantics piece: #14005.

🤖 Prepared with Claude Code

…ion guidance

This commit expands the documentation around Lake's `require X from … with
<options>` channel, which is currently mentioned in one sentence in
`src/lake/README.md` and is the only sanctioned way for a workspace-root
`-K name=value` flag to reach a dependency's `get_config?`. Three edits:

* `src/lake/README.md` "Lean `require`" section: add a worked example
  showing how to forward a root `-K` value into a dependency, state that
  `-K` populates only the workspace-root package's `get_config?`, and
  reference leanprover#14005 for the
  underspecified conflict semantics when two requires resolve to the same
  dep with different opts.
* `src/lake/Lake/Config/Dependency.lean`: expand the `Dependency.opts`
  doc-string from one line to point at the DSL surface, the `get_config?`
  reader, and the README section.
* `src/lake/Lake/CLI/Help.lean`: extend the `-K` long-form help blurb to
  note the workspace-root scope and to signpost `require … with` for
  cross-package forwarding.

The current docs left at least one downstream consumer
(leanprover/lp#170 follow-up) iterating through
several broken workarounds before discovering the existing feature.

🤖 Prepared with Claude Code

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@kim-em kim-em requested a review from tydeu as a code owner June 11, 2026 05:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant