Skip to content

Commit

Permalink
chore: move to bazel 3.6-7.0 for toolchain transition (#4720)
Browse files Browse the repository at this point in the history
* chore: move to bazel 3.6-7.0 for toolchain transition

* chore: fix BazelTestEngine join
  • Loading branch information
shahms authored Oct 22, 2020
1 parent 0b32c37 commit 037deb8
Show file tree
Hide file tree
Showing 82 changed files with 39 additions and 23,325 deletions.
2 changes: 1 addition & 1 deletion .bazelminversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.2.0
3.6.0
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.6.0
3.7.0
18 changes: 13 additions & 5 deletions kythe/cxx/extractor/toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain")

CxxExtractorToolchainInfo = provider(
doc = "Provides required information for C++/ObjectiveC extractors.",
fields = ["cc_toolchain", "extractor_binary", "compiler_executable"],
fields = [
"cc_toolchain",
"extractor_binary",
"compiler_executable",
],
)

CXX_EXTRACTOR_TOOLCHAINS = ["@io_kythe//kythe/cxx/extractor:toolchain_type"]
Expand All @@ -31,9 +35,9 @@ def _cxx_extractor_toolchain_impl(ctx):
else:
compiler_executable = cc_toolchain.compiler_executable
cxx_extractor = CxxExtractorToolchainInfo(
extractor_binary = ctx.attr.extractor.files_to_run,
compiler_executable = compiler_executable,
cc_toolchain = cc_toolchain,
compiler_executable = compiler_executable,
extractor_binary = ctx.attr.extractor.files_to_run,
)
return [
platform_common.ToolchainInfo(
Expand All @@ -43,7 +47,6 @@ def _cxx_extractor_toolchain_impl(ctx):
]

cxx_extractor_toolchain = rule(
implementation = _cxx_extractor_toolchain_impl,
attrs = {
"extractor": attr.label(
executable = True,
Expand All @@ -55,9 +58,14 @@ cxx_extractor_toolchain = rule(
default = Label("@bazel_tools//tools/cpp:current_cc_toolchain"),
),
},
provides = [CxxExtractorToolchainInfo, platform_common.ToolchainInfo],
fragments = ["cpp"],
incompatible_use_toolchain_transition = True,
provides = [
CxxExtractorToolchainInfo,
platform_common.ToolchainInfo,
],
toolchains = ["@bazel_tools//tools/cpp:toolchain_type"],
implementation = _cxx_extractor_toolchain_impl,
)

def register_toolchains():
Expand Down
3 changes: 2 additions & 1 deletion kythe/cxx/tools/fyi/testdata/compile_commands.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ compile_commands = rule(
),
},
doc = "Generates a compile_commannds.json.in template file.",
incompatible_use_toolchain_transition = True,
outputs = {
"compile_commands": "compile_commands.json.in",
},
implementation = _compile_commands_impl,
toolchains = ["@bazel_tools//tools/cpp:toolchain_type"],
implementation = _compile_commands_impl,
)
4 changes: 2 additions & 2 deletions tools/arc/unit/engine/BazelTestEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ private function getTargets() {
}
// Quote each file to make it safe in case it has special characters in it.
$files = array_map(function($s) { return '"'.$s.'"'; }, $files);
$files = join($files, " ");
$files = join(" ", $files);
$this->debugPrint("files: " . $files);

$cmd = $this->bazelCommand("query", ["-k", "%s"]);
Expand Down Expand Up @@ -111,7 +111,7 @@ private function getFileTargets() {
}

private function runTests($targets) {
$this->debugPrint("runTests(" . join($targets, ", ") . ")");
$this->debugPrint("runTests(" . join(", ", $targets) . ")");

$tag_filters = join(",", array_map(function($s) { return "-$s"; }, self::$omit_tags));
$future = new ExecFuture($this->bazelCommand("test", array_merge([
Expand Down
1 change: 1 addition & 0 deletions tools/build_rules/verifier_test/cc_indexer_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ _cc_kythe_proto_library_aspect = aspect(
),
},
fragments = ["cpp"],
incompatible_use_toolchain_transition = True,
toolchains = ["@bazel_tools//tools/cpp:toolchain_type"],
implementation = _cc_kythe_proto_library_aspect_impl,
)
Expand Down
14 changes: 7 additions & 7 deletions tools/platforms/configs/.latest.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
# Specifically, it includes all toolchain/platform flags
# This file is used for testing purposes.

build:remote --host_javabase=//tools/platforms/configs/default_toolchain_config_spec_name/bazel_3.6.0/java:jdk
build:remote --javabase=//tools/platforms/configs/default_toolchain_config_spec_name/bazel_3.6.0/java:jdk
build:remote --crosstool_top=//tools/platforms/configs/default_toolchain_config_spec_name/bazel_3.6.0/cc:toolchain
build:remote --extra_toolchains=//tools/platforms/configs/default_toolchain_config_spec_name/bazel_3.6.0/config:cc-toolchain
build:remote --extra_execution_platforms=//tools/platforms/configs/default_toolchain_config_spec_name/bazel_3.6.0/config:platform
build:remote --host_platform=//tools/platforms/configs/default_toolchain_config_spec_name/bazel_3.6.0/config:platform
build:remote --platforms=//tools/platforms/configs/default_toolchain_config_spec_name/bazel_3.6.0/config:platform
build:remote --host_javabase=//tools/platforms/configs/default_toolchain_config_spec_name/bazel_3.7.0/java:jdk
build:remote --javabase=//tools/platforms/configs/default_toolchain_config_spec_name/bazel_3.7.0/java:jdk
build:remote --crosstool_top=//tools/platforms/configs/default_toolchain_config_spec_name/bazel_3.7.0/cc:toolchain
build:remote --extra_toolchains=//tools/platforms/configs/default_toolchain_config_spec_name/bazel_3.7.0/config:cc-toolchain
build:remote --extra_execution_platforms=//tools/platforms/configs/default_toolchain_config_spec_name/bazel_3.7.0/config:platform
build:remote --host_platform=//tools/platforms/configs/default_toolchain_config_spec_name/bazel_3.7.0/config:platform
build:remote --platforms=//tools/platforms/configs/default_toolchain_config_spec_name/bazel_3.7.0/config:platform

# Import the default bazelrc file in bazel-toolchains repo.
# This will only work for tests executed from bazel-toolchains
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 037deb8

Please sign in to comment.