Skip to content

Commit

Permalink
Run gazelle in update mode by default
Browse files Browse the repository at this point in the history
Summary: This should reduce spew during `bazel build` and `bazel query`

Test Plan: `bazel clean --expunge` and then `./ci/bazel_build_deps.sh`

Reviewers: zasgar, michelle, #engineering

Reviewed By: michelle, #engineering

Differential Revision: https://phab.corp.pixielabs.ai/D6791

GitOrigin-RevId: 3a03d73
  • Loading branch information
vihangm committed Nov 19, 2020
1 parent d56497f commit 1773124
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
1 change: 0 additions & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ exports_files(["LICENSE"])

gazelle(
name = "gazelle",
mode = "fix",
prefix = "pixielabs.ai/pixielabs",
)

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ gazelle-repos: go.mod

.PHONY: gazelle
gazelle: gazelle-repos
$(BAZEL) run //:gazelle
$(BAZEL) run //:gazelle -- fix

.PHONY: go-setup
go-setup: go-mod-ensure gazelle ## Run go setup to regenrate modules/build files.
Expand Down
24 changes: 12 additions & 12 deletions ci/bazel_build_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,32 +95,32 @@ fi


# Clang:opt
${bazel_query} "${buildables_kind} ${bpf_excludes}" > bazel_buildables_clang_opt 2>/dev/null
${bazel_query} "${tests_kind} ${bpf_excludes}" > bazel_tests_clang_opt 2>/dev/null
${bazel_query} "${buildables_kind} ${bpf_excludes}" > bazel_buildables_clang_opt
${bazel_query} "${tests_kind} ${bpf_excludes}" > bazel_tests_clang_opt

# Clang:dbg
${bazel_query} "kind(cc_binary, ${buildables_kind}) ${ui_excludes} ${bpf_excludes}" > bazel_buildables_clang_dbg 2>/dev/null
${bazel_query} "kind(cc_test, ${tests_kind}) ${ui_excludes} ${bpf_excludes}" > bazel_tests_clang_dbg 2>/dev/null
${bazel_query} "kind(cc_binary, ${buildables_kind}) ${ui_excludes} ${bpf_excludes}" > bazel_buildables_clang_dbg
${bazel_query} "kind(cc_test, ${tests_kind}) ${ui_excludes} ${bpf_excludes}" > bazel_tests_clang_dbg

# GCC:opt
${bazel_query} "kind(cc_binary, ${buildables_kind}) ${ui_excludes} ${bpf_excludes}" > bazel_buildables_gcc_opt 2>/dev/null
${bazel_query} "kind(cc_test, ${tests_kind}) ${ui_excludes} ${bpf_excludes}" > bazel_tests_gcc_opt 2>/dev/null
${bazel_query} "kind(cc_binary, ${buildables_kind}) ${ui_excludes} ${bpf_excludes}" > bazel_buildables_gcc_opt
${bazel_query} "kind(cc_test, ${tests_kind}) ${ui_excludes} ${bpf_excludes}" > bazel_tests_gcc_opt

# Sanitizer (Limit to C++ only).
${bazel_query} "kind(cc_binary, ${buildables_kind}) ${ui_excludes} ${bpf_excludes} \
${sanitizer_only}" > bazel_buildables_sanitizer 2>/dev/null
${sanitizer_only}" > bazel_buildables_sanitizer
${bazel_query} "kind(cc_test, ${tests_kind}) ${ui_excludes} ${bpf_excludes} \
${sanitizer_only}" > bazel_tests_sanitizer 2>/dev/null
${sanitizer_only}" > bazel_tests_sanitizer

# BPF.
${bazel_query} "attr('tags', 'requires_bpf', ${buildables_kind})" > bazel_buildables_bpf 2>/dev/null
${bazel_query} "attr('tags', 'requires_bpf', ${tests_kind})" > bazel_tests_bpf 2>/dev/null
${bazel_query} "attr('tags', 'requires_bpf', ${buildables_kind})" > bazel_buildables_bpf
${bazel_query} "attr('tags', 'requires_bpf', ${tests_kind})" > bazel_tests_bpf

# BPF Sanitizer (C/C++ Only).
${bazel_query} "kind(cc_binary, attr('tags', 'requires_bpf', ${buildables_kind})) \
${sanitizer_only}" > bazel_buildables_bpf_sanitizer 2>/dev/null
${sanitizer_only}" > bazel_buildables_bpf_sanitizer
${bazel_query} "kind(cc_test, attr('tags', 'requires_bpf', ${tests_kind})) \
${sanitizer_only}" > bazel_tests_bpf_sanitizer 2>/dev/null
${sanitizer_only}" > bazel_tests_bpf_sanitizer

if [[ -s bazel_buildables_clang_dbg ]]; then
touch bazel_cc_changed
Expand Down

0 comments on commit 1773124

Please sign in to comment.