Upgrade bazel to 4.0.0rc2
A few things of note here:
- I disabled a few incompatible flags in order to minimize the number
of changes we have to deal with.
- I had to upgrade the typescript rules because the old ones didn't
work with new bazel anymore. That brought a typescript compiler
upgrade along. This in turn required me to turn off strict mode.
Otherwise, there are a _ton_ of errors in our typescript files. The
vast majority of them are related to `null` checking.
- The `default_python_version` attribute on Python rules doesn't exist
anymore. It's now replaced by `python_version`.
- I removed the CROSSTOOL in favour of a Starlark-equivalent
configuration function. See `tools/cpp/toolchain_config.bzl` for
more details. This new file is auto-generated using the migration
tools from `rules_cc`. I have made no attempt to beautify this file.
Relatedly, all CROSSTOOL-related files/functionality are gone as well.
- The `config_setting` targets to detect the compiler names had to
change. This is perhaps not surprising. Thanks to Austin for
pointing this out to me.
- The `cc_toolchain` targets all required `ar_files` and `as_files`
attributes where they didn't before. Not really sure what changed,
but the compilations appears to work with these changes.
Change-Id: I2317e5160fa3f8d87f94106b0c3b328918d0c42c
diff --git a/y2020/BUILD b/y2020/BUILD
index f54ec84..4643ae8 100644
--- a/y2020/BUILD
+++ b/y2020/BUILD
@@ -240,8 +240,8 @@
data = [
":config",
"//aos/network:web_proxy_main",
- "//y2020/www:camera_main_bundle",
- "//y2020/www:field_main_bundle",
+ "//y2020/www:camera_main_bundle.min.js",
+ "//y2020/www:field_main_bundle.min.js",
"//y2020/www:files",
],
)
diff --git a/y2020/vision/sift/BUILD b/y2020/vision/sift/BUILD
index a7827b6..158aa94 100644
--- a/y2020/vision/sift/BUILD
+++ b/y2020/vision/sift/BUILD
@@ -30,7 +30,7 @@
"//tools/cpp:toolchain",
"@amd64_debian_sysroot//:sysroot_files",
],
- default_python_version = "PY3",
+ python_version = "PY3",
main = "fast_gaussian_runner.py",
restricted_to = [
"//tools:k8",
@@ -234,7 +234,7 @@
py_binary(
name = "demo_sift_training",
srcs = ["demo_sift_training.py"],
- default_python_version = "PY3",
+ python_version = "PY3",
srcs_version = "PY2AND3",
deps = [
":sift_fbs_python",
diff --git a/y2020/vision/tools/python_code/BUILD b/y2020/vision/tools/python_code/BUILD
index 53464ac..9b4eb08 100644
--- a/y2020/vision/tools/python_code/BUILD
+++ b/y2020/vision/tools/python_code/BUILD
@@ -15,7 +15,7 @@
data = glob(["calib_files/*.json"]) + glob([
"test_images/*.png",
]),
- default_python_version = "PY3",
+ python_version = "PY3",
srcs_version = "PY2AND3",
deps = [
"//external:python-glog",
@@ -63,7 +63,7 @@
data = glob(["calib_files/*.json"]) + glob([
"test_images/*.png",
]),
- default_python_version = "PY3",
+ python_version = "PY3",
main = "load_sift_training.py",
srcs_version = "PY2AND3",
deps = [
diff --git a/y2020/www/BUILD b/y2020/www/BUILD
index bc9c016..60fb704 100644
--- a/y2020/www/BUILD
+++ b/y2020/www/BUILD
@@ -1,4 +1,4 @@
-load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
+load("@npm_bazel_typescript//:defs.bzl", "ts_library")
load("@build_bazel_rules_nodejs//:defs.bzl", "rollup_bundle")
load("//frc971/downloader:downloader.bzl", "aos_downloader_dir")
@@ -32,12 +32,14 @@
"//aos/network/www:proxy",
"//frc971/control_loops/drivetrain:drivetrain_status_ts_fbs",
"//y2020/vision/sift:sift_ts_fbs",
+ "@com_github_google_flatbuffers//ts:flatbuffers_ts",
],
)
rollup_bundle(
name = "camera_main_bundle",
- entry_point = "y2020/www/camera_main",
+ enable_code_splitting = False,
+ entry_point = "camera_main.ts",
visibility = ["//y2020:__subpackages__"],
deps = [
"camera_main",
@@ -46,7 +48,8 @@
rollup_bundle(
name = "field_main_bundle",
- entry_point = "y2020/www/field_main",
+ enable_code_splitting = False,
+ entry_point = "field_main.ts",
visibility = ["//y2020:__subpackages__"],
deps = [
"field_main",