Skip to content

Commit

Permalink
Update versions, add more aliases (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
pjreiniger authored Sep 18, 2024
1 parent c4a8fbc commit a61475e
Show file tree
Hide file tree
Showing 20 changed files with 161 additions and 26 deletions.
2 changes: 2 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
try-import user.bazelrc
try-import .buildbuddy-auth.rc

import .bazelrc-cc
import .bazelrc-java
import .bazelrc-buildbuddy
Expand Down
11 changes: 10 additions & 1 deletion .bazelrc-buildbuddy
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
build:remote --bes_results_url=https://app.buildbuddy.io/invocation/
build:remote --bes_backend=grpcs://remote.buildbuddy.io
build:remote --remote_cache=grpcs://remote.buildbuddy.io
build:remote --remote_download_toplevel # Helps remove network bottleneck if caching is enabled
build:remote --remote_timeout=3600

# Additional suggestions from buildbuddy for speed
build:remote --experimental_remote_cache_compression
build:remote --experimental_remote_cache_compression_threshold=100
build:remote --noslim_profile
build:remote --experimental_profile_include_target_label
build:remote --experimental_profile_include_primary_output
build:remote --nolegacy_important_outputs

build --experimental_inmemory_jdeps_files
build --experimental_inmemory_dotd_files

build:ci --config=remote
build:ci --build_metadata=ROLE=CI
build:ci --remote_download_minimal
2 changes: 2 additions & 0 deletions .bazelrc-cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ build:windows --copt=/wd5105
build:windows --cxxopt=/wd4146
build:windows --cxxopt=/wd4267
build:windows --cxxopt=/wd4244
build:windows --cxxopt=/utf-8

# Windows Arm
build:windows_arm --copt=/W3
Expand All @@ -17,6 +18,7 @@ build:windows_arm --copt=/wd5105
build:windows_arm --cxxopt=/wd4146
build:windows_arm --cxxopt=/wd4267
build:windows_arm --cxxopt=/wd4244
build:windows_arm --cxxopt=/utf-8
build:windows_arm --cpu=arm64_windows

# Linux
Expand Down
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.2.0
7.3.1
36 changes: 36 additions & 0 deletions .github/actions/setup-build-buddy/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: 'Setup BuildBuddy acache'
description: 'Sets up the build buddy cache to be readonly / writing based on the presence of environment variables'

inputs:
token:
description: 'Build Buddy API token'
readonly_token:
description: 'Build Buddy API readonly token'
required: true

runs:
using: "composite"
steps:
- name: Setup without key
env:
API_KEY: ${{ inputs.token }}
READONLY_KEY: ${{ inputs.readonly_token }}
if: ${{ env.API_KEY == '' }}
shell: bash
run: |
echo "No API key secret detected, will setup readonly cache"
echo "build:ci --noremote_upload_local_results" > .buildbuddy-auth.rc
echo "build:ci --remote_header=x-buildbuddy-api-key=${{ env.READONLY_KEY }}" >> .buildbuddy-auth.rc
echo "build:ci --noremote_upload_local_results" > tests/.buildbuddy-auth.rc
echo "build:ci --remote_header=x-buildbuddy-api-key=${{ env.READONLY_KEY }}" >> tests/.buildbuddy-auth.rc
- name: Set with key
env:
API_KEY: ${{ inputs.token }}
if: ${{ env.API_KEY != '' }}
shell: bash
run: |
echo "API Key detected!"
echo "build:ci --remote_header=x-buildbuddy-api-key=${{ env.API_KEY }}" > .buildbuddy-auth.rc
echo "build:ci --remote_header=x-buildbuddy-api-key=${{ env.API_KEY }}" > tests/.buildbuddy-auth.rc
38 changes: 29 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,18 @@ jobs:
distribution: 'zulu'
java-version: 17
architecture: ${{ matrix.java_arch }}
- run: bazel ${{ matrix.bazel_options }} build -k ${{ matrix.config }} --config=remote @bzlmodrio-ni//...
- id: setup_build_buddy
uses: ./.github/actions/setup-build-buddy
with:
token: ${{ secrets.BUILDBUDDY_API_KEY }}
readonly_token: ${{ secrets.BUILDBUDDY_READONLY }}
- run: bazel ${{ matrix.bazel_options }} build -k ${{ matrix.config }} --config=ci @bzlmodrio-ni//...
working-directory: tests
- name: Build and allow failure # TODO Sometimes symlinks don't get created correctly the first time around
run: bazel ${{ matrix.bazel_options }} build -k ${{ matrix.config }} --verbose_failures --config=remote //... || true
run: bazel ${{ matrix.bazel_options }} build -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=remote
run: bazel ${{ matrix.bazel_options }} ${{ matrix.command }} //... -k ${{ matrix.config }} --verbose_failures --config=ci
working-directory: tests


Expand Down Expand Up @@ -69,11 +74,16 @@ jobs:
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 }}
readonly_token: ${{ secrets.BUILDBUDDY_READONLY }}
- 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=remote || true
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=remote
run: bazel ${{ matrix.bazel_options }} ${{ matrix.command }} //... -k ${{ matrix.config }} --verbose_failures --config=ci
working-directory: tests

