Open dslomov opened 6 years ago
Another related feature request is partial redoing of a repository rule if only parts of the dependencies changes. The use case (#3395) is changing the patches/programmatic transformations to an http_archive
; in this case, we need to obtain the differently patched external repository without downloading the (unchanged) archive again. (Currently, this can be mitigated with --experimental_repository_cache
, but an out-of-the-box solution would be preferable.)
One possible way to obtain this would be to split the repository rule in to
Splitting repository rules into (fetch, modify_dir) steps would make it difficult to fetch different artifacts based on system state, as used when (for example) fetching different binary packages based on local os/arch/libc.
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 14 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-bazeler". Please reach out to the triage team (@bazelbuild/triage
) if you think this issue is still relevant or you are interested in getting the issue resolved.
@Wyverald is working on this
Current behavior of repository rules, documented here: https://docs.bazel.build/versions/master/skylark/repository_rules.html#when-is-the-implementation-function-executed:
causes pretty bad unexpected behaviors, evidenced, for example, in this patch: https://github.com/bazelbuild/bazel/commit/ada0c370c2a3ea484925bc4e7d927b015bc4ad92
We must make sure that repository rule functions never observably re-execute. Otherwise the semantics of repository rules is magic, extremely hard to debug and reason about. It pains me greatly that we are shipping something this broken.
One potential way to fix it is to implement restarts from arbitrary execution point in Skylark interpreter (continuation save/restore).