From 2aa41bc2a66c14305e67cead13ac66d3ce2acf7e Mon Sep 17 00:00:00 2001 From: PJ Reiniger Date: Tue, 14 Jan 2025 23:00:01 -0500 Subject: [PATCH 1/3] [bazel] Update toolchain to support systemcore --- .bazelrc | 6 ++++ WORKSPACE | 28 +++++++++++-------- .../bazel/compiler_flags/systemcore_flags.rc | 11 ++++++++ 3 files changed, 34 insertions(+), 11 deletions(-) create mode 100644 shared/bazel/compiler_flags/systemcore_flags.rc diff --git a/.bazelrc b/.bazelrc index bb73151474b..aad909f686a 100644 --- a/.bazelrc +++ b/.bazelrc @@ -16,9 +16,15 @@ import shared/bazel/compiler_flags/base_linux_flags.rc import shared/bazel/compiler_flags/linux_flags.rc import shared/bazel/compiler_flags/osx_flags.rc import shared/bazel/compiler_flags/roborio_flags.rc +import shared/bazel/compiler_flags/systemcore_flags.rc import shared/bazel/compiler_flags/windows_flags.rc import shared/bazel/compiler_flags/coverage_flags.rc +# Alias toolchain names to what wpilibsuite uses for CI/Artifact naming +build:athena --config=roborio +build:linuxarm32 --config=raspibookworm32 +build:linuxarm64 --config=bookworm64 + build:build_java --test_tag_filters=allwpilib-build-java --build_tag_filters=allwpilib-build-java build:build_cpp --test_tag_filters=+allwpilib-build-cpp --build_tag_filters=+allwpilib-build-cpp build:no_example --test_tag_filters=-wpi-example --build_tag_filters=-wpi-example diff --git a/WORKSPACE b/WORKSPACE index 0d7786c2a23..3838549bbab 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -35,8 +35,8 @@ maven_install( # Download toolchains http_archive( name = "rules_bzlmodrio_toolchains", - sha256 = "fe267e2af53c1def1e962700a9aeda9e8fdfa9fb46b72167c615ec0e25447dd6", - url = "https://github.com/wpilibsuite/rules_bzlmodRio_toolchains/releases/download/2025-1/rules_bzlmodRio_toolchains-2025-1.tar.gz", + sha256 = "ff25b5f9445cbd43759be4c6582b987d1065cf817c593eedc7ada1a699298c84", + url = "https://github.com/wpilibsuite/rules_bzlmodRio_toolchains/releases/download/2025-1.bcr2/rules_bzlmodRio_toolchains-2025-1.bcr2.tar.gz", ) load("@rules_bzlmodrio_toolchains//:maven_deps.bzl", "setup_legacy_setup_toolchains_dependencies") @@ -50,8 +50,8 @@ load_toolchains() # http_archive( name = "rules_bzlmodrio_jdk", - sha256 = "a00d5fa971fbcad8a17b1968cdc5350688397035e90b0cb94e040d375ecd97b4", - url = "https://github.com/wpilibsuite/rules_bzlmodRio_jdk/releases/download/17.0.8.1-1/rules_bzlmodRio_jdk-17.0.8.1-1.tar.gz", + sha256 = "81869fe9860e39b17e4a9bc1d33c1ca2faede7e31d9538ed0712406f753a2163", + url = "https://github.com/wpilibsuite/rules_bzlmodRio_jdk/releases/download/17.0.12-7/rules_bzlmodRio_jdk-17.0.12-7.tar.gz", ) load("@rules_bzlmodrio_jdk//:maven_deps.bzl", "setup_legacy_setup_jdk_dependencies") @@ -62,9 +62,15 @@ register_toolchains( "@local_roborio//:macos", "@local_roborio//:linux", "@local_roborio//:windows", - "@local_raspi_32//:macos", - "@local_raspi_32//:linux", - "@local_raspi_32//:windows", + "@local_systemcore//:macos", + "@local_systemcore//:linux", + "@local_systemcore//:windows", + "@local_raspi_bullseye_32//:macos", + "@local_raspi_bullseye_32//:linux", + "@local_raspi_bullseye_32//:windows", + "@local_raspi_bookworm_32//:macos", + "@local_raspi_bookworm_32//:linux", + "@local_raspi_bookworm_32//:windows", "@local_bullseye_32//:macos", "@local_bullseye_32//:linux", "@local_bullseye_32//:windows", @@ -83,8 +89,8 @@ setup_legacy_setup_jdk_dependencies() http_archive( name = "bzlmodrio-ni", - sha256 = "197fceac88bf44fb8427d5e000b0083118d3346172dd2ad31eccf83a5e61b3ce", - url = "https://github.com/wpilibsuite/bzlmodRio-ni/releases/download/2025.0.0/bzlmodRio-ni-2025.0.0.tar.gz", + sha256 = "fff62c3cb3e83f9a0d0a01f1739477c9ca5e9a6fac05be1ad59dafcd385801f7", + url = "https://github.com/wpilibsuite/bzlmodRio-ni/releases/download/2025.2.0/bzlmodRio-ni-2025.2.0.tar.gz", ) load("@bzlmodrio-ni//:maven_cpp_deps.bzl", "setup_legacy_bzlmodrio_ni_cpp_dependencies") @@ -93,8 +99,8 @@ setup_legacy_bzlmodrio_ni_cpp_dependencies() http_archive( name = "bzlmodrio-opencv", - sha256 = "4f4a607956ca8555618736c3058dd96e09d02df19e95088c1e352d2319fd70c7", - url = "https://github.com/wpilibsuite/bzlmodRio-opencv/releases/download/2025.4.10.0-2/bzlmodRio-opencv-2025.4.10.0-2.tar.gz", + sha256 = "58c0069fc323259f3993750fe8245798f0db8b2fbf3772c5136253fa92912a16", + url = "https://github.com/wpilibsuite/bzlmodRio-opencv/releases/download/2025.4.10.0-3/bzlmodRio-opencv-2025.4.10.0-3.tar.gz", ) load("@bzlmodrio-opencv//:maven_cpp_deps.bzl", "setup_legacy_bzlmodrio_opencv_cpp_dependencies") diff --git a/shared/bazel/compiler_flags/systemcore_flags.rc b/shared/bazel/compiler_flags/systemcore_flags.rc new file mode 100644 index 00000000000..87f085a2144 --- /dev/null +++ b/shared/bazel/compiler_flags/systemcore_flags.rc @@ -0,0 +1,11 @@ + +build:systemcore --config=base_linux + +build:systemcore --platforms=@rules_bzlmodrio_toolchains//platforms/systemcore +build:systemcore --build_tag_filters=-no-bookworm +build:systemcore --features=compiler_param_file +build:systemcore --platform_suffix=systemcore +build:systemcore --incompatible_enable_cc_toolchain_resolution + +build:systemcore --cxxopt=-Wno-error=deprecated-declarations + From c1b96cefbfa1ac4b016caa869d1f1de10689ed80 Mon Sep 17 00:00:00 2001 From: PJ Reiniger Date: Tue, 14 Jan 2025 23:33:01 -0500 Subject: [PATCH 2/3] Lint --- shared/bazel/compiler_flags/systemcore_flags.rc | 1 - 1 file changed, 1 deletion(-) diff --git a/shared/bazel/compiler_flags/systemcore_flags.rc b/shared/bazel/compiler_flags/systemcore_flags.rc index 87f085a2144..f50d4c203cc 100644 --- a/shared/bazel/compiler_flags/systemcore_flags.rc +++ b/shared/bazel/compiler_flags/systemcore_flags.rc @@ -8,4 +8,3 @@ build:systemcore --platform_suffix=systemcore build:systemcore --incompatible_enable_cc_toolchain_resolution build:systemcore --cxxopt=-Wno-error=deprecated-declarations - From 69a75025658c63e6094b5ee2d756014f027e8256 Mon Sep 17 00:00:00 2001 From: PJ Reiniger Date: Wed, 15 Jan 2025 19:38:08 -0500 Subject: [PATCH 3/3] Update opencv to version that better supports systemcore --- WORKSPACE | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index 3838549bbab..eb731acfd2a 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -99,8 +99,8 @@ setup_legacy_bzlmodrio_ni_cpp_dependencies() http_archive( name = "bzlmodrio-opencv", - sha256 = "58c0069fc323259f3993750fe8245798f0db8b2fbf3772c5136253fa92912a16", - url = "https://github.com/wpilibsuite/bzlmodRio-opencv/releases/download/2025.4.10.0-3/bzlmodRio-opencv-2025.4.10.0-3.tar.gz", + sha256 = "ba3f4910ce9cc0e08abff732aeb5835b1bcfd864ca5296edeadcf2935f7e81b9", + url = "https://github.com/wpilibsuite/bzlmodRio-opencv/releases/download/2025.4.10.0-3.bcr1/bzlmodRio-opencv-2025.4.10.0-3.bcr1.tar.gz", ) load("@bzlmodrio-opencv//:maven_cpp_deps.bzl", "setup_legacy_bzlmodrio_opencv_cpp_dependencies")