Skip to content
Closed
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
5 changes: 2 additions & 3 deletions .bazelci/postsubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ tasks:
- "//src/tools/one_version/..."
- "//src/tools/singlejar/..."
- "//third_party/def_parser/..."
- "//tools/aquery_differ/..."
- "//scripts/aquery_differ/..."
- "//tools/bash/..."
- "//tools/build_defs/..."
- "//tools/java/..."
Expand All @@ -224,7 +224,6 @@ tasks:
# Re-enable the following tests on Windows:
# https://github.com/bazelbuild/bazel/issues/4292
- "-//src/test/shell/bazel/remote/..."
- "-//tools/python:pywrapper_test"
include_json_profile:
- build
- test
Expand Down Expand Up @@ -271,7 +270,7 @@ tasks:
- "//src/tools/singlejar/..."
- "//src/tools/workspacelog/..."
- "//third_party/ijar/..."
- "//tools/aquery_differ/..."
- "//scripts/aquery_differ/..."
- "//tools/python/..."
- "//tools/bash/..."
- "//tools/test/..."
Expand Down
5 changes: 2 additions & 3 deletions .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ tasks:
- "//src/tools/one_version/..."
- "//src/tools/singlejar/..."
- "//third_party/def_parser/..."
- "//tools/aquery_differ/..."
- "//scripts/aquery_differ/..."
- "//tools/bash/..."
- "//tools/build_defs/..."
- "//tools/java/..."
Expand All @@ -229,7 +229,6 @@ tasks:
# Re-enable the following tests on Windows:
# https://github.com/bazelbuild/bazel/issues/4292
- "-//src/test/shell/bazel/remote/..."
- "-//tools/python:pywrapper_test"
include_json_profile:
- build
- test
Expand Down Expand Up @@ -274,7 +273,7 @@ tasks:
- "//src/tools/singlejar/..."
- "//src/tools/workspacelog/..."
- "//third_party/ijar/..."
- "//tools/aquery_differ/..."
- "//scripts/aquery_differ/..."
- "//tools/python/..."
- "//tools/bash/..."
- "//tools/test/..."
Expand Down
5 changes: 0 additions & 5 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,6 @@ pkg_tar(
visibility = ["//:__subpackages__"],
)

exports_files(
["maven_install.json"],
visibility = ["//tools/compliance:__pkg__"],
)

