From 8f10aed4ea1365a86e79d0c4c0ae7a5ce58ce8d0 Mon Sep 17 00:00:00 2001 From: PJ Reiniger Date: Sat, 7 Dec 2024 01:33:40 -0500 Subject: [PATCH] Update toolchains to reflect gradlerio naming --- .bazelrc | 23 ++- .bazelrc-cc | 13 +- .github/workflows/build.yml | 139 +++--------------- MODULE.bazel | 29 +++- WORKSPACE | 9 +- constraints/combined/BUILD.bazel | 5 +- .../BUILD.bazel | 10 +- constraints/is_raspibullseye32/BUILD.bazel | 30 ++++ maven_deps.bzl | 80 +++++++++- .../{raspi32 => raspibookworm32}/BUILD.bazel | 4 +- platforms/raspibullseye32/BUILD.bazel | 8 + tests/.bazelrc | 23 ++- tests/.bazelrc-cc | 13 +- tests/WORKSPACE | 9 +- tests/defines_helper.bzl | 1 - toolchains/load_toolchains.bzl | 16 +- 16 files changed, 244 insertions(+), 168 deletions(-) rename constraints/{is_raspi32 => is_raspibookworm32}/BUILD.bazel (69%) create mode 100644 constraints/is_raspibullseye32/BUILD.bazel rename platforms/{raspi32 => raspibookworm32}/BUILD.bazel (58%) create mode 100644 platforms/raspibullseye32/BUILD.bazel diff --git a/.bazelrc b/.bazelrc index 0c34149..224e3f7 100644 --- a/.bazelrc +++ b/.bazelrc @@ -25,18 +25,29 @@ build:bullseye64 --platform_suffix=bullseye64 # bookworm32 build:bookworm32 --platforms=@rules_bzlmodrio_toolchains//platforms/bookworm32 -build:bookworm32 --build_tag_filters=-no-bullseye +build:bookworm32 --build_tag_filters=-no-bookworm build:bookworm32 --platform_suffix=bookworm32 # bookworm64 build:bookworm64 --platforms=@rules_bzlmodrio_toolchains//platforms/bookworm64 -build:bookworm64 --build_tag_filters=-no-bullseye +build:bookworm64 --build_tag_filters=-no-bookworm build:bookworm64 --platform_suffix=bookworm64 -# rasppi -build:raspi32 --platforms=@rules_bzlmodrio_toolchains//platforms/raspi32 -build:raspi32 --build_tag_filters=-no-raspi -build:raspi32 --platform_suffix=raspi32 +# rasppi bullseye +build:raspibullseye32 --platforms=@rules_bzlmodrio_toolchains//platforms/raspibullseye32 +build:raspibullseye32 --build_tag_filters=-no-raspi +build:raspibullseye32 --platform_suffix=raspibullseye32 + +# rasppi bookworm +build:raspibookworm32 --platforms=@rules_bzlmodrio_toolchains//platforms/raspibookworm32 +build:raspibookworm32 --build_tag_filters=-no-raspi +build:raspibookworm32 --platform_suffix=raspibookworm32 + +# Alias toolchain names to what wpilibsuite uses for CI/Artifact naming +build:athena --config=roborio +build:systemcore --config=bookworm64 +build:linuxarm32 --config=raspibookworm32 +build:linuxarm64 --config=bookworm64 test --test_output=errors common --registry=https://raw.githubusercontent.com/pjreiniger/bazel-central-registry/bzlmodrio/ diff --git a/.bazelrc-cc b/.bazelrc-cc index cfbe70b..aafcf41 100644 --- a/.bazelrc-cc +++ b/.bazelrc-cc @@ -65,7 +65,12 @@ build:bookworm64 --incompatible_enable_cc_toolchain_resolution build:bookworm64 --copt=-std=c++20 build:bookworm64 --features=compiler_param_file -# rasppi -build:raspi32 --incompatible_enable_cc_toolchain_resolution -build:raspi32 --copt=-std=c++20 -build:raspi32 --features=compiler_param_file +# rasppi bullseye +build:raspibullseye32 --incompatible_enable_cc_toolchain_resolution +build:raspibullseye32 --copt=-std=c++20 +build:raspibullseye32 --features=compiler_param_file + +# rasppi bookworm +build:raspibookworm32 --incompatible_enable_cc_toolchain_resolution +build:raspibookworm32 --copt=-std=c++20 +build:raspibookworm32 --features=compiler_param_file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dcd11a4..e907f1f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -84,93 +84,20 @@ jobs: run: bazel ${{ matrix.bazel_options }} ${{ matrix.command }} //... -k ${{ matrix.config }} --verbose_failures --config=ci working-directory: tests - build_bullseye32: + build_linuxarm32: strategy: fail-fast: false matrix: include: - # Build non-bzlmod, bullseye32 - - { name: "windows - bullseye32", os: windows-2022, java_arch: "x64", command: "build", config: "--noenable_bzlmod --config=bullseye32", bazel_options: "--output_user_root=C:\\bazelroot", } - - { name: "ubuntu - bullseye32", os: ubuntu-22.04, java_arch: "x64", command: "build", config: "--noenable_bzlmod --config=bullseye32", bazel_options: "", } - - { name: "macos - bullseye32", os: macos-14, java_arch: "aarch64", command: "build", config: "--noenable_bzlmod --config=bullseye32", bazel_options: "", } - - # Build bzlmod, bullseye32 - - { name: "windows - bzlmod bullseye32", os: windows-2022, java_arch: "x64", command: "build", config: "--enable_bzlmod --config=bullseye32", bazel_options: "--output_user_root=C:\\bazelroot", } - - { name: "ubuntu - bzlmod bullseye32", os: ubuntu-22.04, java_arch: "x64", command: "build", config: "--enable_bzlmod --config=bullseye32", bazel_options: "", } - - { name: "macos - bzlmod bullseye32", os: macos-14, java_arch: "aarch64", command: "build", config: "--enable_bzlmod --config=bullseye32", bazel_options: "", } - name: "Build - ${{ matrix.name }}" - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: { python-version: '3.11' } - - uses: actions/setup-java@v4 - with: - distribution: 'zulu' - java-version: 17 - architecture: ${{ matrix.java_arch }} - - id: setup_build_buddy - uses: ./.github/actions/setup-build-buddy - with: - token: ${{ secrets.BUILDBUDDY_API_KEY }} - - name: Build and allow failure # TODO Sometimes symlinks don't get created correctly the first time around - run: bazel ${{ matrix.bazel_options }} ${{ matrix.command }} //... -k ${{ matrix.config }} --verbose_failures --config=ci || true - working-directory: tests - - name: Build - run: bazel ${{ matrix.bazel_options }} ${{ matrix.command }} //... -k ${{ matrix.config }} --verbose_failures --config=ci - working-directory: tests - - - build_bullseye64: - strategy: - fail-fast: false - matrix: - include: - # Build non-bzlmod, bullseye64: - - { name: "windows - bullseye64", os: windows-2022, java_arch: "x64", command: "build", config: "--noenable_bzlmod --config=bullseye64", bazel_options: "--output_user_root=C:\\bazelroot", } - - { name: "ubuntu - bullseye64", os: ubuntu-22.04, java_arch: "x64", command: "build", config: "--noenable_bzlmod --config=bullseye64", bazel_options: "", } - - { name: "macos - bullseye64", os: macos-14, java_arch: "aarch64", command: "build", config: "--noenable_bzlmod --config=bullseye64", bazel_options: "", } - - # Build bzlmod, bullseye64: - - { name: "windows - bzlmod bullseye64", os: windows-2022, java_arch: "x64", command: "build", config: "--enable_bzlmod --config=bullseye64", bazel_options: "--output_user_root=C:\\bazelroot", } - - { name: "ubuntu - bzlmod bullseye64", os: ubuntu-22.04, java_arch: "x64", command: "build", config: "--enable_bzlmod --config=bullseye64", bazel_options: "", } - - { name: "macos - bzlmod bullseye64", os: macos-14, java_arch: "aarch64", command: "build", config: "--enable_bzlmod --config=bullseye64", bazel_options: "", } - name: "Build - ${{ matrix.name }}" - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: { python-version: '3.11' } - - uses: actions/setup-java@v4 - with: - distribution: 'zulu' - java-version: 17 - architecture: ${{ matrix.java_arch }} - - id: setup_build_buddy - uses: ./.github/actions/setup-build-buddy - with: - token: ${{ secrets.BUILDBUDDY_API_KEY }} - - name: Build and allow failure # TODO Sometimes symlinks don't get created correctly the first time around - run: bazel ${{ matrix.bazel_options }} ${{ matrix.command }} //... -k ${{ matrix.config }} --verbose_failures --config=ci || true - working-directory: tests - - name: Build - run: bazel ${{ matrix.bazel_options }} ${{ matrix.command }} //... -k ${{ matrix.config }} --verbose_failures --config=ci - working-directory: tests - - build_bookworm32: - strategy: - fail-fast: false - matrix: - include: - # Build non-bzlmod, bookworm32 - - { name: "windows - bookworm32", os: windows-2022, java_arch: "x64", command: "build", config: "--noenable_bzlmod --config=bookworm32", bazel_options: "--output_user_root=C:\\bazelroot", } - - { name: "ubuntu - bookworm32", os: ubuntu-22.04, java_arch: "x64", command: "build", config: "--noenable_bzlmod --config=bookworm32", bazel_options: "", } - - { name: "macos - bookworm32", os: macos-14, java_arch: "aarch64", command: "build", config: "--noenable_bzlmod --config=bookworm32", bazel_options: "", } - - # Build bzlmod, bookworm32 - - { name: "windows - bzlmod bookworm32", os: windows-2022, java_arch: "x64", command: "build", config: "--enable_bzlmod --config=bookworm32", bazel_options: "--output_user_root=C:\\bazelroot", } - - { name: "ubuntu - bzlmod bookworm32", os: ubuntu-22.04, java_arch: "x64", command: "build", config: "--enable_bzlmod --config=bookworm32", bazel_options: "", } - - { name: "macos - bzlmod bookworm32", os: macos-14, java_arch: "aarch64", command: "build", config: "--enable_bzlmod --config=bookworm32", bazel_options: "", } + # Build non-bzlmod, linuxarm32 + - { name: "windows - linuxarm32", os: windows-2022, java_arch: "x64", command: "build", config: "--noenable_bzlmod --config=linuxarm32", bazel_options: "--output_user_root=C:\\bazelroot", } + - { name: "ubuntu - linuxarm32", os: ubuntu-22.04, java_arch: "x64", command: "build", config: "--noenable_bzlmod --config=linuxarm32", bazel_options: "", } + - { name: "macos - linuxarm32", os: macos-14, java_arch: "aarch64", command: "build", config: "--noenable_bzlmod --config=linuxarm32", bazel_options: "", } + + # Build bzlmod, linuxarm32 + # - { name: "windows - bzlmod linuxarm32", os: windows-2022, java_arch: "x64", command: "build", config: "--enable_bzlmod --config=linuxarm32", bazel_options: "--output_user_root=C:\\bazelroot", } + - { name: "ubuntu - bzlmod linuxarm32", os: ubuntu-22.04, java_arch: "x64", command: "build", config: "--enable_bzlmod --config=linuxarm32", bazel_options: "", } + - { name: "macos - bzlmod linuxarm32", os: macos-14, java_arch: "aarch64", command: "build", config: "--enable_bzlmod --config=linuxarm32", bazel_options: "", } name: "Build - ${{ matrix.name }}" runs-on: ${{ matrix.os }} steps: @@ -193,21 +120,20 @@ jobs: run: bazel ${{ matrix.bazel_options }} ${{ matrix.command }} //... -k ${{ matrix.config }} --verbose_failures --config=ci working-directory: tests - - build_bookworm64: + build_linuxarm64: strategy: fail-fast: false matrix: include: - # Build non-bzlmod, bookworm64: - - { name: "windows - bookworm64", os: windows-2022, java_arch: "x64", command: "build", config: "--noenable_bzlmod --config=bookworm64", bazel_options: "--output_user_root=C:\\bazelroot", } - - { name: "ubuntu - bookworm64", os: ubuntu-22.04, java_arch: "x64", command: "build", config: "--noenable_bzlmod --config=bookworm64", bazel_options: "", } - - { name: "macos - bookworm64", os: macos-14, java_arch: "aarch64", command: "build", config: "--noenable_bzlmod --config=bookworm64", bazel_options: "", } - - # Build bzlmod, bookworm64: - - { name: "windows - bzlmod bookworm64", os: windows-2022, java_arch: "x64", command: "build", config: "--enable_bzlmod --config=bookworm64", bazel_options: "--output_user_root=C:\\bazelroot", } - - { name: "ubuntu - bzlmod bookworm64", os: ubuntu-22.04, java_arch: "x64", command: "build", config: "--enable_bzlmod --config=bookworm64", bazel_options: "", } - - { name: "macos - bzlmod bookworm64", os: macos-14, java_arch: "aarch64", command: "build", config: "--enable_bzlmod --config=bookworm64", bazel_options: "", } + # Build non-bzlmod, linuxarm64 + - { name: "windows - linuxarm64", os: windows-2022, java_arch: "x64", command: "build", config: "--noenable_bzlmod --config=linuxarm64", bazel_options: "--output_user_root=C:\\bazelroot", } + - { name: "ubuntu - linuxarm64", os: ubuntu-22.04, java_arch: "x64", command: "build", config: "--noenable_bzlmod --config=linuxarm64", bazel_options: "", } + - { name: "macos - linuxarm64", os: macos-14, java_arch: "aarch64", command: "build", config: "--noenable_bzlmod --config=linuxarm64", bazel_options: "", } + + # Build bzlmod, linuxarm64 + - { name: "windows - bzlmod linuxarm64", os: windows-2022, java_arch: "x64", command: "build", config: "--enable_bzlmod --config=linuxarm64", bazel_options: "--output_user_root=C:\\bazelroot", } + - { name: "ubuntu - bzlmod linuxarm64", os: ubuntu-22.04, java_arch: "x64", command: "build", config: "--enable_bzlmod --config=linuxarm64", bazel_options: "", } + - { name: "macos - bzlmod linuxarm64", os: macos-14, java_arch: "aarch64", command: "build", config: "--enable_bzlmod --config=linuxarm64", bazel_options: "", } name: "Build - ${{ matrix.name }}" runs-on: ${{ matrix.os }} steps: @@ -228,27 +154,4 @@ jobs: working-directory: tests - name: Build run: bazel ${{ matrix.bazel_options }} ${{ matrix.command }} //... -k ${{ matrix.config }} --verbose_failures --config=ci - working-directory: tests - - - - build_raspi32: - strategy: - fail-fast: false - matrix: - include: - # Build non-bzlmod, raspi32: - - { name: "windows - raspi32", os: windows-2022, java_arch: "x64", command: "build", config: "--noenable_bzlmod --config=raspi32", bazel_options: "--output_user_root=C:\\bazelroot", } - - { name: "ubuntu - raspi32", os: ubuntu-22.04, java_arch: "x64", command: "build", config: "--noenable_bzlmod --config=raspi32", bazel_options: "", } - - { name: "macos - raspi32", os: macos-14, java_arch: "aarch64", command: "build", config: "--noenable_bzlmod --config=raspi32", bazel_options: "", } - - # Build bzlmod, raspi32: - - { name: "windows - bzlmod raspi32", os: windows-2022, java_arch: "x64", command: "build", config: "--enable_bzlmod --config=raspi32", bazel_options: "--output_user_root=C:\\bazelroot", } - - { name: "ubuntu - bzlmod raspi32", os: ubuntu-22.04, java_arch: "x64", command: "build", config: "--enable_bzlmod --config=raspi32", bazel_options: "", } - - { name: "macos - bzlmod raspi32", os: macos-14, java_arch: "aarch64", command: "build", config: "--enable_bzlmod --config=raspi32", bazel_options: "", } - name: "Build - ${{ matrix.name }}" - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v4 - - run: bazel ${{ matrix.bazel_options }} ${{ matrix.command }} //... -k ${{ matrix.config }} --verbose_failures --config=ci - working-directory: tests + working-directory: tests \ No newline at end of file diff --git a/MODULE.bazel b/MODULE.bazel index e39d704..0f5662f 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -1,6 +1,6 @@ module( name = "rules_bzlmodrio_toolchains", - version = "2025-1", + version = "2025-1.bcr1", compatibility_level = 2025, ) @@ -13,26 +13,36 @@ use_repo( deps, "bazelrio_bookworm_32_toolchain_linux", "bazelrio_bookworm_32_toolchain_macos", + "bazelrio_bookworm_32_toolchain_macosarm", "bazelrio_bookworm_32_toolchain_windows", "bazelrio_bookworm_64_toolchain_linux", "bazelrio_bookworm_64_toolchain_macos", + "bazelrio_bookworm_64_toolchain_macosarm", "bazelrio_bookworm_64_toolchain_windows", "bazelrio_bullseye_32_toolchain_linux", "bazelrio_bullseye_32_toolchain_macos", + "bazelrio_bullseye_32_toolchain_macosarm", "bazelrio_bullseye_32_toolchain_windows", "bazelrio_bullseye_64_toolchain_linux", "bazelrio_bullseye_64_toolchain_macos", + "bazelrio_bullseye_64_toolchain_macosarm", "bazelrio_bullseye_64_toolchain_windows", - "bazelrio_raspi_32_toolchain_linux", - "bazelrio_raspi_32_toolchain_macos", - "bazelrio_raspi_32_toolchain_windows", + "bazelrio_raspi_bookworm_32_toolchain_linux", + "bazelrio_raspi_bookworm_32_toolchain_macos", + "bazelrio_raspi_bookworm_32_toolchain_macosarm", + "bazelrio_raspi_bookworm_32_toolchain_windows", + "bazelrio_raspi_bullseye_32_toolchain_linux", + "bazelrio_raspi_bullseye_32_toolchain_macos", + "bazelrio_raspi_bullseye_32_toolchain_macosarm", + "bazelrio_raspi_bullseye_32_toolchain_windows", "bazelrio_roborio_toolchain_linux", "bazelrio_roborio_toolchain_macos", + "bazelrio_roborio_toolchain_macosarm", "bazelrio_roborio_toolchain_windows", ) sh_configure = use_extension("@rules_bzlmodrio_toolchains//:extensions.bzl", "sh_configure") -use_repo(sh_configure, "local_bookworm_32", "local_bookworm_64", "local_bullseye_32", "local_bullseye_64", "local_raspi_32", "local_roborio") +use_repo(sh_configure, "local_bookworm_32", "local_bookworm_64", "local_bullseye_32", "local_bullseye_64", "local_raspi_bookworm_32", "local_raspi_bullseye_32", "local_roborio") register_toolchains( "@local_bookworm_32//:macos", @@ -47,9 +57,12 @@ register_toolchains( "@local_bullseye_64//:macos", "@local_bullseye_64//:linux", "@local_bullseye_64//:windows", - "@local_raspi_32//:macos", - "@local_raspi_32//:linux", - "@local_raspi_32//:windows", + "@local_raspi_bookworm_32//:macos", + "@local_raspi_bookworm_32//:linux", + "@local_raspi_bookworm_32//:windows", + "@local_raspi_bullseye_32//:macos", + "@local_raspi_bullseye_32//:linux", + "@local_raspi_bullseye_32//:windows", "@local_roborio//:macos", "@local_roborio//:linux", "@local_roborio//:windows", diff --git a/WORKSPACE b/WORKSPACE index f9dc0fa..776c61a 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -21,9 +21,12 @@ register_toolchains( "@local_bullseye_64//:macos", "@local_bullseye_64//:linux", "@local_bullseye_64//:windows", - "@local_raspi_32//:macos", - "@local_raspi_32//:linux", - "@local_raspi_32//:windows", + "@local_raspi_bookworm_32//:macos", + "@local_raspi_bookworm_32//:linux", + "@local_raspi_bookworm_32//:windows", + "@local_raspi_bullseye_32//:macos", + "@local_raspi_bullseye_32//:linux", + "@local_raspi_bullseye_32//:windows", "@local_roborio//:macos", "@local_roborio//:linux", "@local_roborio//:windows", diff --git a/constraints/combined/BUILD.bazel b/constraints/combined/BUILD.bazel index ca7b932..a2366c2 100644 --- a/constraints/combined/BUILD.bazel +++ b/constraints/combined/BUILD.bazel @@ -6,7 +6,10 @@ selects.config_setting_group( "//constraints/is_roborio:roborio", "//constraints/is_bullseye32:bullseye32", "//constraints/is_bullseye64:bullseye64", - "//constraints/is_raspi32:raspi32", + "//constraints/is_bookworm32:bookworm32", + "//constraints/is_bookworm64:bookworm64", + "//constraints/is_raspibullseye32:raspibullseye32", + "//constraints/is_raspibookworm32:raspibookworm32", ], ) diff --git a/constraints/is_raspi32/BUILD.bazel b/constraints/is_raspibookworm32/BUILD.bazel similarity index 69% rename from constraints/is_raspi32/BUILD.bazel rename to constraints/is_raspibookworm32/BUILD.bazel index 9e1b92f..bb8420c 100644 --- a/constraints/is_raspi32/BUILD.bazel +++ b/constraints/is_raspibookworm32/BUILD.bazel @@ -1,27 +1,27 @@ constraint_setting( - name = "is_raspi32", + name = "is_raspibookworm32", default_constraint_value = ":false", ) constraint_value( name = "true", - constraint_setting = ":is_raspi32", + constraint_setting = ":is_raspibookworm32", visibility = ["//visibility:public"], ) constraint_value( name = "false", - constraint_setting = ":is_raspi32", + constraint_setting = ":is_raspibookworm32", ) config_setting( - name = "raspi32", + name = "raspibookworm32", constraint_values = [":true"], visibility = ["//visibility:public"], ) config_setting( - name = "raspi32_debug", + name = "raspibookworm32_debug", constraint_values = [":true"], values = { "compilation_mode": "dbg", diff --git a/constraints/is_raspibullseye32/BUILD.bazel b/constraints/is_raspibullseye32/BUILD.bazel new file mode 100644 index 0000000..382bcc2 --- /dev/null +++ b/constraints/is_raspibullseye32/BUILD.bazel @@ -0,0 +1,30 @@ +constraint_setting( + name = "is_raspibullseye32", + default_constraint_value = ":false", +) + +constraint_value( + name = "true", + constraint_setting = ":is_raspibullseye32", + visibility = ["//visibility:public"], +) + +constraint_value( + name = "false", + constraint_setting = ":is_raspibullseye32", +) + +config_setting( + name = "raspibullseye32", + constraint_values = [":true"], + visibility = ["//visibility:public"], +) + +config_setting( + name = "raspibullseye32_debug", + constraint_values = [":true"], + values = { + "compilation_mode": "dbg", + }, + visibility = ["//visibility:public"], +) diff --git a/maven_deps.bzl b/maven_deps.bzl index 9f8e687..33c9724 100644 --- a/maven_deps.bzl +++ b/maven_deps.bzl @@ -10,6 +10,13 @@ filegroup_all = """filegroup( def __setup_toolchains_dependencies(mctx): # bookworm-32 + maybe( + http_archive, + "bazelrio_bookworm_32_toolchain_macosarm", + url = "https://github.com/wpilibsuite/opensdk/releases/download/v2025-1/armhf-bookworm-2025-arm64-apple-darwin-Toolchain-12.2.0.tgz", + sha256 = "dddddbd08ca3771581f9a77311191d60371b0e5dc4ba166450198f3a59c43d13", + build_file_content = filegroup_all, + ) maybe( http_archive, "bazelrio_bookworm_32_toolchain_macos", @@ -33,6 +40,13 @@ def __setup_toolchains_dependencies(mctx): ) # bookworm-64 + maybe( + http_archive, + "bazelrio_bookworm_64_toolchain_macosarm", + url = "https://github.com/wpilibsuite/opensdk/releases/download/v2025-1/arm64-bookworm-2025-arm64-apple-darwin-Toolchain-12.2.0.tgz", + sha256 = "e29fa2433cee667d75ff106543d88d3d4154e2f450c79d86d316d5b8015d11e4", + build_file_content = filegroup_all, + ) maybe( http_archive, "bazelrio_bookworm_64_toolchain_macos", @@ -56,6 +70,13 @@ def __setup_toolchains_dependencies(mctx): ) # bullseye-32 + maybe( + http_archive, + "bazelrio_bullseye_32_toolchain_macosarm", + url = "https://github.com/wpilibsuite/opensdk/releases/download/v2025-1/armhf-bullseye-2025-arm64-apple-darwin-Toolchain-10.2.0.tgz", + sha256 = "abf3216fd08968bf3bef67c3cbad720c9dc1385672197a2b2d5f2009a7fd995e", + build_file_content = filegroup_all, + ) maybe( http_archive, "bazelrio_bullseye_32_toolchain_macos", @@ -79,6 +100,13 @@ def __setup_toolchains_dependencies(mctx): ) # bullseye-64 + maybe( + http_archive, + "bazelrio_bullseye_64_toolchain_macosarm", + url = "https://github.com/wpilibsuite/opensdk/releases/download/v2025-1/arm64-bullseye-2025-arm64-apple-darwin-Toolchain-10.2.0.tgz", + sha256 = "0f67594b4ea984b6296e838e0f1e8e6efde58916f98b4a650a8b3c391ce18e04", + build_file_content = filegroup_all, + ) maybe( http_archive, "bazelrio_bullseye_64_toolchain_macos", @@ -101,30 +129,74 @@ def __setup_toolchains_dependencies(mctx): build_file_content = filegroup_all, ) - # raspi-32 + # raspi-bookworm-32 maybe( http_archive, - "bazelrio_raspi_32_toolchain_macos", + "bazelrio_raspi_bookworm_32_toolchain_macosarm", + url = "https://github.com/wpilibsuite/opensdk/releases/download/v2025-1/armhf-raspi-bookworm-2025-arm64-apple-darwin-Toolchain-12.2.0.tgz", + sha256 = "ec754b7d64d3e989dd6dd7a91abab7b4ca9abc5c75f252ab37ffc585ac39a287", + build_file_content = filegroup_all, + ) + maybe( + http_archive, + "bazelrio_raspi_bookworm_32_toolchain_macos", + url = "https://github.com/wpilibsuite/opensdk/releases/download/v2025-1/armhf-raspi-bookworm-2025-x86_64-apple-darwin-Toolchain-12.2.0.tgz", + sha256 = "9e0db21b655956fea0e9169a9d7daf86ccde1c78bdf42d633305ab8efb944c23", + build_file_content = filegroup_all, + ) + maybe( + http_archive, + "bazelrio_raspi_bookworm_32_toolchain_linux", + url = "https://github.com/wpilibsuite/opensdk/releases/download/v2025-1/armhf-raspi-bookworm-2025-x86_64-linux-gnu-Toolchain-12.2.0.tgz", + sha256 = "e3cf3a726268aafa55d79af588a1d02392c073a033b8c3b2a0c6ccd99e18a184", + build_file_content = filegroup_all, + ) + maybe( + http_archive, + "bazelrio_raspi_bookworm_32_toolchain_windows", + url = "https://github.com/wpilibsuite/opensdk/releases/download/v2025-1/armhf-raspi-bookworm-2025-x86_64-w64-mingw32-Toolchain-12.2.0.zip", + sha256 = "dead6a0066885c51b64871d8cd8116919a0cf4040960af1bce0e26290ee4f034", + build_file_content = filegroup_all, + ) + + # raspi-bullseye-32 + maybe( + http_archive, + "bazelrio_raspi_bullseye_32_toolchain_macosarm", + url = "https://github.com/wpilibsuite/opensdk/releases/download/v2025-1/armhf-raspi-bullseye-2025-arm64-apple-darwin-Toolchain-10.2.0.tgz", + sha256 = "3f30b54ef98aba939058680ba7906b59da758552ee183595dc006613744e0038", + build_file_content = filegroup_all, + ) + maybe( + http_archive, + "bazelrio_raspi_bullseye_32_toolchain_macos", url = "https://github.com/wpilibsuite/opensdk/releases/download/v2025-1/armhf-raspi-bullseye-2025-x86_64-apple-darwin-Toolchain-10.2.0.tgz", sha256 = "e205a4824a0d6704e968184e52525c5fa200b3e2278177a80d970b2077896f74", build_file_content = filegroup_all, ) maybe( http_archive, - "bazelrio_raspi_32_toolchain_linux", + "bazelrio_raspi_bullseye_32_toolchain_linux", url = "https://github.com/wpilibsuite/opensdk/releases/download/v2025-1/armhf-raspi-bullseye-2025-x86_64-linux-gnu-Toolchain-10.2.0.tgz", sha256 = "b53465a8d36de937a0f88299f8ab3a97db5af3cdf4f7e52473bf294c5c1da3f6", build_file_content = filegroup_all, ) maybe( http_archive, - "bazelrio_raspi_32_toolchain_windows", + "bazelrio_raspi_bullseye_32_toolchain_windows", url = "https://github.com/wpilibsuite/opensdk/releases/download/v2025-1/armhf-raspi-bullseye-2025-x86_64-w64-mingw32-Toolchain-10.2.0.zip", sha256 = "4a891d7a5de1fc3cd03f60b4340f586ad2750fef8baab35c408e23fa539a0213", build_file_content = filegroup_all, ) # roborio + maybe( + http_archive, + "bazelrio_roborio_toolchain_macosarm", + url = "https://github.com/wpilibsuite/opensdk/releases/download/v2025-1/cortexa9_vfpv3-roborio-academic-2025-arm64-apple-darwin-Toolchain-12.1.0.tgz", + sha256 = "2fb949bf683ac2ecf3874767369c9f6a013941cd9e702f08bd5e4a248e9b82dd", + build_file_content = filegroup_all, + ) maybe( http_archive, "bazelrio_roborio_toolchain_macos", diff --git a/platforms/raspi32/BUILD.bazel b/platforms/raspibookworm32/BUILD.bazel similarity index 58% rename from platforms/raspi32/BUILD.bazel rename to platforms/raspibookworm32/BUILD.bazel index 280d03a..7599c08 100644 --- a/platforms/raspi32/BUILD.bazel +++ b/platforms/raspibookworm32/BUILD.bazel @@ -1,8 +1,8 @@ platform( - name = "raspi32", + name = "raspibookworm32", constraint_values = [ "@platforms//os:linux", "@platforms//cpu:armv7", - "//constraints/is_raspi32:true", + "//constraints/is_raspibookworm32:true", ], ) diff --git a/platforms/raspibullseye32/BUILD.bazel b/platforms/raspibullseye32/BUILD.bazel new file mode 100644 index 0000000..130080c --- /dev/null +++ b/platforms/raspibullseye32/BUILD.bazel @@ -0,0 +1,8 @@ +platform( + name = "raspibullseye32", + constraint_values = [ + "@platforms//os:linux", + "@platforms//cpu:armv7", + "//constraints/is_raspibullseye32:true", + ], +) diff --git a/tests/.bazelrc b/tests/.bazelrc index 0c34149..224e3f7 100644 --- a/tests/.bazelrc +++ b/tests/.bazelrc @@ -25,18 +25,29 @@ build:bullseye64 --platform_suffix=bullseye64 # bookworm32 build:bookworm32 --platforms=@rules_bzlmodrio_toolchains//platforms/bookworm32 -build:bookworm32 --build_tag_filters=-no-bullseye +build:bookworm32 --build_tag_filters=-no-bookworm build:bookworm32 --platform_suffix=bookworm32 # bookworm64 build:bookworm64 --platforms=@rules_bzlmodrio_toolchains//platforms/bookworm64 -build:bookworm64 --build_tag_filters=-no-bullseye +build:bookworm64 --build_tag_filters=-no-bookworm build:bookworm64 --platform_suffix=bookworm64 -# rasppi -build:raspi32 --platforms=@rules_bzlmodrio_toolchains//platforms/raspi32 -build:raspi32 --build_tag_filters=-no-raspi -build:raspi32 --platform_suffix=raspi32 +# rasppi bullseye +build:raspibullseye32 --platforms=@rules_bzlmodrio_toolchains//platforms/raspibullseye32 +build:raspibullseye32 --build_tag_filters=-no-raspi +build:raspibullseye32 --platform_suffix=raspibullseye32 + +# rasppi bookworm +build:raspibookworm32 --platforms=@rules_bzlmodrio_toolchains//platforms/raspibookworm32 +build:raspibookworm32 --build_tag_filters=-no-raspi +build:raspibookworm32 --platform_suffix=raspibookworm32 + +# Alias toolchain names to what wpilibsuite uses for CI/Artifact naming +build:athena --config=roborio +build:systemcore --config=bookworm64 +build:linuxarm32 --config=raspibookworm32 +build:linuxarm64 --config=bookworm64 test --test_output=errors common --registry=https://raw.githubusercontent.com/pjreiniger/bazel-central-registry/bzlmodrio/ diff --git a/tests/.bazelrc-cc b/tests/.bazelrc-cc index cfbe70b..aafcf41 100644 --- a/tests/.bazelrc-cc +++ b/tests/.bazelrc-cc @@ -65,7 +65,12 @@ build:bookworm64 --incompatible_enable_cc_toolchain_resolution build:bookworm64 --copt=-std=c++20 build:bookworm64 --features=compiler_param_file -# rasppi -build:raspi32 --incompatible_enable_cc_toolchain_resolution -build:raspi32 --copt=-std=c++20 -build:raspi32 --features=compiler_param_file +# rasppi bullseye +build:raspibullseye32 --incompatible_enable_cc_toolchain_resolution +build:raspibullseye32 --copt=-std=c++20 +build:raspibullseye32 --features=compiler_param_file + +# rasppi bookworm +build:raspibookworm32 --incompatible_enable_cc_toolchain_resolution +build:raspibookworm32 --copt=-std=c++20 +build:raspibookworm32 --features=compiler_param_file diff --git a/tests/WORKSPACE b/tests/WORKSPACE index 14aba75..6dd5ae3 100644 --- a/tests/WORKSPACE +++ b/tests/WORKSPACE @@ -34,9 +34,12 @@ register_toolchains( "@local_bullseye_64//:macos", "@local_bullseye_64//:linux", "@local_bullseye_64//:windows", - "@local_raspi_32//:macos", - "@local_raspi_32//:linux", - "@local_raspi_32//:windows", + "@local_raspi_bookworm_32//:macos", + "@local_raspi_bookworm_32//:linux", + "@local_raspi_bookworm_32//:windows", + "@local_raspi_bullseye_32//:macos", + "@local_raspi_bullseye_32//:linux", + "@local_raspi_bullseye_32//:windows", "@local_roborio//:macos", "@local_roborio//:linux", "@local_roborio//:windows", diff --git a/tests/defines_helper.bzl b/tests/defines_helper.bzl index a5b2714..d600bd5 100644 --- a/tests/defines_helper.bzl +++ b/tests/defines_helper.bzl @@ -11,7 +11,6 @@ def defines_helper(): output = { "@rules_bzlmodrio_toolchains//constraints/is_bullseye32:bullseye32": __helper(is_roborio = False, is_bullseye = True, is_raspi = False), "@rules_bzlmodrio_toolchains//constraints/is_bullseye64:bullseye64": __helper(is_roborio = False, is_bullseye = True, is_raspi = False), - "@rules_bzlmodrio_toolchains//constraints/is_raspi32:raspi32": __helper(is_roborio = False, is_bullseye = False, is_raspi = True), "@rules_bzlmodrio_toolchains//constraints/is_roborio:roborio": __helper(is_roborio = True, is_bullseye = False, is_raspi = False), "//conditions:default": __helper(is_roborio = False, is_bullseye = False, is_raspi = False), } diff --git a/toolchains/load_toolchains.bzl b/toolchains/load_toolchains.bzl index 04b5edc..cb57347 100644 --- a/toolchains/load_toolchains.bzl +++ b/toolchains/load_toolchains.bzl @@ -42,14 +42,24 @@ def load_toolchains(): repo_shortname = "bullseye_64", ) configure_cross_compiler( - name = "local_raspi_32", - compiler = "raspi-32", + name = "local_raspi_bookworm_32", + compiler = "raspi-bookworm-32", + bin_subfolder = "raspi-bookworm/bin", + bin_prefix = "armv6-bookworm-linux-gnueabihf-", + sysroot_subfolder = "raspi-bookworm/arm-linux-gnueabihf/sysroot", + cxx_version = "12", + sysroot_include_folder = "arm-linux-gnueabihf", + repo_shortname = "raspi_bookworm_32", + ) + configure_cross_compiler( + name = "local_raspi_bullseye_32", + compiler = "raspi-bullseye-32", bin_subfolder = "raspi-bullseye/bin", bin_prefix = "armv6-bullseye-linux-gnueabihf-", sysroot_subfolder = "raspi-bullseye/arm-linux-gnueabihf/sysroot", cxx_version = "10", sysroot_include_folder = "arm-linux-gnueabihf", - repo_shortname = "raspi_32", + repo_shortname = "raspi_bullseye_32", ) configure_cross_compiler( name = "local_roborio",