-
Notifications
You must be signed in to change notification settings - Fork 49
Allow stubbing out some transitive dependencies #185
Comments
A probably particularly-common example of where this would be helpful is for documenting rules that depend on stuff in |
Indeed (might help fix #166) |
@adam-azarchs is there an issue open for the |
Not that I am aware of, unless you count #166. |
I have a proof of concept to solve this with option (1), though I have some concerns with going forward with it. I'd like to describe the proposal here: "When missing an import, Stardoc will automatically treat any symbols that would have been defined by setting them to None". This may work in to resolve any cases where there's a transitive dependency which loads a symbol which isn't used in important ways (for example, if the symbol is used in any rule function -- Stardoc doesn't invoke those!) However, I have two concerns:
For example, suppose we aim to load a missing function
We will get an error that ...but is that good enough?
We could mitigate this by making it sufficiently difficult to interact with a missing symbol in meaningful ways. For example, we could make missing symbols not swapped in with None, and instead use a new Starlark object type which doesn't support Alternative considerations
|
@jin @laurentlb for your consideration |
Is there any way to make |
The only reasonable approach I can think of here is to expose (public visibility) a glob of all Starlark files under |
That target exists, |
Looks like Might be worth fixing that separately -- for now, I wonder if introducing a new target to comprise only all Starlark files under |
This is not fixed in an ideal manner, as of yet, but will have a decent workaround with the next bazel release: Add |
It would be nice if Stardoc was able to function without having the full transitive set of bzl files available (as not all of them are relevant in Stardoc's processing; Stardoc only needs approximately "loading phase" evaluation of the Starlark code)
A couple of options:
This might make for easier adoption in cases where
bzl_libary
targets are not created for one's transitive dependencies.The text was updated successfully, but these errors were encountered: