From 082457f646ca24090c9c5f9a24cfa8264fe7eab6 Mon Sep 17 00:00:00 2001 From: Paul Johnston Date: Sat, 11 Oct 2025 08:49:59 -0600 Subject: [PATCH 1/2] Rename repo, add bcr boilerplate --- .bcr/metadata.template.json | 4 +-- .github/workflows/ci.bazelrc | 9 ++++--- .github/workflows/ci.yaml | 4 +++ .github/workflows/release.yaml | 5 ++-- .github/workflows/release_prep.sh | 4 +-- BUILD.bazel | 2 +- MODULE.bazel | 2 +- README.md | 12 ++++----- WORKSPACE | 0 build/stack/bazel/aquery/differ/BUILD.bazel | 4 +-- build/stack/bazel/aquery/differ/action.pb.go | 2 +- build/stack/bazel/aquery/differ/action.proto | 2 +- cmd/aquerydiff/BUILD.bazel | 2 +- cmd/aquerydiff/main.go | 6 ++--- examples/simple/after.textproto | 26 ++++++++++---------- examples/simple/before.textproto | 26 ++++++++++---------- go.mod | 2 +- pkg/action/BUILD.bazel | 2 +- pkg/action/action.go | 8 +++--- pkg/action/graph.go | 8 +++--- pkg/action/output_map.go | 2 +- pkg/action/output_pair.go | 4 +-- pkg/action/output_pair_test.go | 2 +- pkg/artifact/BUILD.bazel | 2 +- pkg/artifact/path_map.go | 2 +- pkg/depset/BUILD.bazel | 2 +- pkg/depset/resolver.go | 7 +++--- pkg/depset/resolver_test.go | 2 +- pkg/generationtest/generation_test.go | 2 +- pkg/pathfragment/BUILD.bazel | 2 +- pkg/protobuf/BUILD.bazel | 2 +- pkg/report/BUILD.bazel | 2 +- pkg/report/html.go | 6 ++--- pkg/target/BUILD.bazel | 2 +- pkg/testtools/BUILD.bazel | 2 +- 35 files changed, 88 insertions(+), 83 deletions(-) create mode 100644 WORKSPACE diff --git a/.bcr/metadata.template.json b/.bcr/metadata.template.json index d3b8465..daeb8ae 100644 --- a/.bcr/metadata.template.json +++ b/.bcr/metadata.template.json @@ -1,5 +1,5 @@ { - "homepage": "https://github.com/stackb/bazel-aquery-differ", + "homepage": "https://github.com/stackb/bazel_difftools", "maintainers": [ { "name": "Paul Cody", @@ -8,7 +8,7 @@ } ], "repository": [ - "github:stackb/bazel-aquery-differ" + "github:stackb/bazel_difftools" ], "versions": [], "yanked_versions": {} diff --git a/.github/workflows/ci.bazelrc b/.github/workflows/ci.bazelrc index a535f31..5f63ad5 100644 --- a/.github/workflows/ci.bazelrc +++ b/.github/workflows/ci.bazelrc @@ -5,6 +5,9 @@ build --announce_rc # though it makes the log noisier. test --test_output=errors -# Use remote cache instance -build:cas --remote_instance_name=main -build:cas --remote_cache=grpc://cas.stack.build:50051 +# This directory is configured in GitHub actions to be persisted between runs. +build --disk_cache=$HOME/.cache/bazel +build --repository_cache=$HOME/.cache/bazel-repo + +# Allows tests to run bazelisk-in-bazel, since this is the cache folder used +test --test_env=XDG_CACHE_HOME diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6decbb2..94879cb 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -21,6 +21,10 @@ jobs: with: # Avoid downloading Bazel every time. bazelisk-cache: true + # Store build cache per workflow. + disk-cache: true + # Share repository cache between workflows. + repository-cache: true - name: bazel build run: >- bazelisk diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 4659125..c2131b9 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -24,10 +24,9 @@ jobs: # uses: ./.github/workflows/release_ruleset.yaml # copied-from: bazel-contrib/.github/.github/workflows/release_ruleset.yaml@v7.2.3 with: prerelease: false - release_files: rules_proto-*.tar.gz + release_files: bazel_difftools-*.tar.gz tag_name: ${{ inputs.tag_name || github.ref_name }} - secrets: - inherit + secrets: inherit publish: needs: release uses: ./.github/workflows/publish.yaml diff --git a/.github/workflows/release_prep.sh b/.github/workflows/release_prep.sh index 6aeb317..8235d21 100755 --- a/.github/workflows/release_prep.sh +++ b/.github/workflows/release_prep.sh @@ -9,7 +9,7 @@ readonly TAG=$1 # The prefix is chosen to match what GitHub generates for source archives. # This guarantees that users can easily switch from a released artifact to a source archive # with minimal differences in their code (e.g. strip_prefix remains the same) -readonly PREFIX="bazel-aquery-differ-${TAG}" +readonly PREFIX="bazel_difftools-${TAG}" readonly ARCHIVE="${PREFIX}.tar.gz" # NB: configuration for 'git archive' is in /.gitattributes @@ -23,6 +23,6 @@ cat << EOF Add to your \`MODULE.bazel\` file: \`\`\`starlark -bazel_dep(name = "bazel-aquery-differ", version = "${TAG}") +bazel_dep(name = "bazel_difftools", version = "${TAG}") \`\`\` EOF diff --git a/BUILD.bazel b/BUILD.bazel index f3c9619..dcf7056 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -10,7 +10,7 @@ load("@gazelle//:def.bzl", "gazelle_binary") # gazelle:resolve go go github.com/stackb/rules_proto/pkg/protoc @build_stack_rules_proto//pkg/protoc # -- Gazelle language "go" --- -# gazelle:prefix github.com/stackb/bazel-aquery-differ +# gazelle:prefix github.com/stackb/bazel_difftools # gazelle:go_generate_proto false # -- Gazelle language "protobuf" --- diff --git a/MODULE.bazel b/MODULE.bazel index f9f0a44..432da67 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -1,5 +1,5 @@ module( - name = "bazel-aquery-differ", + name = "bazel_difftools", version = "0.0.0", ) diff --git a/README.md b/README.md index 2d050fe..e99a1ad 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -[![CI](https://github.com/stackb/bazel-aquery-differ/actions/workflows/ci.yaml/badge.svg)](https://github.com/stackb/bazel-aquery-differ/actions/workflows/ci.yaml) +[![CI](https://github.com/stackb/bazel_difftools/actions/workflows/ci.yaml/badge.svg)](https://github.com/stackb/bazel_difftools/actions/workflows/ci.yaml) -# bazel-aquery-differ +# bazel_difftools A tool to compare Bazel action query outputs with an interactive HTML report. This is a re-imagination of the [Bazel @@ -22,7 +22,7 @@ in Go with enhanced visualization features. Add to your `MODULE.bazel`: ```starlark -bazel_dep(name = "bazel-aquery-differ", version = "0.0.0") +bazel_dep(name = "bazel_difftools", version = "0.0.0") ``` > **Note**: This module is not yet published to the Bazel Central Registry. For @@ -33,8 +33,8 @@ bazel_dep(name = "bazel-aquery-differ", version = "0.0.0") Download a release artifact, or build from source: ```bash -git clone https://github.com/stackb/bazel-aquery-differ.git -cd bazel-aquery-differ +git clone https://github.com/stackb/bazel_difftools.git +cd bazel_difftools bazel build //cmd/aquerydiff ``` @@ -45,7 +45,7 @@ bazel build //cmd/aquerydiff Load the rules in your `BUILD.bazel` file: ```starlark -load("@bazel-aquery-differ//rules:defs.bzl", "aquery_diff", "aquery_git_diff") +load("@bazel_difftools//rules:defs.bzl", "aquery_diff", "aquery_git_diff") ``` #### Rule: `aquery_diff` diff --git a/WORKSPACE b/WORKSPACE new file mode 100644 index 0000000..e69de29 diff --git a/build/stack/bazel/aquery/differ/BUILD.bazel b/build/stack/bazel/aquery/differ/BUILD.bazel index e2fbda7..2c43e4c 100644 --- a/build/stack/bazel/aquery/differ/BUILD.bazel +++ b/build/stack/bazel/aquery/differ/BUILD.bazel @@ -19,7 +19,7 @@ proto_compiled_sources( "Msrc/main/protobuf/build.proto=github.com/bazelbuild/bazelapis/src/main/protobuf/build", "Msrc/main/protobuf/stardoc_output.proto=github.com/bazelbuild/bazel/src/main/protobuf/stardoc_output", ]}, - output_mappings = ["action.pb.go=github.com/stackb/bazel-aquery-differ/build/stack/bazel/aquery/differ/action.pb.go"], + output_mappings = ["action.pb.go=github.com/stackb/bazel_difftools/build/stack/bazel/aquery/differ/action.pb.go"], plugins = ["@build_stack_rules_proto//plugin/golang/protobuf:protoc-gen-go"], proto = "differ_proto", visibility = ["//visibility:public"], @@ -28,7 +28,7 @@ proto_compiled_sources( go_library( name = "differ", srcs = ["action.pb.go"], - importpath = "github.com/stackb/bazel-aquery-differ/build/stack/bazel/aquery/differ", + importpath = "github.com/stackb/bazel_difftools/build/stack/bazel/aquery/differ", visibility = ["//visibility:public"], deps = [ "@bazelapis//src/main/protobuf:analysis_v2_go_proto", diff --git a/build/stack/bazel/aquery/differ/action.pb.go b/build/stack/bazel/aquery/differ/action.pb.go index 25aa0a4..028cd6a 100644 --- a/build/stack/bazel/aquery/differ/action.pb.go +++ b/build/stack/bazel/aquery/differ/action.pb.go @@ -219,7 +219,7 @@ const file_build_stack_bazel_aquery_differ_action_proto_rawDesc = "" + "\x12execution_platform\x18\x10 \x01(\tR\x11executionPlatform\x12)\n" + "\x10template_content\x18\x11 \x01(\tR\x0ftemplateContent\x12<\n" + "\rsubstitutions\x18\x12 \x03(\v2\x16.analysis.KeyValuePairR\rsubstitutions\x12#\n" + - "\rfile_contents\x18\x13 \x01(\tR\ffileContentsBGZEgithub.com/stackb/bazel-aquery-differ/build/stack/bazel/aquery/differb\x06proto3" + "\rfile_contents\x18\x13 \x01(\tR\ffileContentsBCZAgithub.com/stackb/bazel_difftools/build/stack/bazel/aquery/differb\x06proto3" var ( file_build_stack_bazel_aquery_differ_action_proto_rawDescOnce sync.Once diff --git a/build/stack/bazel/aquery/differ/action.proto b/build/stack/bazel/aquery/differ/action.proto index 805969b..b413be1 100644 --- a/build/stack/bazel/aquery/differ/action.proto +++ b/build/stack/bazel/aquery/differ/action.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package build.stack.bazel.aquery.differ; -option go_package = "github.com/stackb/bazel-aquery-differ/build/stack/bazel/aquery/differ"; +option go_package = "github.com/stackb/bazel_difftools/build/stack/bazel/aquery/differ"; import "src/main/protobuf/analysis_v2.proto"; diff --git a/cmd/aquerydiff/BUILD.bazel b/cmd/aquerydiff/BUILD.bazel index d7422ce..5a2bbc5 100644 --- a/cmd/aquerydiff/BUILD.bazel +++ b/cmd/aquerydiff/BUILD.bazel @@ -8,7 +8,7 @@ go_library( "config.go", "main.go", ], - importpath = "github.com/stackb/bazel-aquery-differ/cmd/aquerydiff", + importpath = "github.com/stackb/bazel_difftools/cmd/aquerydiff", visibility = ["//visibility:private"], deps = [ "//pkg/action", diff --git a/cmd/aquerydiff/main.go b/cmd/aquerydiff/main.go index a274aaf..3b68491 100644 --- a/cmd/aquerydiff/main.go +++ b/cmd/aquerydiff/main.go @@ -10,9 +10,9 @@ import ( "runtime" anpb "github.com/bazelbuild/bazelapis/src/main/protobuf/analysis_v2" - "github.com/stackb/bazel-aquery-differ/pkg/action" - "github.com/stackb/bazel-aquery-differ/pkg/protobuf" - "github.com/stackb/bazel-aquery-differ/pkg/report" + "github.com/stackb/bazel_difftools/pkg/action" + "github.com/stackb/bazel_difftools/pkg/protobuf" + "github.com/stackb/bazel_difftools/pkg/report" ) func main() { diff --git a/examples/simple/after.textproto b/examples/simple/after.textproto index 7049b8d..e67c0dd 100644 --- a/examples/simple/after.textproto +++ b/examples/simple/after.textproto @@ -572,15 +572,15 @@ arguments: "cmd/aquerydiff/config.go" arguments: "-src" arguments: "cmd/aquerydiff/main.go" arguments: "-arc" -arguments: "github.com/stackb/bazel-aquery-differ/pkg/action=github.com/stackb/bazel-aquery-differ/pkg/action=bazel-out/darwin_arm64-fastbuild-ST-28c832439b7e/bin/pkg/action/action.x" +arguments: "github.com/stackb/bazel_difftools/pkg/action=github.com/stackb/bazel_difftools/pkg/action=bazel-out/darwin_arm64-fastbuild-ST-28c832439b7e/bin/pkg/action/action.x" arguments: "-arc" -arguments: "github.com/stackb/bazel-aquery-differ/pkg/protobuf=github.com/stackb/bazel-aquery-differ/pkg/protobuf=bazel-out/darwin_arm64-fastbuild-ST-28c832439b7e/bin/pkg/protobuf/protobuf.x" +arguments: "github.com/stackb/bazel_difftools/pkg/protobuf=github.com/stackb/bazel_difftools/pkg/protobuf=bazel-out/darwin_arm64-fastbuild-ST-28c832439b7e/bin/pkg/protobuf/protobuf.x" arguments: "-arc" -arguments: "github.com/stackb/bazel-aquery-differ/pkg/report=github.com/stackb/bazel-aquery-differ/pkg/report=bazel-out/darwin_arm64-fastbuild-ST-28c832439b7e/bin/pkg/report/report.x" +arguments: "github.com/stackb/bazel_difftools/pkg/report=github.com/stackb/bazel_difftools/pkg/report=bazel-out/darwin_arm64-fastbuild-ST-28c832439b7e/bin/pkg/report/report.x" arguments: "-arc" arguments: "github.com/bazelbuild/bazelapis/src/main/protobuf/analysis_v2=github.com/bazelbuild/bazelapis/src/main/protobuf/analysis_v2=bazel-out/darwin_arm64-fastbuild-ST-28c832439b7e/bin/external/build_stack_rules_proto++proto_repository+bazelapis/src/main/protobuf/analysis_v2_go_proto.x" arguments: "-importpath" -arguments: "github.com/stackb/bazel-aquery-differ/cmd/aquerydiff" +arguments: "github.com/stackb/bazel_difftools/cmd/aquerydiff" arguments: "-p" arguments: "main" arguments: "-package_list" @@ -1527,17 +1527,17 @@ arguments: "@@build_stack_rules_proto++proto_repository+bazelapis//src/main/prot arguments: "-arc" arguments: "@@build_stack_rules_proto++proto_repository+bazelapis//src/main/protobuf:analysis_v2_go_proto=github.com/bazelbuild/bazelapis/src/main/protobuf/analysis_v2=bazel-out/darwin_arm64-fastbuild-ST-28c832439b7e/bin/external/build_stack_rules_proto++proto_repository+bazelapis/src/main/protobuf/analysis_v2_go_proto.a" arguments: "-arc" -arguments: "@@//build/stack/bazel/aquery/differ:differ=github.com/stackb/bazel-aquery-differ/build/stack/bazel/aquery/differ=bazel-out/darwin_arm64-fastbuild-ST-28c832439b7e/bin/build/stack/bazel/aquery/differ/differ.a" +arguments: "@@//build/stack/bazel/aquery/differ:differ=github.com/stackb/bazel_difftools/build/stack/bazel/aquery/differ=bazel-out/darwin_arm64-fastbuild-ST-28c832439b7e/bin/build/stack/bazel/aquery/differ/differ.a" arguments: "-arc" -arguments: "@@//pkg/pathfragment:pathfragment=github.com/stackb/bazel-aquery-differ/pkg/pathfragment=bazel-out/darwin_arm64-fastbuild-ST-28c832439b7e/bin/pkg/pathfragment/pathfragment.a" +arguments: "@@//pkg/pathfragment:pathfragment=github.com/stackb/bazel_difftools/pkg/pathfragment=bazel-out/darwin_arm64-fastbuild-ST-28c832439b7e/bin/pkg/pathfragment/pathfragment.a" arguments: "-arc" -arguments: "@@//pkg/artifact:artifact=github.com/stackb/bazel-aquery-differ/pkg/artifact=bazel-out/darwin_arm64-fastbuild-ST-28c832439b7e/bin/pkg/artifact/artifact.a" +arguments: "@@//pkg/artifact:artifact=github.com/stackb/bazel_difftools/pkg/artifact=bazel-out/darwin_arm64-fastbuild-ST-28c832439b7e/bin/pkg/artifact/artifact.a" arguments: "-arc" -arguments: "@@//pkg/depset:depset=github.com/stackb/bazel-aquery-differ/pkg/depset=bazel-out/darwin_arm64-fastbuild-ST-28c832439b7e/bin/pkg/depset/depset.a" +arguments: "@@//pkg/depset:depset=github.com/stackb/bazel_difftools/pkg/depset=bazel-out/darwin_arm64-fastbuild-ST-28c832439b7e/bin/pkg/depset/depset.a" arguments: "-arc" -arguments: "@@//pkg/protobuf:protobuf=github.com/stackb/bazel-aquery-differ/pkg/protobuf=bazel-out/darwin_arm64-fastbuild-ST-28c832439b7e/bin/pkg/protobuf/protobuf.a" +arguments: "@@//pkg/protobuf:protobuf=github.com/stackb/bazel_difftools/pkg/protobuf=bazel-out/darwin_arm64-fastbuild-ST-28c832439b7e/bin/pkg/protobuf/protobuf.a" arguments: "-arc" -arguments: "@@//pkg/target:target=github.com/stackb/bazel-aquery-differ/pkg/target=bazel-out/darwin_arm64-fastbuild-ST-28c832439b7e/bin/pkg/target/target.a" +arguments: "@@//pkg/target:target=github.com/stackb/bazel_difftools/pkg/target=bazel-out/darwin_arm64-fastbuild-ST-28c832439b7e/bin/pkg/target/target.a" arguments: "-arc" arguments: "@@gazelle++go_deps+com_github_google_go_cmp//cmp/internal/flags:flags=github.com/google/go-cmp/cmp/internal/flags=bazel-out/darwin_arm64-fastbuild-ST-28c832439b7e/bin/external/gazelle++go_deps+com_github_google_go_cmp/cmp/internal/flags/flags.a" arguments: "-arc" @@ -1557,9 +1557,9 @@ arguments: "@@gazelle++go_deps+com_github_hexops_gotextdiff//:gotextdiff=github. arguments: "-arc" arguments: "@@gazelle++go_deps+com_github_hexops_gotextdiff//myers:myers=github.com/hexops/gotextdiff/myers=bazel-out/darwin_arm64-fastbuild-ST-28c832439b7e/bin/external/gazelle++go_deps+com_github_hexops_gotextdiff/myers/myers.a" arguments: "-arc" -arguments: "@@//pkg/action:action=github.com/stackb/bazel-aquery-differ/pkg/action=bazel-out/darwin_arm64-fastbuild-ST-28c832439b7e/bin/pkg/action/action.a" +arguments: "@@//pkg/action:action=github.com/stackb/bazel_difftools/pkg/action=bazel-out/darwin_arm64-fastbuild-ST-28c832439b7e/bin/pkg/action/action.a" arguments: "-arc" -arguments: "@@//pkg/report:report=github.com/stackb/bazel-aquery-differ/pkg/report=bazel-out/darwin_arm64-fastbuild-ST-28c832439b7e/bin/pkg/report/report.a" +arguments: "@@//pkg/report:report=github.com/stackb/bazel_difftools/pkg/report=bazel-out/darwin_arm64-fastbuild-ST-28c832439b7e/bin/pkg/report/report.a" arguments: "-package_list" arguments: "bazel-out/darwin_arm64-opt-exec-ST-d6cc8b84a7bb/bin/external/rules_go++go_sdk+main___download_0/packages.txt" arguments: "-o" @@ -1567,7 +1567,7 @@ arguments: "bazel-out/darwin_arm64-fastbuild-ST-28c832439b7e/bin/cmd/aquerydiff/ arguments: "-main" arguments: "bazel-out/darwin_arm64-fastbuild-ST-28c832439b7e/bin/cmd/aquerydiff/aquerydiff_linux_amd64.a" arguments: "-p" -arguments: "github.com/stackb/bazel-aquery-differ/cmd/aquerydiff" +arguments: "github.com/stackb/bazel_difftools/cmd/aquerydiff" arguments: "--" arguments: "-linkmode" arguments: "internal" diff --git a/examples/simple/before.textproto b/examples/simple/before.textproto index 26f0ea5..17ed870 100644 --- a/examples/simple/before.textproto +++ b/examples/simple/before.textproto @@ -572,15 +572,15 @@ arguments: "cmd/aquerydiff/config.go" arguments: "-src" arguments: "cmd/aquerydiff/main.go" arguments: "-arc" -arguments: "github.com/stackb/bazel-aquery-differ/pkg/action=github.com/stackb/bazel-aquery-differ/pkg/action=bazel-out/darwin_arm64-fastbuild-ST-429f90df6b5d/bin/pkg/action/action.x" +arguments: "github.com/stackb/bazel_difftools/pkg/action=github.com/stackb/bazel_difftools/pkg/action=bazel-out/darwin_arm64-fastbuild-ST-429f90df6b5d/bin/pkg/action/action.x" arguments: "-arc" -arguments: "github.com/stackb/bazel-aquery-differ/pkg/protobuf=github.com/stackb/bazel-aquery-differ/pkg/protobuf=bazel-out/darwin_arm64-fastbuild-ST-429f90df6b5d/bin/pkg/protobuf/protobuf.x" +arguments: "github.com/stackb/bazel_difftools/pkg/protobuf=github.com/stackb/bazel_difftools/pkg/protobuf=bazel-out/darwin_arm64-fastbuild-ST-429f90df6b5d/bin/pkg/protobuf/protobuf.x" arguments: "-arc" -arguments: "github.com/stackb/bazel-aquery-differ/pkg/report=github.com/stackb/bazel-aquery-differ/pkg/report=bazel-out/darwin_arm64-fastbuild-ST-429f90df6b5d/bin/pkg/report/report.x" +arguments: "github.com/stackb/bazel_difftools/pkg/report=github.com/stackb/bazel_difftools/pkg/report=bazel-out/darwin_arm64-fastbuild-ST-429f90df6b5d/bin/pkg/report/report.x" arguments: "-arc" arguments: "github.com/bazelbuild/bazelapis/src/main/protobuf/analysis_v2=github.com/bazelbuild/bazelapis/src/main/protobuf/analysis_v2=bazel-out/darwin_arm64-fastbuild-ST-429f90df6b5d/bin/external/build_stack_rules_proto++proto_repository+bazelapis/src/main/protobuf/analysis_v2_go_proto.x" arguments: "-importpath" -arguments: "github.com/stackb/bazel-aquery-differ/cmd/aquerydiff" +arguments: "github.com/stackb/bazel_difftools/cmd/aquerydiff" arguments: "-p" arguments: "main" arguments: "-package_list" @@ -1626,17 +1626,17 @@ arguments: "@@build_stack_rules_proto++proto_repository+bazelapis//src/main/prot arguments: "-arc" arguments: "@@build_stack_rules_proto++proto_repository+bazelapis//src/main/protobuf:analysis_v2_go_proto=github.com/bazelbuild/bazelapis/src/main/protobuf/analysis_v2=bazel-out/darwin_arm64-fastbuild-ST-429f90df6b5d/bin/external/build_stack_rules_proto++proto_repository+bazelapis/src/main/protobuf/analysis_v2_go_proto.a" arguments: "-arc" -arguments: "@@//build/stack/bazel/aquery/differ:differ=github.com/stackb/bazel-aquery-differ/build/stack/bazel/aquery/differ=bazel-out/darwin_arm64-fastbuild-ST-429f90df6b5d/bin/build/stack/bazel/aquery/differ/differ.a" +arguments: "@@//build/stack/bazel/aquery/differ:differ=github.com/stackb/bazel_difftools/build/stack/bazel/aquery/differ=bazel-out/darwin_arm64-fastbuild-ST-429f90df6b5d/bin/build/stack/bazel/aquery/differ/differ.a" arguments: "-arc" -arguments: "@@//pkg/pathfragment:pathfragment=github.com/stackb/bazel-aquery-differ/pkg/pathfragment=bazel-out/darwin_arm64-fastbuild-ST-429f90df6b5d/bin/pkg/pathfragment/pathfragment.a" +arguments: "@@//pkg/pathfragment:pathfragment=github.com/stackb/bazel_difftools/pkg/pathfragment=bazel-out/darwin_arm64-fastbuild-ST-429f90df6b5d/bin/pkg/pathfragment/pathfragment.a" arguments: "-arc" -arguments: "@@//pkg/artifact:artifact=github.com/stackb/bazel-aquery-differ/pkg/artifact=bazel-out/darwin_arm64-fastbuild-ST-429f90df6b5d/bin/pkg/artifact/artifact.a" +arguments: "@@//pkg/artifact:artifact=github.com/stackb/bazel_difftools/pkg/artifact=bazel-out/darwin_arm64-fastbuild-ST-429f90df6b5d/bin/pkg/artifact/artifact.a" arguments: "-arc" -arguments: "@@//pkg/depset:depset=github.com/stackb/bazel-aquery-differ/pkg/depset=bazel-out/darwin_arm64-fastbuild-ST-429f90df6b5d/bin/pkg/depset/depset.a" +arguments: "@@//pkg/depset:depset=github.com/stackb/bazel_difftools/pkg/depset=bazel-out/darwin_arm64-fastbuild-ST-429f90df6b5d/bin/pkg/depset/depset.a" arguments: "-arc" -arguments: "@@//pkg/protobuf:protobuf=github.com/stackb/bazel-aquery-differ/pkg/protobuf=bazel-out/darwin_arm64-fastbuild-ST-429f90df6b5d/bin/pkg/protobuf/protobuf.a" +arguments: "@@//pkg/protobuf:protobuf=github.com/stackb/bazel_difftools/pkg/protobuf=bazel-out/darwin_arm64-fastbuild-ST-429f90df6b5d/bin/pkg/protobuf/protobuf.a" arguments: "-arc" -arguments: "@@//pkg/target:target=github.com/stackb/bazel-aquery-differ/pkg/target=bazel-out/darwin_arm64-fastbuild-ST-429f90df6b5d/bin/pkg/target/target.a" +arguments: "@@//pkg/target:target=github.com/stackb/bazel_difftools/pkg/target=bazel-out/darwin_arm64-fastbuild-ST-429f90df6b5d/bin/pkg/target/target.a" arguments: "-arc" arguments: "@@gazelle++go_deps+com_github_google_go_cmp//cmp/internal/flags:flags=github.com/google/go-cmp/cmp/internal/flags=bazel-out/darwin_arm64-fastbuild-ST-429f90df6b5d/bin/external/gazelle++go_deps+com_github_google_go_cmp/cmp/internal/flags/flags.a" arguments: "-arc" @@ -1656,9 +1656,9 @@ arguments: "@@gazelle++go_deps+com_github_hexops_gotextdiff//:gotextdiff=github. arguments: "-arc" arguments: "@@gazelle++go_deps+com_github_hexops_gotextdiff//myers:myers=github.com/hexops/gotextdiff/myers=bazel-out/darwin_arm64-fastbuild-ST-429f90df6b5d/bin/external/gazelle++go_deps+com_github_hexops_gotextdiff/myers/myers.a" arguments: "-arc" -arguments: "@@//pkg/action:action=github.com/stackb/bazel-aquery-differ/pkg/action=bazel-out/darwin_arm64-fastbuild-ST-429f90df6b5d/bin/pkg/action/action.a" +arguments: "@@//pkg/action:action=github.com/stackb/bazel_difftools/pkg/action=bazel-out/darwin_arm64-fastbuild-ST-429f90df6b5d/bin/pkg/action/action.a" arguments: "-arc" -arguments: "@@//pkg/report:report=github.com/stackb/bazel-aquery-differ/pkg/report=bazel-out/darwin_arm64-fastbuild-ST-429f90df6b5d/bin/pkg/report/report.a" +arguments: "@@//pkg/report:report=github.com/stackb/bazel_difftools/pkg/report=bazel-out/darwin_arm64-fastbuild-ST-429f90df6b5d/bin/pkg/report/report.a" arguments: "-package_list" arguments: "bazel-out/darwin_arm64-opt-exec-ST-d6cc8b84a7bb/bin/external/rules_go++go_sdk+main___download_0/packages.txt" arguments: "-o" @@ -1666,7 +1666,7 @@ arguments: "bazel-out/darwin_arm64-fastbuild-ST-429f90df6b5d/bin/cmd/aquerydiff/ arguments: "-main" arguments: "bazel-out/darwin_arm64-fastbuild-ST-429f90df6b5d/bin/cmd/aquerydiff/aquerydiff_darwin_amd64.a" arguments: "-p" -arguments: "github.com/stackb/bazel-aquery-differ/cmd/aquerydiff" +arguments: "github.com/stackb/bazel_difftools/cmd/aquerydiff" arguments: "--" arguments: "-linkmode" arguments: "internal" diff --git a/go.mod b/go.mod index b1f4f7a..0042165 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/stackb/bazel-aquery-differ +module github.com/stackb/bazel_difftools go 1.23.1 diff --git a/pkg/action/BUILD.bazel b/pkg/action/BUILD.bazel index 8ce8b31..b281243 100644 --- a/pkg/action/BUILD.bazel +++ b/pkg/action/BUILD.bazel @@ -8,7 +8,7 @@ go_library( "output_map.go", "output_pair.go", ], - importpath = "github.com/stackb/bazel-aquery-differ/pkg/action", + importpath = "github.com/stackb/bazel_difftools/pkg/action", visibility = ["//visibility:public"], deps = [ "//build/stack/bazel/aquery/differ", diff --git a/pkg/action/action.go b/pkg/action/action.go index 404366e..f0edf8e 100644 --- a/pkg/action/action.go +++ b/pkg/action/action.go @@ -6,10 +6,10 @@ import ( "strings" anpb "github.com/bazelbuild/bazelapis/src/main/protobuf/analysis_v2" - dipb "github.com/stackb/bazel-aquery-differ/build/stack/bazel/aquery/differ" - "github.com/stackb/bazel-aquery-differ/pkg/artifact" - "github.com/stackb/bazel-aquery-differ/pkg/depset" - "github.com/stackb/bazel-aquery-differ/pkg/target" + dipb "github.com/stackb/bazel_difftools/build/stack/bazel/aquery/differ" + "github.com/stackb/bazel_difftools/pkg/artifact" + "github.com/stackb/bazel_difftools/pkg/depset" + "github.com/stackb/bazel_difftools/pkg/target" ) func NewAction(id string, in *anpb.Action, artifacts artifact.PathMap, targets target.Map, deps depset.Resolver) (*dipb.Action, error) { diff --git a/pkg/action/graph.go b/pkg/action/graph.go index fd7d2ad..56ebd91 100644 --- a/pkg/action/graph.go +++ b/pkg/action/graph.go @@ -5,10 +5,10 @@ import ( "sort" anpb "github.com/bazelbuild/bazelapis/src/main/protobuf/analysis_v2" - dipb "github.com/stackb/bazel-aquery-differ/build/stack/bazel/aquery/differ" - "github.com/stackb/bazel-aquery-differ/pkg/artifact" - "github.com/stackb/bazel-aquery-differ/pkg/depset" - "github.com/stackb/bazel-aquery-differ/pkg/target" + dipb "github.com/stackb/bazel_difftools/build/stack/bazel/aquery/differ" + "github.com/stackb/bazel_difftools/pkg/artifact" + "github.com/stackb/bazel_difftools/pkg/depset" + "github.com/stackb/bazel_difftools/pkg/target" ) // Graph holds compiled data about the action graph container. diff --git a/pkg/action/output_map.go b/pkg/action/output_map.go index 6e8544e..22a90b4 100644 --- a/pkg/action/output_map.go +++ b/pkg/action/output_map.go @@ -1,7 +1,7 @@ package action import ( - dipb "github.com/stackb/bazel-aquery-differ/build/stack/bazel/aquery/differ" + dipb "github.com/stackb/bazel_difftools/build/stack/bazel/aquery/differ" ) // ActionMap is a map of string -> action. diff --git a/pkg/action/output_pair.go b/pkg/action/output_pair.go index ca93945..c41a410 100644 --- a/pkg/action/output_pair.go +++ b/pkg/action/output_pair.go @@ -9,8 +9,8 @@ import ( "google.golang.org/protobuf/proto" anpb "github.com/bazelbuild/bazelapis/src/main/protobuf/analysis_v2" - dipb "github.com/stackb/bazel-aquery-differ/build/stack/bazel/aquery/differ" - "github.com/stackb/bazel-aquery-differ/pkg/protobuf" + dipb "github.com/stackb/bazel_difftools/build/stack/bazel/aquery/differ" + "github.com/stackb/bazel_difftools/pkg/protobuf" ) type OutputPair struct { diff --git a/pkg/action/output_pair_test.go b/pkg/action/output_pair_test.go index 120f845..fade2f1 100644 --- a/pkg/action/output_pair_test.go +++ b/pkg/action/output_pair_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - dipb "github.com/stackb/bazel-aquery-differ/build/stack/bazel/aquery/differ" + dipb "github.com/stackb/bazel_difftools/build/stack/bazel/aquery/differ" ) // SkipTestOutputPairUnifiedDiff is diabled as the whitespace between mac and diff --git a/pkg/artifact/BUILD.bazel b/pkg/artifact/BUILD.bazel index 460ac7d..3c2b681 100644 --- a/pkg/artifact/BUILD.bazel +++ b/pkg/artifact/BUILD.bazel @@ -3,7 +3,7 @@ load("@rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "artifact", srcs = ["path_map.go"], - importpath = "github.com/stackb/bazel-aquery-differ/pkg/artifact", + importpath = "github.com/stackb/bazel_difftools/pkg/artifact", visibility = ["//visibility:public"], deps = [ "//pkg/pathfragment", diff --git a/pkg/artifact/path_map.go b/pkg/artifact/path_map.go index 148a2ef..98217c1 100644 --- a/pkg/artifact/path_map.go +++ b/pkg/artifact/path_map.go @@ -4,7 +4,7 @@ import ( "fmt" anpb "github.com/bazelbuild/bazelapis/src/main/protobuf/analysis_v2" - "github.com/stackb/bazel-aquery-differ/pkg/pathfragment" + "github.com/stackb/bazel_difftools/pkg/pathfragment" ) // PathMap maps artifact.Id to the output path of the artifact. diff --git a/pkg/depset/BUILD.bazel b/pkg/depset/BUILD.bazel index 2dfa3e9..5dc9648 100644 --- a/pkg/depset/BUILD.bazel +++ b/pkg/depset/BUILD.bazel @@ -6,7 +6,7 @@ go_library( "map.go", "resolver.go", ], - importpath = "github.com/stackb/bazel-aquery-differ/pkg/depset", + importpath = "github.com/stackb/bazel_difftools/pkg/depset", visibility = ["//visibility:public"], deps = [ "//pkg/artifact", diff --git a/pkg/depset/resolver.go b/pkg/depset/resolver.go index 87859be..c62a034 100644 --- a/pkg/depset/resolver.go +++ b/pkg/depset/resolver.go @@ -5,7 +5,7 @@ import ( "sort" anpb "github.com/bazelbuild/bazelapis/src/main/protobuf/analysis_v2" - "github.com/stackb/bazel-aquery-differ/pkg/artifact" + "github.com/stackb/bazel_difftools/pkg/artifact" ) type Resolver struct { @@ -63,13 +63,12 @@ func (r *Resolver) Resolve(in *anpb.DepSetOfFiles) ([]string, error) { } artifacts = append(artifacts, files...) } - + r.depSetArtifacts[in.Id] = deduplicateAndSort(artifacts) return artifacts, nil } - // deduplicateAndSort removes duplicate entries and sorts the list func deduplicateAndSort(in []string) (out []string) { if len(in) == 0 { @@ -85,4 +84,4 @@ func deduplicateAndSort(in []string) (out []string) { } sort.Strings(out) return -} \ No newline at end of file +} diff --git a/pkg/depset/resolver_test.go b/pkg/depset/resolver_test.go index 4038490..7c28f7b 100644 --- a/pkg/depset/resolver_test.go +++ b/pkg/depset/resolver_test.go @@ -5,7 +5,7 @@ import ( anpb "github.com/bazelbuild/bazelapis/src/main/protobuf/analysis_v2" "github.com/google/go-cmp/cmp" - "github.com/stackb/bazel-aquery-differ/pkg/artifact" + "github.com/stackb/bazel_difftools/pkg/artifact" ) func TestPathMap(t *testing.T) { diff --git a/pkg/generationtest/generation_test.go b/pkg/generationtest/generation_test.go index c69372c..4ccb423 100644 --- a/pkg/generationtest/generation_test.go +++ b/pkg/generationtest/generation_test.go @@ -7,7 +7,7 @@ import ( "time" "github.com/bazelbuild/rules_go/go/tools/bazel" - "github.com/stackb/bazel-aquery-differ/pkg/testtools" + "github.com/stackb/bazel_difftools/pkg/testtools" ) var ( diff --git a/pkg/pathfragment/BUILD.bazel b/pkg/pathfragment/BUILD.bazel index 287b4a4..3a609c4 100644 --- a/pkg/pathfragment/BUILD.bazel +++ b/pkg/pathfragment/BUILD.bazel @@ -3,7 +3,7 @@ load("@rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "pathfragment", srcs = ["resolver.go"], - importpath = "github.com/stackb/bazel-aquery-differ/pkg/pathfragment", + importpath = "github.com/stackb/bazel_difftools/pkg/pathfragment", visibility = ["//visibility:public"], deps = ["@bazelapis//src/main/protobuf:analysis_v2_go_proto"], ) diff --git a/pkg/protobuf/BUILD.bazel b/pkg/protobuf/BUILD.bazel index f710eec..c35bf25 100644 --- a/pkg/protobuf/BUILD.bazel +++ b/pkg/protobuf/BUILD.bazel @@ -3,7 +3,7 @@ load("@rules_go//go:def.bzl", "go_library") go_library( name = "protobuf", srcs = ["io.go"], - importpath = "github.com/stackb/bazel-aquery-differ/pkg/protobuf", + importpath = "github.com/stackb/bazel_difftools/pkg/protobuf", visibility = ["//visibility:public"], deps = [ "@org_golang_google_protobuf//encoding/protojson:go_default_library", diff --git a/pkg/report/BUILD.bazel b/pkg/report/BUILD.bazel index 10c9ba3..967f6d6 100644 --- a/pkg/report/BUILD.bazel +++ b/pkg/report/BUILD.bazel @@ -13,7 +13,7 @@ go_library( "cmp.html.tmpl", "style.css", ], - importpath = "github.com/stackb/bazel-aquery-differ/pkg/report", + importpath = "github.com/stackb/bazel_difftools/pkg/report", visibility = ["//visibility:public"], deps = [ "//build/stack/bazel/aquery/differ", diff --git a/pkg/report/html.go b/pkg/report/html.go index ac9c8ed..a5c04a3 100644 --- a/pkg/report/html.go +++ b/pkg/report/html.go @@ -10,9 +10,9 @@ import ( "html/template" - dipb "github.com/stackb/bazel-aquery-differ/build/stack/bazel/aquery/differ" - "github.com/stackb/bazel-aquery-differ/pkg/action" - "github.com/stackb/bazel-aquery-differ/pkg/protobuf" + dipb "github.com/stackb/bazel_difftools/build/stack/bazel/aquery/differ" + "github.com/stackb/bazel_difftools/pkg/action" + "github.com/stackb/bazel_difftools/pkg/protobuf" ) type Html struct { diff --git a/pkg/target/BUILD.bazel b/pkg/target/BUILD.bazel index 0f15547..4498fc4 100644 --- a/pkg/target/BUILD.bazel +++ b/pkg/target/BUILD.bazel @@ -3,7 +3,7 @@ load("@rules_go//go:def.bzl", "go_library") go_library( name = "target", srcs = ["map.go"], - importpath = "github.com/stackb/bazel-aquery-differ/pkg/target", + importpath = "github.com/stackb/bazel_difftools/pkg/target", visibility = ["//visibility:public"], deps = ["@bazelapis//src/main/protobuf:analysis_v2_go_proto"], ) diff --git a/pkg/testtools/BUILD.bazel b/pkg/testtools/BUILD.bazel index 2a6e90a..7343b3f 100644 --- a/pkg/testtools/BUILD.bazel +++ b/pkg/testtools/BUILD.bazel @@ -3,7 +3,7 @@ load("@rules_go//go:def.bzl", "go_library") go_library( name = "testtools", srcs = ["files.go"], - importpath = "github.com/stackb/bazel-aquery-differ/pkg/testtools", + importpath = "github.com/stackb/bazel_difftools/pkg/testtools", visibility = ["//visibility:public"], deps = ["@com_github_google_go_cmp//cmp:go_default_library"], ) From e147d394c3030ad0f8c4d2bd96e3e21b419ab149 Mon Sep 17 00:00:00 2001 From: Paul Johnston Date: Sat, 11 Oct 2025 09:00:08 -0600 Subject: [PATCH 2/2] Temp disable repo cache --- .github/workflows/ci.bazelrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.bazelrc b/.github/workflows/ci.bazelrc index 5f63ad5..4f73d8e 100644 --- a/.github/workflows/ci.bazelrc +++ b/.github/workflows/ci.bazelrc @@ -8,6 +8,7 @@ test --test_output=errors # This directory is configured in GitHub actions to be persisted between runs. build --disk_cache=$HOME/.cache/bazel build --repository_cache=$HOME/.cache/bazel-repo +build --repo_contents_cache= # Allows tests to run bazelisk-in-bazel, since this is the cache folder used test --test_env=XDG_CACHE_HOME