blob: 4aef01e4569a0f764c7f7315f91d4a3fc1319394 [file] [log] [blame]
Ulf Adams3e87c622017-06-13 10:53:13 +02001# Bazel - Google's Build System
2
Damien Martin-Guillerezd019eea2015-07-24 12:40:48 +00003package(default_visibility = ["//scripts/release:__pkg__"])
4
Philipp Wollermann02401d92017-03-17 13:51:14 +00005exports_files(["LICENSE"])
6
Damien Martin-Guillerezd019eea2015-07-24 12:40:48 +00007filegroup(
Ulf Adams3e87c622017-06-13 10:53:13 +02008 name = "srcs",
9 srcs = glob(
10 ["*"],
11 exclude = [
12 "bazel-*", # convenience symlinks
13 "out", # IntelliJ with setup-intellij.sh
14 "output", # output of compile.sh
15 ".*", # mainly .git* files
16 ],
17 ) + [
18 "//examples:srcs",
19 "//scripts:srcs",
20 "//site:srcs",
21 "//src:srcs",
22 "//tools:srcs",
23 "//third_party:srcs",
Jakob Buchgraber8da42b62019-04-24 07:37:07 -070024 ] + glob([".bazelci/*"]) + [".bazelrc"],
Damien Martin-Guillerez0baff0f2017-08-22 17:40:37 +020025 visibility = ["//src/test/shell/bazel:__pkg__"],
Ulf Adams3e87c622017-06-13 10:53:13 +020026)
27
28filegroup(
Damien Martin-Guillerezd019eea2015-07-24 12:40:48 +000029 name = "git",
Andreas Bergmeier062da5c2017-12-01 07:30:35 -080030 srcs = glob(
31 [".git/**"],
32 exclude = [".git/**/*[*"], # gitk creates temp files with []
33 ),
Damien Martin-Guillerezd019eea2015-07-24 12:40:48 +000034)
Lukacs Berki678ba232015-09-03 13:28:55 +000035
36filegroup(
37 name = "dummy",
38 visibility = ["//visibility:public"],
39)
Han-Wen Nienhuys47182322015-10-09 17:56:52 +000040
Damien Martin-Guillerezde54bca2016-02-29 10:49:43 +000041filegroup(
Damien Martin-Guillerez9b889202016-03-03 00:35:13 +000042 name = "workspace-file",
cushonb6646232018-09-07 01:44:10 -070043 srcs = [
44 ":WORKSPACE",
45 ":distdir.bzl",
46 ],
Cal Peyser2152bc12016-04-22 17:08:59 +000047 visibility = [
John Cater214a7ae2017-08-09 17:24:53 +020048 "//src/test/shell/bazel:__subpackages__",
Cal Peyser2152bc12016-04-22 17:08:59 +000049 ],
Damien Martin-Guillerez9b889202016-03-03 00:35:13 +000050)
51
52filegroup(
Yun Penga50635d2016-07-26 13:29:03 +000053 name = "changelog-file",
54 srcs = [":CHANGELOG.md"],
55 visibility = [
John Caterb0308d42017-01-30 17:49:26 +000056 "//scripts/packages:__subpackages__",
Yun Penga50635d2016-07-26 13:29:03 +000057 ],
58)
59
60filegroup(
Jakob Buchgraber6073f1d2017-06-06 11:58:26 -040061 name = "bootstrap-derived-java-srcs",
62 srcs = glob(["derived/**/*.java"]),
63 visibility = ["//:__subpackages__"],
64)
65
Damien Martin-Guillerezde54bca2016-02-29 10:49:43 +000066load("//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
67
68pkg_tar(
69 name = "bazel-srcs",
John Cater214a7ae2017-08-09 17:24:53 +020070 srcs = [":srcs"],
John Cater2f838922018-11-12 08:19:03 -080071 remap_paths = {
72 # Rewrite paths coming from local repositories back into third_party.
73 "../googleapis": "third_party/googleapis",
74 "../remoteapis": "third_party/remoteapis",
75 },
Damien Martin-Guillerezde54bca2016-02-29 10:49:43 +000076 strip_prefix = ".",
77 # Public but bazel-only visibility.
78 visibility = ["//:__subpackages__"],
79)
Klaus Aehlig4ca79d42016-10-22 07:59:41 +000080
László Csomor0783b9e2017-08-11 10:28:36 +020081py_binary(
82 name = "combine_distfiles",
83 srcs = ["combine_distfiles.py"],
84 visibility = ["//visibility:private"],
85 deps = ["//src:create_embedded_tools_lib"],
86)
87
Klaus Aehlig4ca79d42016-10-22 07:59:41 +000088genrule(
89 name = "bazel-distfile",
90 srcs = [
91 ":bazel-srcs",
92 "//src:derived_java_srcs",
Shahan Yang1a4f7912017-12-19 14:50:53 -080093 "//src/main/java/com/google/devtools/build/lib/skyframe/serialization/autocodec:bootstrap_autocodec.tar",
Klaus Aehlig3c9cd822018-05-24 03:35:42 -070094 "@additional_distfiles//:archives.tar",
Klaus Aehlig4ca79d42016-10-22 07:59:41 +000095 ],
96 outs = ["bazel-distfile.zip"],
László Csomor0783b9e2017-08-11 10:28:36 +020097 cmd = "$(location :combine_distfiles) $@ $(SRCS)",
98 tools = [":combine_distfiles"],
Klaus Aehlig279a0612016-11-11 09:51:44 +000099 # Public but bazel-only visibility.
100 visibility = ["//:__subpackages__"],
Klaus Aehlig4ca79d42016-10-22 07:59:41 +0000101)
Klaus Aehlig52b03d12016-11-24 15:16:01 +0000102
103genrule(
104 name = "bazel-distfile-tar",
105 srcs = [
106 ":bazel-srcs",
107 "//src:derived_java_srcs",
Shahan Yang1a4f7912017-12-19 14:50:53 -0800108 "//src/main/java/com/google/devtools/build/lib/skyframe/serialization/autocodec:bootstrap_autocodec.tar",
Klaus Aehlig3c9cd822018-05-24 03:35:42 -0700109 "@additional_distfiles//:archives.tar",
Klaus Aehlig52b03d12016-11-24 15:16:01 +0000110 ],
111 outs = ["bazel-distfile.tar"],
László Csomor0783b9e2017-08-11 10:28:36 +0200112 cmd = "$(location :combine_distfiles_to_tar.sh) $@ $(SRCS)",
113 tools = ["combine_distfiles_to_tar.sh"],
Klaus Aehlig52b03d12016-11-24 15:16:01 +0000114 # Public but bazel-only visibility.
115 visibility = ["//:__subpackages__"],
116)
Googlercc858622017-07-25 21:03:05 +0200117
118# This is a workaround for fetching Bazel toolchains, for remote execution.
119# See https://github.com/bazelbuild/bazel/issues/3246.
120# Will be removed once toolchain fetching is supported.
121filegroup(
122 name = "dummy_toolchain_reference",
xingaobea67122018-01-16 08:29:59 -0800123 srcs = ["@bazel_toolchains//configs/debian8_clang/0.2.0/bazel_0.9.0:empty"],
Googlercc858622017-07-25 21:03:05 +0200124 visibility = ["//visibility:public"],
125)
philwo3a3a37a2019-02-05 07:33:47 -0800126
Jakob Buchgraber593c5302019-04-16 10:12:20 -0700127constraint_setting(name = "machine_size")
128
129# A machine with "high cpu count".
130constraint_value(
131 name = "highcpu_machine",
132 constraint_setting = ":machine_size",
133 visibility = ["//visibility:public"],
134)
135
philwo3a3a37a2019-02-05 07:33:47 -0800136platform(
Jakob Buchgraber593c5302019-04-16 10:12:20 -0700137 name = "default_host_platform",
138 constraint_values = [
139 ":highcpu_machine",
140 ],
141 parents = ["@bazel_tools//platforms:host_platform"],
142)
143
Jakob Buchgraber593c5302019-04-16 10:12:20 -0700144# The highcpu RBE platform where heavy actions run on. In order to
145# use this platform add the highcpu_machine constraint to your target.
146platform(
Jakob Buchgraber3541ad62019-04-30 07:51:12 -0700147 name = "rbe_highcpu_platform",
Jakob Buchgraber593c5302019-04-16 10:12:20 -0700148 constraint_values = [
Jakob Buchgraber3541ad62019-04-30 07:51:12 -0700149 "//:highcpu_machine",
Jakob Buchgraber593c5302019-04-16 10:12:20 -0700150 ],
buchgr9a371382019-05-02 04:35:59 -0700151 parents = ["@bazel_rbe_toolchains//configs/bazel_0.25.0/bazel-ubuntu1804:default_platform"],
Jakob Buchgraber593c5302019-04-16 10:12:20 -0700152 remote_execution_properties = """
153 {PARENT_REMOTE_EXECUTION_PROPERTIES}
154 properties: {
155 name: "gceMachineType"
156 value: "n1-highcpu-32"
157 }
158 """,
159)