Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to 2025 toolchains #19

Merged
merged 2 commits into from
Dec 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ build:bullseye64 --platforms=@rules_bzlmodrio_toolchains//platforms/bullseye64
build:bullseye64 --build_tag_filters=-no-bullseye
build:bullseye64 --platform_suffix=bullseye64

# bookworm32
build:bookworm32 --platforms=@rules_bzlmodrio_toolchains//platforms/bookworm32
build:bookworm32 --build_tag_filters=-no-bullseye
build:bookworm32 --platform_suffix=bookworm32

# bookworm64
build:bookworm64 --platforms=@rules_bzlmodrio_toolchains//platforms/bookworm64
build:bookworm64 --build_tag_filters=-no-bullseye
build:bookworm64 --platform_suffix=bookworm64

# rasppi
build:raspi32 --platforms=@rules_bzlmodrio_toolchains//platforms/raspi32
build:raspi32 --build_tag_filters=-no-raspi
Expand Down
10 changes: 10 additions & 0 deletions .bazelrc-cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,16 @@ build:bullseye64 --incompatible_enable_cc_toolchain_resolution
build:bullseye64 --copt=-std=c++20
build:bullseye64 --features=compiler_param_file

# bookworm32
build:bookworm32 --incompatible_enable_cc_toolchain_resolution
build:bookworm32 --copt=-std=c++20
build:bookworm32 --features=compiler_param_file

# bookworm64
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
Expand Down
5 changes: 5 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
Language: Cpp
BasedOnStyle: Google
FixNamespaceComments: true
...
83 changes: 78 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,12 @@ jobs:
fail-fast: false
matrix:
include:
# Build non-bzlmod, bullseye32:
# 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=bullseye32", bazel_options: "", }
- { name: "macos - bullseye64", os: macos-14, java_arch: "aarch64", command: "build", config: "--noenable_bzlmod --config=bullseye64", bazel_options: "", }

# Build bzlmod, bullseye32:
# 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: "", }
Expand All @@ -157,19 +157,92 @@ jobs:
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: "", }
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_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, bullseye32:
# 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, bullseye32:
# 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: "", }
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish Module
on:
workflow_dispatch:
push:
tags:
- '*'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
publish_module:
name: "Publish Module"
runs-on: ubuntu-22.04
steps:
# Checkout repository
- uses: actions/checkout@v4
with:
path: rules/rules_bzlmodrio_toolchains

- name: Create Archive
run: git archive HEAD --format=tar.gz --output="rules_bzlmodrio_toolchains-${GITHUB_REF_NAME}.tar.gz"
working-directory: rules/rules_bzlmodrio_toolchains

- name: Setup archive name
run: echo "ARCHIVE_NAME=rules/rules_bzlmodrio_toolchains/rules_bzlmodrio_toolchains-${GITHUB_REF_NAME}.tar.gz" >> "$GITHUB_ENV"

- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: "${{ env.ARCHIVE_NAME }}"
18 changes: 15 additions & 3 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module(
name = "rules_bzlmodrio_toolchains",
version = "2024-1.bcr1",
compatibility_level = 2024,
version = "2025-1",
compatibility_level = 2025,
)

bazel_dep(name = "platforms", version = "0.0.9")
Expand All @@ -11,6 +11,12 @@ bazel_dep(name = "bazel_skylib", version = "1.6.1")
deps = use_extension("//:maven_deps.bzl", "deps")
use_repo(
deps,
"bazelrio_bookworm_32_toolchain_linux",
"bazelrio_bookworm_32_toolchain_macos",
"bazelrio_bookworm_32_toolchain_windows",
"bazelrio_bookworm_64_toolchain_linux",
"bazelrio_bookworm_64_toolchain_macos",
"bazelrio_bookworm_64_toolchain_windows",
"bazelrio_bullseye_32_toolchain_linux",
"bazelrio_bullseye_32_toolchain_macos",
"bazelrio_bullseye_32_toolchain_windows",
Expand All @@ -26,9 +32,15 @@ use_repo(
)

sh_configure = use_extension("@rules_bzlmodrio_toolchains//:extensions.bzl", "sh_configure")
use_repo(sh_configure, "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_32", "local_roborio")

register_toolchains(
"@local_bookworm_32//:macos",
"@local_bookworm_32//:linux",
"@local_bookworm_32//:windows",
"@local_bookworm_64//:macos",
"@local_bookworm_64//:linux",
"@local_bookworm_64//:windows",
"@local_bullseye_32//:macos",
"@local_bullseye_32//:linux",
"@local_bullseye_32//:windows",
Expand Down
8 changes: 4 additions & 4 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ load("@rules_bzlmodrio_toolchains//toolchains:load_toolchains.bzl", "load_toolch
load_toolchains()

register_toolchains(
"@local_bookworm_32//:macos",
"@local_bookworm_32//:linux",
"@local_bookworm_32//:windows",
"@local_bookworm_64//:macos",
"@local_bookworm_64//:linux",
"@local_bookworm_64//:windows",
"@local_bullseye_32//:macos",
"@local_bullseye_32//:linux",
"@local_bullseye_32//:windows",
Expand Down
30 changes: 30 additions & 0 deletions constraints/is_bookworm32/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
constraint_setting(
name = "is_bookworm32",
default_constraint_value = ":false",
)

constraint_value(
name = "true",
constraint_setting = ":is_bookworm32",
visibility = ["//visibility:public"],
)

constraint_value(
name = "false",
constraint_setting = ":is_bookworm32",
)

config_setting(
name = "bookworm32",
constraint_values = [":true"],
visibility = ["//visibility:public"],
)

config_setting(
name = "bookworm32_debug",
constraint_values = [":true"],
values = {
"compilation_mode": "dbg",
},
visibility = ["//visibility:public"],
)
30 changes: 30 additions & 0 deletions constraints/is_bookworm64/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
constraint_setting(
name = "is_bookworm64",
default_constraint_value = ":false",
)

constraint_value(
name = "true",
constraint_setting = ":is_bookworm64",
visibility = ["//visibility:public"],
)

constraint_value(
name = "false",
constraint_setting = ":is_bookworm64",
)

config_setting(
name = "bookworm64",
constraint_values = [":true"],
visibility = ["//visibility:public"],
)

config_setting(
name = "bookworm64_debug",
constraint_values = [":true"],
values = {
"compilation_mode": "dbg",
},
visibility = ["//visibility:public"],
)
Loading