Skip to content

Commit

Permalink
Refetch version repositories when Bazel version changes (#26)
Browse files Browse the repository at this point in the history
Since every version change requires a server restart, it suffices to
mark the version-dependent repos as `local`.

Fixes #25
  • Loading branch information
ngiloq6 authored Nov 8, 2023
1 parent c07aa2b commit ed0e733
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions private/globals_repo.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ def _globals_repo_impl(rctx):

globals_repo = repository_rule(
_globals_repo_impl,
# Force reruns on server restarts to keep native.bazel_version up-to-date.
local = True,
attrs = {
"globals": attr.string_dict(
mandatory = True,
Expand Down
6 changes: 5 additions & 1 deletion private/version_repo.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@ def _version_repo_impl(rctx):
rctx.file("BUILD.bazel", "exports_files([\"version.bzl\"])")
rctx.file("version.bzl", "version = '" + native.bazel_version + "'")

version_repo = repository_rule(_version_repo_impl)
version_repo = repository_rule(
_version_repo_impl,
# Force reruns on server restarts to keep native.bazel_version up-to-date.
local = True,
)

0 comments on commit ed0e733

Please sign in to comment.