Skip to content

Commit

Permalink
Update toolchains
Browse files Browse the repository at this point in the history
  • Loading branch information
pjreiniger committed Jan 1, 2025
1 parent 5b3f8f0 commit 39c30a6
Show file tree
Hide file tree
Showing 15 changed files with 238 additions and 162 deletions.
19 changes: 15 additions & 4 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,21 @@ build:bookworm64 --platforms=@rules_bzlmodrio_toolchains//platforms/bookworm64
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/
13 changes: 9 additions & 4 deletions .bazelrc-cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
138 changes: 21 additions & 117 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,57 +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: "", }
# 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:
Expand All @@ -157,20 +120,20 @@ jobs:
run: bazel ${{ matrix.bazel_options }} ${{ matrix.command }} //... -k ${{ matrix.config }} --verbose_failures --config=ci
working-directory: tests

build_bookworm32:
build_linuxarm64:
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, 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:
Expand All @@ -191,63 +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_bookworm64:
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: "", }
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_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
29 changes: 21 additions & 8 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module(
name = "rules_bzlmodrio_toolchains",
version = "2025-1",
version = "2025-1.bcr1",
compatibility_level = 2025,
)

Expand All @@ -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",
Expand All @@ -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",
Expand Down
9 changes: 6 additions & 3 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion constraints/combined/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ selects.config_setting_group(
"//constraints/is_bullseye64:bullseye64",
"//constraints/is_bookworm32:bookworm32",
"//constraints/is_bookworm64:bookworm64",
"//constraints/is_raspi32:raspi32",
"//constraints/is_raspibullseye32:raspibullseye32",
"//constraints/is_raspibookworm32:raspibookworm32",
],
)

Expand Down
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
30 changes: 30 additions & 0 deletions constraints/is_raspibullseye32/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -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"],
)
Loading

0 comments on commit 39c30a6

Please sign in to comment.