Debian Codegraph @

infra/bots/BUILD.bazel

raw
1 package(
2 default_applicable_licenses = ["//:license"],
3 )
4
5 licenses(["notice"])
6
7 # This rule is a convenient way to build all the task drivers and copy them all into a single
8 # place as a tar folder. Otherwise, we would need to run many separate bazel build commands and
9 # then fish the executables out of a deep folder structure like:
10 # _bazel_bin/infra/bots/task_drivers/bazel_build_all/bazel_build_all_/bazel_build_all
11 # After this runs, the executables will all be in //_bazel_bin/built_task_drivers.tar
12 # Why the tar file? Windows binaries are created with .exe and other platforms are not. However,
13 # outs *must* be static, thus we cannot use a select. Bazel requires us to define all outputs
14 # exactly, so the only way to support files with different names on different platforms is to
15 # package them up into a file with the same name.
16 # Cross compilation is handled as per https://github.com/bazelbuild/rules_go#how-do-i-cross-compile
17 genrule(
18 name = "all_task_drivers",
19 srcs = [
20 "//infra/bots/task_drivers/bazel_build",
21 "//infra/bots/task_drivers/canvaskit_gold",
22 "//infra/bots/task_drivers/check_generated_files",
23 "//infra/bots/task_drivers/codesize",
24 "//infra/bots/task_drivers/compile_wasm_gm_tests",
25 "//infra/bots/task_drivers/cpu_tests",
26 "//infra/bots/task_drivers/g3_canary",
27 "//infra/bots/task_drivers/go_linters",
28 "//infra/bots/task_drivers/perf_puppeteer_canvas",
29 "//infra/bots/task_drivers/perf_puppeteer_render_skps",
30 "//infra/bots/task_drivers/perf_puppeteer_skottie_frames",
31 "//infra/bots/task_drivers/recreate_skps",
32 "//infra/bots/task_drivers/run_gn_to_bp",
33 "//infra/bots/task_drivers/external_client",
34 "//infra/bots/task_drivers/run_wasm_gm_tests",
35 "//infra/bots/task_drivers/toolchain_layering_check",
36 "@org_skia_go_infra//infra/bots/task_drivers/build_push_docker_image",
37 "@org_skia_go_infra//infra/bots/task_drivers/canary",
38 ],
39 outs = ["built_task_drivers.tar"],
40 # Make a temporary directory in the output directory, as recommended by
41 # https://bazel.build/reference/be/make-variables#predefined_genrule_variables
42 # Reminder that $(@D) refers to that output directory and $(SRCS) refers to all
43 # the input files, in a space separated list.
44 cmd = "mkdir -p $(@D)/tmp_task_drivers && " +
45 # Copy all the task drivers to the same folder
46 "cp $(SRCS) $(@D)/tmp_task_drivers && " +
47 # Tar them up from that folder (so they will be in the top level of the tar directory)
48 # The parent directory of our temp directory is where the output tar file should go.
49 "cd $(@D)/tmp_task_drivers && tar --file ../built_task_drivers.tar --create . && " +
50 # Delete the temp folder (as per the recommendation above)
51 "cd .. && rm -rf tmp_task_drivers",
52 )