Skip to content

Commit

Permalink
SERVER-80501 Refactor Bazel-related files into /bazel directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve Gross authored and Evergreen Agent committed Sep 1, 2023
1 parent cec118f commit 17ee1c8
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "mongo_toolchain",
build_file = "@//toolchains:mongo_toolchain.BUILD",
build_file = "@//bazel/toolchains:mongo_toolchain.BUILD",
patch_cmds = [
# Alter each symlink to point to a canonical (rather than relative) path.
r"""
Expand Down
6 changes: 3 additions & 3 deletions bazel_config/BUILD.bazel → bazel/config/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("//bazel_config:configs.bzl", "compiler_type")
load("//bazel/config:configs.bzl", "compiler_type")

package(default_visibility = ["//visibility:public"])

Expand All @@ -10,13 +10,13 @@ compiler_type(
config_setting(
name = "compiler_type_clang",
flag_values = {
"//bazel_config:compiler_type": "clang",
"//bazel/config:compiler_type": "clang",
},
)

config_setting(
name = "compiler_type_gcc",
flag_values = {
"//bazel_config:compiler_type": "gcc",
"//bazel/config:compiler_type": "gcc",
},
)
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ cc_toolchain(
objcopy_files = ":all",
strip_files = ":all",
toolchain_config = select({
"@//bazel_config:compiler_type_clang": ":cc_clang_toolchain_config",
"@//bazel_config:compiler_type_gcc": ":cc_gcc_toolchain_config",
"@//bazel/config:compiler_type_clang": ":cc_clang_toolchain_config",
"@//bazel/config:compiler_type_gcc": ":cc_gcc_toolchain_config",
}),
)

Expand Down
5 changes: 4 additions & 1 deletion evergreen/bazel_compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ cd src
set -o errexit
set -o verbose

./bazelisk build --verbose_failures --//bazel_config:compiler_type={$compiler} ${targets}
# Use `eval` to force evaluation of the environment variables in the echo statement:
eval echo "Execution environment: Compiler: ${compiler} Targets: ${targets}"

./bazelisk build --verbose_failures --//bazel/config:compiler_type=${compiler} ${targets}

0 comments on commit 17ee1c8

Please sign in to comment.