build_bullseye32:
Expand Down Expand Up @@ -101,11 +111,16 @@ jobs:
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 }}
readonly_token: ${{ secrets.BUILDBUDDY_READONLY }}
- 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=remote || true
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=remote
run: bazel ${{ matrix.bazel_options }} ${{ matrix.command }} //... -k ${{ matrix.config }} --verbose_failures --config=ci
working-directory: tests


Expand Down Expand Up @@ -134,9 +149,14 @@ jobs:
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 }}
readonly_token: ${{ secrets.BUILDBUDDY_READONLY }}
- 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=remote || true
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=remote
run: bazel ${{ matrix.bazel_options }} ${{ matrix.command }} //... -k ${{ matrix.config }} --verbose_failures --config=ci
working-directory: tests
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
run: git diff HEAD > buildifier-fixes.patch
if: ${{ failure() }}

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: buildifier fixes
path: buildifier-fixes.patch
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
bazel-*
*.pyc
user.bazelrc
.buildbuddy-auth.rc
.DS_Store
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module(

bazel_dep(name = "platforms", version = "0.0.9")
bazel_dep(name = "rules_cc", version = "0.0.9")
bazel_dep(name = "rules_java", version = "7.6.1")
bazel_dep(name = "rules_java", version = "7.6.5")
bazel_dep(name = "rules_bazelrio", version = "0.0.14")
bazel_dep(name = "rules_bzlmodrio_toolchains", version = "2024-1")

Expand Down
6 changes: 6 additions & 0 deletions maven_cpp_deps.bzl

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

17 changes: 15 additions & 2 deletions private/cpp/chipobject/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
load("@rules_cc//cc:defs.bzl", "cc_library")

cc_library(
name = "shared",
alias(
name = "header_files",
actual = "@bazelrio_edu_wpi_first_ni-libraries_chipobject_headers//:header_files",
visibility = ["@bzlmodrio-ni//:__subpackages__"],
)

filegroup(
name = "shared_raw",
srcs = select({
"@rules_bzlmodrio_toolchains//constraints/is_roborio:roborio": ["@bazelrio_edu_wpi_first_ni-libraries_chipobject_linuxathena//:shared"],
"//conditions:default": [],
}),
visibility = ["@bzlmodrio-ni//:__subpackages__"],
)

cc_library(
name = "shared",
srcs = [":shared_raw"],
target_compatible_with = select({
"@bazel_tools//src/conditions:darwin": ["@platforms//:incompatible"],
"@bazel_tools//src/conditions:linux_x86_64": ["@platforms//:incompatible"],
Expand Down
17 changes: 15 additions & 2 deletions private/cpp/netcomm/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
load("@rules_cc//cc:defs.bzl", "cc_library")

cc_library(
name = "shared",
alias(
name = "header_files",
actual = "@bazelrio_edu_wpi_first_ni-libraries_netcomm_headers//:header_files",
visibility = ["@bzlmodrio-ni//:__subpackages__"],
)

filegroup(
name = "shared_raw",
srcs = select({
"@rules_bzlmodrio_toolchains//constraints/is_roborio:roborio": ["@bazelrio_edu_wpi_first_ni-libraries_netcomm_linuxathena//:shared"],
"//conditions:default": [],
}),
visibility = ["@bzlmodrio-ni//:__subpackages__"],
)

cc_library(
name = "shared",
srcs = [":shared_raw"],
target_compatible_with = select({
"@bazel_tools//src/conditions:darwin": ["@platforms//:incompatible"],
"@bazel_tools//src/conditions:linux_x86_64": ["@platforms//:incompatible"],
Expand Down
11 changes: 9 additions & 2 deletions private/cpp/runtime/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
load("@rules_cc//cc:defs.bzl", "cc_library")

cc_library(
name = "shared",
filegroup(
name = "shared_raw",
srcs = select({
"@rules_bzlmodrio_toolchains//constraints/is_roborio:roborio": ["@bazelrio_edu_wpi_first_ni-libraries_runtime_linuxathena//:shared"],
"//conditions:default": [],
}),
visibility = ["@bzlmodrio-ni//:__subpackages__"],
)

cc_library(
name = "shared",
srcs = [":shared_raw"],
target_compatible_with = select({
"@bazel_tools//src/conditions:darwin": ["@platforms//:incompatible"],
"@bazel_tools//src/conditions:linux_x86_64": ["@platforms//:incompatible"],
Expand Down
17 changes: 15 additions & 2 deletions private/cpp/visa/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
load("@rules_cc//cc:defs.bzl", "cc_library")

cc_library(
name = "shared",
alias(
name = "header_files",
actual = "@bazelrio_edu_wpi_first_ni-libraries_visa_headers//:header_files",
visibility = ["@bzlmodrio-ni//:__subpackages__"],
)

filegroup(
name = "shared_raw",
srcs = select({
"@rules_bzlmodrio_toolchains//constraints/is_roborio:roborio": ["@bazelrio_edu_wpi_first_ni-libraries_visa_linuxathena//:shared"],
"//conditions:default": [],
}),
visibility = ["@bzlmodrio-ni//:__subpackages__"],
)

cc_library(
name = "shared",
srcs = [":shared_raw"],
target_compatible_with = select({
"@bazel_tools//src/conditions:darwin": ["@platforms//:incompatible"],
"@bazel_tools//src/conditions:linux_x86_64": ["@platforms//:incompatible"],
Expand Down
4 changes: 2 additions & 2 deletions private/non_bzlmod_dependencies/download_dependencies.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ def download_dependencies():
# Rules Java
http_archive(
name = "rules_java",
sha256 = "f8ae9ed3887df02f40de9f4f7ac3873e6dd7a471f9cddf63952538b94b59aeb3",
url = "https://github.com/bazelbuild/rules_java/releases/download/7.6.1/rules_java-7.6.1.tar.gz",
sha256 = "8afd053dd2a7b85a4f033584f30a7f1666c5492c56c76e04eec4428bdb2a86cf",
url = "https://github.com/bazelbuild/rules_java/releases/download/7.6.5/rules_java-7.6.5.tar.gz",
)

# JVM External
Expand Down
2 changes: 2 additions & 0 deletions tests/.bazelrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
try-import user.bazelrc
try-import .buildbuddy-auth.rc

import .bazelrc-cc
import .bazelrc-java
import .bazelrc-buildbuddy
Expand Down
11 changes: 10 additions & 1 deletion tests/.bazelrc-buildbuddy
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
build:remote --bes_results_url=https://app.buildbuddy.io/invocation/
build:remote --bes_backend=grpcs://remote.buildbuddy.io
build:remote --remote_cache=grpcs://remote.buildbuddy.io
build:remote --remote_download_toplevel # Helps remove network bottleneck if caching is enabled
build:remote --remote_timeout=3600

# Additional suggestions from buildbuddy for speed
build:remote --experimental_remote_cache_compression
build:remote --experimental_remote_cache_compression_threshold=100
build:remote --noslim_profile
build:remote --experimental_profile_include_target_label
build:remote --experimental_profile_include_primary_output
build:remote --nolegacy_important_outputs

build --experimental_inmemory_jdeps_files
build --experimental_inmemory_dotd_files

build:ci --config=remote
build:ci --build_metadata=ROLE=CI
build:ci --remote_download_minimal
2 changes: 2 additions & 0 deletions tests/.bazelrc-cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ build:windows --copt=/wd5105
build:windows --cxxopt=/wd4146
build:windows --cxxopt=/wd4267
build:windows --cxxopt=/wd4244
build:windows --cxxopt=/utf-8

# Windows Arm
build:windows_arm --copt=/W3
Expand All @@ -17,6 +18,7 @@ build:windows_arm --copt=/wd5105
build:windows_arm --cxxopt=/wd4146
build:windows_arm --cxxopt=/wd4267
build:windows_arm --cxxopt=/wd4244
build:windows_arm --cxxopt=/utf-8
build:windows_arm --cpu=arm64_windows

# Linux
Expand Down
2 changes: 1 addition & 1 deletion tests/.bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.2.0
7.3.1
2 changes: 1 addition & 1 deletion tests/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ local_path_override(

bazel_dep(name = "googletest", version = "1.14.0")
bazel_dep(name = "rules_cc", version = "0.0.9")
bazel_dep(name = "rules_java", version = "7.6.1")
bazel_dep(name = "rules_java", version = "7.6.5")
bazel_dep(name = "rules_jvm_external", version = "6.1")
bazel_dep(name = "rules_bazelrio", version = "0.0.14")
bazel_dep(name = "rules_bzlmodrio_toolchains", version = "2024-1")
Expand Down

0 comments on commit a61475e

Please sign in to comment.