Skip to content

Commit fb91692

Browse files
authored
Merge branch 'main' into support_bazel_5
2 parents 3ade9a9 + 5f9f8ba commit fb91692

14 files changed

+261
-126
lines changed

.pre-commit-config.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ repos:
77
- id: trailing-whitespace
88
- id: end-of-file-fixer
99
- id: check-ast
10-
exclude: ^check_python_version\.template\.py$ # Template for bazel creates syntax error
1110
- id: debug-statements
12-
exclude: ^check_python_version\.template\.py$ # Template for bazel creates syntax error
1311
- id: mixed-line-ending
1412
- id: check-case-conflict
1513
- id: fix-byte-order-marker

BUILD

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ filegroup(
1515
name = "bzl_srcs_for_stardoc",
1616
visibility = ["//visibility:public"],
1717
srcs = glob(["**/*.bzl"]) + [
18-
"@bazel_tools//:bzl_srcs"
18+
"@bazel_tools//tools:bzl_srcs",
19+
"@hedron_compile_commands_pip//:requirements.bzl",
20+
"@python_3_11//:defs.bzl",
21+
"@rules_python//:bzl",
1922
],
2023
)
2124

@@ -25,7 +28,7 @@ filegroup(
2528
# Implementation:
2629
# If you are looking into the implementation, start with the overview in ImplementationReadme.md.
2730

28-
exports_files(["refresh.template.py", "check_python_version.template.py"]) # For implicit use by the refresh_compile_commands macro, not direct use.
31+
exports_files(["refresh.template.py"]) # For implicit use by the refresh_compile_commands macro, not direct use.
2932

3033
cc_binary(
3134
name = "print_args",

MODULE.bazel

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
11
module(name = "hedron_compile_commands")
22

33
use_extension("//:workspace_setup.bzl", "hedron_compile_commands_extension")
4+
use_extension("//:workspace_setup_transitive.bzl", "hedron_compile_commands_extension")
5+
use_extension("//:workspace_setup_transitive_transitive.bzl", "hedron_compile_commands_extension")
6+
use_extension("//:workspace_setup_transitive_transitive_transitive.bzl", "hedron_compile_commands_extension")
7+
8+
# While we're supporting the WORKSPACE, we need to load rules_python through its WORKSPACE mechanism because the (currently unstable) bzlmod APIs differ just enough that loads would fail if you tried to support both at the same time.
9+
# But this is how you'd load rules_python from bzlmod:
10+
# bazel_dep(name = "rules_python", version = "0.27.1")
11+
# python = use_extension("@rules_python//python/extensions:python.bzl", "python")
12+
# python.toolchain(
13+
# python_version = "3.11",
14+
# )
15+
# use_repo(python, "python_versions")
16+
# pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
17+
# pip.parse(
18+
# hub_name = "hedron_compile_commands_pip",
19+
# # Available versions are listed in @rules_python//python:versions.bzl.
20+
# python_version = "3.11",
21+
# requirements_lock = "//:requirements.txt",
22+
# )
23+
# use_repo(pip, "hedron_compile_commands_pip")

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ bazel_dep(name = "hedron_compile_commands", dev_dependency = True)
5454
git_override(
5555
module_name = "hedron_compile_commands",
5656
remote = "https://github.com/hedronvision/bazel-compile-commands-extractor.git",
57-
commit = "daae6f40adfa5fdb7c89684cbe4d88b691c63b2d",
57+
commit = "0e5b1aa26d87a431d2a52676d0b9ce469448ee54",
5858
# Replace the commit hash (above) with the latest (https://github.com/hedronvision/bazel-compile-commands-extractor/commits/main).
5959
# Even better, set up Renovate and let it do the work for you (see "Suggestion: Updates" in the README).
6060
)
@@ -73,14 +73,20 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
7373
http_archive(
7474
name = "hedron_compile_commands",
7575

76-
# Replace the commit hash (daae6f40adfa5fdb7c89684cbe4d88b691c63b2d) in both places (below) with the latest (https://github.com/hedronvision/bazel-compile-commands-extractor/commits/main), rather than using the stale one here.
76+
# Replace the commit hash (0e5b1aa26d87a431d2a52676d0b9ce469448ee54) in both places (below) with the latest (https://github.com/hedronvision/bazel-compile-commands-extractor/commits/main), rather than using the stale one here.
7777
# Even better, set up Renovate and let it do the work for you (see "Suggestion: Updates" in the README).
78-
url = "https://github.com/hedronvision/bazel-compile-commands-extractor/archive/daae6f40adfa5fdb7c89684cbe4d88b691c63b2d.tar.gz",
79-
strip_prefix = "bazel-compile-commands-extractor-daae6f40adfa5fdb7c89684cbe4d88b691c63b2d",
78+
url = "https://github.com/hedronvision/bazel-compile-commands-extractor/archive/0e5b1aa26d87a431d2a52676d0b9ce469448ee54.tar.gz",
79+
strip_prefix = "bazel-compile-commands-extractor-0e5b1aa26d87a431d2a52676d0b9ce469448ee54",
8080
# When you first run this tool, it'll recommend a sha256 hash to put here with a message like: "DEBUG: Rule 'hedron_compile_commands' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = ..."
8181
)
8282
load("@hedron_compile_commands//:workspace_setup.bzl", "hedron_compile_commands_setup")
8383
hedron_compile_commands_setup()
84+
load("@hedron_compile_commands//:workspace_setup_transitive.bzl", "hedron_compile_commands_setup_transitive")
85+
hedron_compile_commands_setup_transitive()
86+
load("@hedron_compile_commands//:workspace_setup_transitive_transitive.bzl", "hedron_compile_commands_setup_transitive_transitive")
87+
hedron_compile_commands_setup_transitive_transitive()
88+
load("@hedron_compile_commands//:workspace_setup_transitive_transitive_transitive.bzl", "hedron_compile_commands_setup_transitive_transitive_transitive")
89+
hedron_compile_commands_setup_transitive_transitive_transitive()
8490
```
8591

8692
#### Either way: Get Updates via Renovate

WORKSPACE

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,9 @@ workspace(name = "hedron_compile_commands")
66

77
load("@hedron_compile_commands//:workspace_setup.bzl", "hedron_compile_commands_setup")
88
hedron_compile_commands_setup()
9+
load("@hedron_compile_commands//:workspace_setup_transitive.bzl", "hedron_compile_commands_setup_transitive")
10+
hedron_compile_commands_setup_transitive()
11+
load("@hedron_compile_commands//:workspace_setup_transitive_transitive.bzl", "hedron_compile_commands_setup_transitive_transitive")
12+
hedron_compile_commands_setup_transitive_transitive()
13+
load("@hedron_compile_commands//:workspace_setup_transitive_transitive_transitive.bzl", "hedron_compile_commands_setup_transitive_transitive_transitive")
14+
hedron_compile_commands_setup_transitive_transitive_transitive()

check_python_version.template.py

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)