Closed vindard closed 1 month ago
What’s the point of rebuilding B if it’s just going to generate the same output every time?
What’s the point of rebuilding B if it’s just going to generate the same output every time?
It technically doesn't need to be rebuilt after its first build. But it needs to signal to other rules it's an input of, that its own dependencies have changed.
What inputs actually influence the output of B? If it really never changes, then I think you should upload the bin file somewhere, and download it with http_archive()
. It sounds like B
should not have a dependency on anything, since nothing influences the nature of its output, and instead C
should have a direct dependency on A
as well as a dependency on B
.
It sounds like
B
should not have a dependency on anything, since nothing influences the nature of its output, and insteadC
should have a direct dependency onA
as well as a dependency onB
.
Yup this is the approach we sort of took in https://github.com/GaloyMoney/galoy/pull/4172 and now I'm thinking it's probably the correct one for best representing what we have. Closing for now based on this, thanks!
Description
We've come across an interesting challenge where we have the following situation:
How can we get Rule C to rebuild if Rule A's dependencies change and both Rule A and Rule B correctly rebuild?
Two approaches we've explored:
(Non buck-native approach) Take a hash of Rule A's dependencies and include it in the output of Rule B so that it changes from build to build and re-triggers Rule C -> see https://github.com/GaloyMoney/galoy/pull/4169
(Buck-native approach) Pass the dependencies of Rule A into Rule C as well to trigger rebuild in a non-Rule-B-dependent way -> see https://github.com/GaloyMoney/galoy/pull/4172
We've decided to go with the first approach for now since it more accurately reflects the inter-relationship between the rules, but ideally we'd like to figure out if there is some buck-native way to accomplish this without having to hack a changing dependency state in as we've done.