bazel query //foo/bar:baz --output proto > a
bazel query //foo/bar:baz --output proto > b
diff a b # exit 0
# But if you modify the implementation of the rule of the target,
or if you modify the target bazel query //foo/bar:baz --output proto > c
diff a c
Binary files a and c differ
Algorithm
1. let B = set of BUILD files.
2. For every skylark file modified at this revision, add all BUILD files that could be affected to B (using rbuildfiles).
3. For every BUILD file modified at this revision, add it to B.
4. For every BUILD file added or deleted modified at this revision, add its parent BUILD file to B.
5. let T1 = set of targets defined in BUILD files in B.
6. let R1 = rdeps of all non BUILD/skylark files at this revision
7. check out to previous revision.
8. let T2 = steps 1 to 4 for this revision
9. let R2 = rdeps of all non BUILD/skylark files at this revision
10. let R = R1 union R2
# subtract out targets that we don't need to compare, since we know that we're going
# to be running them anyway.
11. let M1 = T1 - R
12. let M2 = T2 - R
13. F = R union (M1 - M2) # new targets that are affected by BUILD/skylark files
14. P = set of all targets in the intersection of M1 and M2 such that the proto representation of the target is different.
15. return F union (allrdeps P)
--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/8e01308d-eb1b-42ac-920a-7f6ea24d8843%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/8273df73-6c14-4d70-9765-23022e9fa147%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/2974b561-6108-4fd9-af6b-28f7f76bfb43%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/ae707e81-1df7-49cc-8cfa-db2b4c62bf9e%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/11c2742a-732d-4041-8171-a7db39176aa8%40googlegroups.com.
As far as I can tell it is basically the same issue that Utsav is talking about. If I update one of my third party dependencies I want to only build/test affected targets. Once I know which third party dependency has changed that is easy (using rdeps as you mentioned) - but figuring out which third party dependency has changes is not easy as only the `WORKSPACE` file has changed, or only a `package.json` or `requirements.txt`.
If every external repository target would expose a repository_rule_definition_hash in the proto output that would be easier. Actually just thinking about it, the new WORKSPACE.resolved file would probably help here also.
Ha, I actually just gave it a try and in the WORKSPACE.resolved there is an output_tree_hash for each external repository and the content does seem to be valid json, so it would be quite straight forward to parse that, compare it with the previous version and then we know which external deps have changed. So I guess once this feature becomes more mature (I am getting errors currently, will bug report) things should be in a better state.
You received this message because you are subscribed to a topic in the Google Groups "bazel-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/bazel-discuss/I9udqWIcEdI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/b41523db-194b-42f7-974b-b1d2e9de88c7%40googlegroups.com.
Utsav, have you been able to find a scalable solution to this problem yet? We have been ignoring workspace changes for now, but our monorepo is starting to get to a size where wan can not anymore so this is coming onto my radar again.
--
You received this message because you are subscribed to a topic in the Google Groups "bazel-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/bazel-discuss/I9udqWIcEdI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/e264307f-3a1b-41ee-aae5-da083148d08d%40googlegroups.com.
But yes agreed bazel really should provide a good story for this itself.
Hm interesting, how exactly are you making use of this? Any code snippet, pseudo code or hints you could share? Would be highly appreciated.
But yes agreed bazel really should provide a good story for this itself.
--
You received this message because you are subscribed to a topic in the Google Groups "bazel-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/bazel-discuss/I9udqWIcEdI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/6baf3a56-926a-4693-8024-9aa227450775%40googlegroups.com.
bazel query --universe_scope="//..." --order_output=no --experimental_workspace_rules_log_file=workspace.log 'deps(//...)'
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/b8f22145-1e41-4874-827b-a7ff83744b14%40googlegroups.com.