Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/formatting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
types:
- opened
- synchronize
merge_group:

jobs:
code-format-checks:
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ repos:
rev: 0.1.5
hooks:
- id: buildifier
args: [--version, "v8.2.0"]
args: [--version, "v8.5.1"]
- id: buildifier-lint
args: [--version, "v8.2.0", --warnings=all]
args: [--version, "v8.5.1", --warnings=all]
- repo: https://github.com/crate-ci/typos
rev: v1.38.1
hooks:
Expand Down
2 changes: 1 addition & 1 deletion cargo/private/cargo_build_script.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def _prefix_pwd_to_flag(args, flag_variations):

Args:
args (list): List of tool arguments.
flag ([str]): The flag variants to look for (e.g., ["-LIBPATH", "-L"], ["-B"], ["-isystem"], ["-resource-dir"]).
flag_variations (list[str]): The flag variants to look for (e.g., ["-LIBPATH", "-L"], ["-B"], ["-isystem"], ["-resource-dir"]).

Returns:
list: The modified argument list with relative paths prefixed with ${pwd}.
Expand Down
7 changes: 6 additions & 1 deletion cargo/private/cargo_utils.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,13 @@ def _resolve_repository_template(
if repo.startswith("@"):
repo = repo[1:]
prefix = "@"
elif repo.startswith("@@"):
elif repo.startswith(
# buildifier: disable=canonical-repository
"@@",
):
repo = repo[2:]

# buildifier: disable=canonical-repository
prefix = "@@"

suffix = ""
Expand Down
1 change: 1 addition & 0 deletions crate_universe/extensions.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,7 @@ def _generate_hub_and_spokes(
)

# The workspace root when one is explicitly provided.
# buildifier: disable=canonical-repository
nonhermetic_root_bazel_workspace_dir = module_ctx.path(Label("@@//:MODULE.bazel")).dirname

# If re-pinning is enabled, gather additional inputs for the generator
Expand Down
2 changes: 2 additions & 0 deletions crate_universe/private/crates_vendor.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ def _prepare_manifest_path(target):
manifest,
manifest.short_path,
))

# buildifier: disable=external-path
return manifest.short_path.replace("../", "${output_base}/external/", 1)

return "${build_workspace_directory}/" + manifest.short_path
Expand Down
5 changes: 4 additions & 1 deletion crate_universe/private/splicing_utils.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ def compile_splicing_manifest(splicing_config, manifests, cargo_config_path, pac
def _no_at_label(label):
"""Strips leading '@'s for stringified labels in the main repository for backwards-compatibility reasons."""
s = str(label)
if s.startswith("@@//"):
if s.startswith(
# buildifier: disable=canonical-repository
"@@//",
):
return s[2:]
if s.startswith("@//"):
return s[1:]
Expand Down
4 changes: 4 additions & 0 deletions examples/crate_universe/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -663,15 +663,19 @@ inject_repo(complicated_dependencies, "boringssl")

complicated_dependencies.annotation(
build_script_data = [
# buildifier: disable=canonical-repository
"@@//complicated_dependencies:boringssl_gen_dir",
],
build_script_env = {
# Ideally this would use an execpath macro, but we need to point at a directory and that's fiddly. We could probably
# copy the director somewhere and point at that... For now, this works.
# buildifier: disable=canonical-repository
"BORING_BSSL_INCLUDE_PATH": "$(execpath @@//complicated_dependencies:boringssl_gen_dir)/include",
# buildifier: disable=canonical-repository
"BORING_BSSL_PATH": "$(execpath @@//complicated_dependencies:boringssl_gen_dir)",
},
compile_data = [
# buildifier: disable=canonical-repository
"@@//complicated_dependencies:boringssl_gen_dir",
],
crate = "boring-sys",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading