--incompatible_no_implicit_watch_label #23861
Labels
breaking-change-8.0
incompatible-change
Incompatible/breaking change
migration-ready
Incompatible flag is ready for migration with Bazel rolling releases or Bazel@last_green
team-ExternalDeps
External dependency handling, remote repositiories, WORKSPACE file.
Motivation
Historically, the
path
method applied to aLabel
onrepository_ctx
andmodule_ctx
has been the only way to get Bazel to watch a file. Since the introduction of thewatch
method andwatch
parameters on many other methods, there are far more flexible and consistent ways to watch paths. Furthermore,watch = No
is currently not honored when passing aLabel
to any of these methods, which directly contradicts the intended behavior.Description
The
repository_ctx.path
andmodule_ctx.path
methods no longer cause the argument to be watched (previously, they did if and only if the argument is aLabel
).Other methods on the context objects no longer watch
Label
arguments withwatch = No
.Incompatible Flag
--incompatible_no_implicit_watch_label
Migration Guide
If any method with a
watch
parameter is used on the path returned bypath
, no action needs to be taken since it will be watched automatically in all versions of Bazel with the incompatible flag.In other cases, explicitly call
watch
on the method if available, which can be tested withhasattr
on the context object.In which Bazel LTS version will this incompatible change be enabled?
Bazel 8
Additional Context
No response
TODO List
No response
The text was updated successfully, but these errors were encountered: