Closed alexeagle closed 3 weeks ago
Largely this is the case because the ruleset aims to support workspace users.
I'd be happy to help with this - but I don't see how workspace is related. Shouldn't the repository rules behave the same regardless whether they are called by a module extension vs. from WORKSPACE or from a repository macro? They produce the same external repos?
There’s no equivalent to module_ctx in the workspace case, so we need to generate an additional repo which in turn generates the underlying tool/arch repos. If it was just bzlmod it’s pretty trivial to handle.
I'd expect that if I add an entry to multitool.lock.json which is not referenced anywhere, the corresponding toolchain will be defined but the tool itself is never fetched.
However https://github.com/theoremlp/rules_multitool/pull/58 shows a reproduction adding a new entry and it DOES get fetched. This means users with a big lockfile (or who accumulate third-party lockfiles into their hub, such as from rules_lint) will spend time fetching tools they don't need.