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

--incompatible_no_implicit_watch_label #23861

Closed
fmeum opened this issue Oct 3, 2024 · 0 comments
Closed

--incompatible_no_implicit_watch_label #23861

fmeum opened this issue Oct 3, 2024 · 0 comments
Assignees
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.

Comments

@fmeum
Copy link
Collaborator

fmeum commented Oct 3, 2024

Motivation

Historically, the path method applied to a Label on repository_ctx and module_ctx has been the only way to get Bazel to watch a file. Since the introduction of the watch method and watch 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 a Label to any of these methods, which directly contradicts the intended behavior.

Description

The repository_ctx.path and module_ctx.path methods no longer cause the argument to be watched (previously, they did if and only if the argument is a Label).

Other methods on the context objects no longer watch Label arguments with watch = No.

Incompatible Flag

--incompatible_no_implicit_watch_label

Migration Guide

If any method with a watch parameter is used on the path returned by path, 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 with hasattr 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

@fmeum fmeum added team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. incompatible-change Incompatible/breaking change breaking-change-8.0 labels Oct 3, 2024
@fmeum fmeum self-assigned this Oct 3, 2024
fmeum added a commit to fmeum/bazel that referenced this issue Oct 4, 2024
RELNOTES[inc]: `repository_ctx.path()` and `module_ctx.path()` no longer watch arguments of type `Label`. Use the `watch()` method or the `watch` parameter on other methods on these context objects instead. See bazelbuild#23861 for details.
fmeum added a commit to fmeum/bazel that referenced this issue Oct 4, 2024
RELNOTES[inc]: `repository_ctx.path()` and `module_ctx.path()` no longer watch arguments of type `Label`. Use the `watch()` method or the `watch` parameter on other methods on these context objects instead. See bazelbuild#23861 for details.
@Wyverald Wyverald added the migration-ready Incompatible flag is ready for migration with Bazel rolling releases or Bazel@last_green label Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants