Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cyclic computation error with dynamic_output #636

Open
avdv opened this issue May 2, 2024 · 0 comments
Open

Cyclic computation error with dynamic_output #636

avdv opened this issue May 2, 2024 · 0 comments

Comments

@avdv
Copy link
Contributor

avdv commented May 2, 2024

I was using dynamic_output in our code base and at one point just got an error like this:

Cyclic computation detected when computing key `(target: `root//backend/src:backend_infra (prelude//platforms:default#904931f735703749)`, id: `1234`)`, which forms a cycle in computation chain: `(target: `root//backend/src:docs (prelude//platforms:default#904931f735703749)`, id: `1`) -> (target: `root//backend/src:backend_lib (prelude//platforms:default#904931f735703749)`, id: `110`) -> (target: `root//backend/src:backend_infra (prelude//platforms:default#904931f735703749)`, id: `1234`) -> (target: `(target: `root//backend/src:backend_infra (prelude//platforms:default#904931f735703749)`, id: `1233`)`, id: `38`)`

It turned out at one place I forgot to access an output for an action inside of the dynamic_output callback using the output parameter that is passed in:

def compile(ctx, artifacts, outputs, out1):
   ...
   ctx.actions.run(
     cmd_args(
       compiler,
       outputs[out1].as_output(),
       "--odir",
       cmd_args(out1.as_output(), parent=1), # <--- here
      ),
      category  = "...",
   ) 

Would it be possible to warn about this situation when a cmd_args instance is trying bind an output artifact in an action within the context of the dynamic output that is not referenced through output? Thanks!

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

No branches or pull requests

1 participant