py_binary(
name = "combine_distfiles",
srcs = ["combine_distfiles.py"],
Expand Down
2 changes: 2 additions & 0 deletions scripts/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ sh_test(
filegroup(
name = "srcs",
srcs = glob(["**"]) + [
"//scripts/aquery_differ:srcs",
"//scripts/ctexplain:srcs",
"//scripts/docs:srcs",
"//scripts/packages:srcs",
"//scripts/release:srcs",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
/path/to/output_two.textproto

2. Run the differ from a bazel repo:
bazel run //tools/aquery_differ:aquery_differ -- \
bazel run //scripts/aquery_differ:aquery_differ -- \
--before=/path/to/output_one.textproto \
--after=/path/to/output_two.textproto \
--input_type=textproto \
Expand All @@ -43,8 +43,8 @@
from google.protobuf import proto
from google.protobuf import text_format
from src.main.protobuf import analysis_v2_pb2
from tools.aquery_differ.resolvers.dep_set_resolver import DepSetResolver
from tools.aquery_differ.resolvers.path_fragment_resolver import PathFragmentResolver
from scripts.aquery_differ.resolvers.dep_set_resolver import DepSetResolver
from scripts.aquery_differ.resolvers.path_fragment_resolver import PathFragmentResolver
# pylint: disable=g-import-not-at-top
# resource lib isn't available on Windows.
if os.name != "nt":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from google.protobuf import proto

from src.main.protobuf import analysis_v2_pb2
from tools.aquery_differ import aquery_differ
from scripts.aquery_differ import aquery_differ


def make_aquery_output(action_objs, artifact_objs, path_fragment_objs):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
from dataclasses import dataclass
from typing import Tuple

from tools.ctexplain.ctexplain_types import ConfiguredTarget
import tools.ctexplain.util as util
from scripts.ctexplain.ctexplain_types import ConfiguredTarget
import scripts.ctexplain.util as util


@dataclass(frozen=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

from frozendict import frozendict

import tools.ctexplain.analyses.summary as summary
from tools.ctexplain.ctexplain_types import Configuration
from tools.ctexplain.ctexplain_types import ConfiguredTarget
from tools.ctexplain.ctexplain_types import NullConfiguration
import scripts.ctexplain.analyses.summary as summary
from scripts.ctexplain.ctexplain_types import Configuration
from scripts.ctexplain.ctexplain_types import ConfiguredTarget
from scripts.ctexplain.ctexplain_types import NullConfiguration


class SummaryTest(unittest.TestCase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
from typing import List
from typing import Tuple
from frozendict import frozendict
from tools.ctexplain.ctexplain_types import Configuration
from tools.ctexplain.ctexplain_types import ConfiguredTarget
from tools.ctexplain.ctexplain_types import HostConfiguration
from tools.ctexplain.ctexplain_types import NullConfiguration
from scripts.ctexplain.ctexplain_types import Configuration
from scripts.ctexplain.ctexplain_types import ConfiguredTarget
from scripts.ctexplain.ctexplain_types import HostConfiguration
from scripts.ctexplain.ctexplain_types import NullConfiguration


def run_bazel_in_client(args: List[str]) -> Tuple[int, List[str], List[str]]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
import os
import unittest
from src.test.py.bazel import test_base
from tools.ctexplain.bazel_api import BazelApi
from tools.ctexplain.ctexplain_types import NullConfiguration
from scripts.ctexplain.bazel_api import BazelApi
from scripts.ctexplain.ctexplain_types import NullConfiguration


class BazelApiTest(test_base.TestBase):
Expand Down
10 changes: 5 additions & 5 deletions tools/ctexplain/ctexplain.py → scripts/ctexplain/ctexplain.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@
from absl import app
from absl import flags

import tools.ctexplain.analyses.summary as summary
from tools.ctexplain.bazel_api import BazelApi
from tools.ctexplain.ctexplain_types import ConfiguredTarget
import tools.ctexplain.lib as lib
import tools.ctexplain.util as util
import scripts.ctexplain.analyses.summary as summary
from scripts.ctexplain.bazel_api import BazelApi
from scripts.ctexplain.ctexplain_types import ConfiguredTarget
import scripts.ctexplain.lib as lib
import scripts.ctexplain.util as util

FLAGS = flags.FLAGS

Expand Down
4 changes: 2 additions & 2 deletions tools/ctexplain/lib.py → scripts/ctexplain/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"""General-purpose business logic."""
from typing import Tuple

import tools.ctexplain.bazel_api as bazel_api
from tools.ctexplain.ctexplain_types import ConfiguredTarget
import scripts.ctexplain.bazel_api as bazel_api
from scripts.ctexplain.ctexplain_types import ConfiguredTarget


def analyze_build(bazel: bazel_api.BazelApi, labels: Tuple[str, ...],
Expand Down
8 changes: 4 additions & 4 deletions tools/ctexplain/lib_test.py → scripts/ctexplain/lib_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
# pylint: disable=g-generic-assert
import unittest
from src.test.py.bazel import test_base
import tools.ctexplain.bazel_api as bazel_api
from tools.ctexplain.ctexplain_types import Configuration
from tools.ctexplain.ctexplain_types import NullConfiguration
import tools.ctexplain.lib as lib
import scripts.ctexplain.bazel_api as bazel_api
from scripts.ctexplain.ctexplain_types import Configuration
from scripts.ctexplain.ctexplain_types import NullConfiguration
import scripts.ctexplain.lib as lib


class LibTest(test_base.TestBase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import unittest
from frozendict import frozendict
from tools.ctexplain.ctexplain_types import Configuration
from scripts.ctexplain.ctexplain_types import Configuration


class TypesTest(unittest.TestCase):
Expand Down
File renamed without changes.
12 changes: 2 additions & 10 deletions src/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,11 @@ py_binary(
deps = [":create_embedded_tools_lib"],
)

# The tools Bazel uses to compile Java.
# TODO(#6316): Gradually remove the targets here.
JAVA_TOOLS = [
"//src/java_tools/buildjar/java/com/google/devtools/build/buildjar/jarhelper:srcs",
"//src/java_tools/import_deps_checker/java/com/google/devtools/build/importdeps:embedded_tools",
]

# TODO(philwo): Clean this up, once a Bazel that can run py_binary and sh_binary
# in Starlark rules on Windows has been released.
[filegroup(
name = "embedded_tools" + suffix + "_srcs",
srcs = JAVA_TOOLS + [
srcs = [
"BUILD.tools",
"MODULE.tools",
"//src/conditions:embedded_tools",
Expand Down Expand Up @@ -133,7 +126,7 @@ rule_size_test(
# WARNING: Only adjust the number in `expect` if you are intentionally
# adding or removing embedded tools. Know that the more embedded tools there
# are in Bazel, the bigger the binary becomes and the slower Bazel starts.
expect = 292,
expect = 279,
margin = 5, # percentage
)

Expand Down Expand Up @@ -337,7 +330,6 @@ genrule(
"//scripts/packages:__pkg__", # For installer generation
"//src/java:__subpackages__", # For command line reference generation
"//src/test:__subpackages__", # For integration tests
"//tools/compliance:__pkg__", # For license gathering
],
) for suffix, jdk in [
("-dev", "_jdk_allmodules"),
Expand Down
4 changes: 0 additions & 4 deletions src/create_embedded_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,6 @@ def main():
# Adding contextlib.closing to be python 2.6 (for centos 6.7) compatible
with contextlib.closing(
zipfile.ZipFile(output_zip, 'w', zipfile.ZIP_DEFLATED)) as output_zip:
zipinfo = zipfile.ZipInfo('WORKSPACE', (1980, 1, 1, 0, 0, 0))
zipinfo.external_attr = 0o644 << 16
output_zip.writestr(zipinfo, 'workspace(name = "bazel_tools")\n')

# By sorting the file list, the resulting ZIP file will be reproducible and
# deterministic.
for archive_file, input_file in sorted(input_files.items()):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@ filegroup(
srcs = glob(["**"]),
)

filegroup(
name = "embedded_tools",
srcs = [
"BUILD.tools",
],
)

java_library(
name = "import_deps_checker",
srcs = glob(
Expand Down

This file was deleted.

5 changes: 1 addition & 4 deletions src/test/py/bazel/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,9 @@ py_library(
"//src/test/tools/bzlmod:MODULE.bazel.lock",
],
visibility = [
"//scripts/ctexplain:__pkg__",
"//src/test/py/bazel:__pkg__",
"//third_party/def_parser:__pkg__",
"//tools/android:__pkg__",
"//tools/build_rules:__pkg__",
"//tools/ctexplain:__pkg__",
"//tools/python:__pkg__",
],
deps = [
"//third_party/py/abseil",
Expand Down
2 changes: 1 addition & 1 deletion src/test/shell/bazel/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ package(default_visibility = ["//visibility:private"])
filegroup(
name = "srcs",
srcs = glob(["**"]) + [
"//scripts/aquery_differ:srcs",
"//src/test/shell/bazel/apple:srcs",
"//src/test/shell/bazel/remote:srcs",
"//src/test/shell/bazel/testdata:srcs",
"//tools/aquery_differ:srcs",
],
visibility = ["//src/test/shell:__pkg__"],
)
Expand Down
2 changes: 1 addition & 1 deletion src/test/shell/bazel/list_source_repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ genrule(
visibility = ["//visibility:public"],
cmd = " | ".join([
"cat $<",
"grep -Ev '^(\\\\.git|\\\\.devcontainer|.ijwb|out/|output/|bazel-|derived|tools/defaults/BUILD)'",
"grep -Ev '^(\\\\.git|\\\\.devcontainer|.ijwb|out/|output/|bazel-|derived)'",
"grep -Ev '%s'",
"sort -u > $@",
]),
Expand Down
6 changes: 1 addition & 5 deletions tools/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,12 @@ filegroup(
srcs = glob(["**"]) + [
"//tools/allowlists:srcs",
"//tools/android:srcs",
"//tools/aquery_differ:srcs",
"//tools/bash:srcs",
"//tools/build_defs:srcs",
"//tools/build_rules:srcs",
"//tools/buildstamp:srcs",
"//tools/compliance:srcs",
"//tools/coverage:srcs",
"//tools/cpp:srcs",
"//tools/ctexplain:srcs",
"//tools/def_parser:srcs",
"//tools/distributions:srcs",
"//tools/genrule:srcs",
Expand Down Expand Up @@ -52,8 +49,7 @@ filegroup(
"//tools/def_parser:srcs",
"//tools/genrule:srcs",
"//tools/java:embedded_tools",
"//tools/jdk:package-srcs",
"//tools/jdk:srcs",
"//tools/jdk:embedded_tools",
"//tools/launcher:srcs",
"//tools/objc:srcs",
"//tools/osx:srcs",
Expand Down
25 changes: 0 additions & 25 deletions tools/android/BUILD
Original file line number Diff line number Diff line change
@@ -1,21 +1,5 @@
load("@rules_python//python:defs.bzl", "py_binary", "py_test")

package(default_visibility = ["//tools:__pkg__"])

py_binary(
name = "instrumentation_test_check",
srcs = ["instrumentation_test_check.py"],
python_version = "PY3",
srcs_version = "PY3",
deps = ["//third_party/py/abseil"],
)

py_test(
name = "instrumentation_test_check_test",
srcs = ["instrumentation_test_check_test.py"],
deps = [":instrumentation_test_check"],
)

filegroup(
name = "srcs",
srcs = glob(
Expand All @@ -40,12 +24,3 @@ filegroup(
"android_extensions.bzl",
],
)

platform(
name = "arm64-v8a",
constraint_values = [
"@platforms//os:android",
"@platforms//cpu:arm64",
],
visibility = ["//visibility:public"],
)
Loading
Loading