Conditional transitive dependencies are downloaded unconditionally
Nobody has claimed this yet.
- Dominant language
- Lean
- Stars
- 9.2k
- Forks
- 990
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 175
Description
Transitive dependencies which are only dependencies of a dependency conditionally (for example, doc-gen4 is a dependency of mathlib only if mathlib gets the config option doc = on) are downloaded even if they shouldn't because the condition is false.
To reproduce, run:
mkdir test && cd test && lake init test math && lake update
This should not download doc-gen4 (at least, with the current dependencies listed by mathlib, std4, etc.), and instead, lake update should only download doc-gen4 if (e.g.) the lakefile is edited to read require mathlib ... with <options> to specify doc=on.
However, currently it does download doc-gen4 (and all its transitive dependencies).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the mkdir, lake init, and lake update commands in a clean directory, then trace the dependency resolution performed by lake update. The fix is complete when doc-gen4 and its transitive dependencies are not downloaded unless the lakefile enables mathlib's doc=on option.
Written by the indexing model from the issue text.
Assessment
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100