Skip to content

Commit f983420

Browse files
authored
Merge branch 'wpilibsuite:main' into easier-ignore-disable
2 parents a0776ff + 2c857cd commit f983420

File tree

309 files changed

+13952
-5044
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

309 files changed

+13952
-5044
lines changed

.bazelignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
build_cmake
2+
build-cmake
3+
4+
# Auto generated by vscode
5+
apriltag/bin
6+
cameraserver/bin
7+
cameraserver/multiCameraServer/bin
8+
cscore/bin
9+
fieldImages/bin
10+
hal/bin
11+
developerRobot/bin
12+
ntcore/bin
13+
romiVendordep/bin
14+
wpilibNewCommands/bin
15+
wpilibj/bin
16+
wpimath/bin
17+
wpinet/bin
18+
wpiutil/bin
19+
wpiunits/bin
20+
xrpVendordep/bin

.bazelrc

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
try-import %workspace%/bazel_auth.rc
2+
try-import %workspace%/user.bazelrc
3+
4+
common --noenable_bzlmod
5+
6+
build --java_language_version=17
7+
build --java_runtime_version=roboriojdk_17
8+
build --tool_java_language_version=17
9+
build --tool_java_runtime_version=remotejdk_17
10+
11+
test --test_output=errors
12+
test --test_verbose_timeout_warnings
13+
14+
import shared/bazel/compiler_flags/sanitizers.rc
15+
import shared/bazel/compiler_flags/base_linux_flags.rc
16+
import shared/bazel/compiler_flags/linux_flags.rc
17+
import shared/bazel/compiler_flags/osx_flags.rc
18+
import shared/bazel/compiler_flags/roborio_flags.rc
19+
import shared/bazel/compiler_flags/windows_flags.rc
20+
import shared/bazel/compiler_flags/coverage_flags.rc
21+
22+
build:build_java --test_tag_filters=allwpilib-build-java --build_tag_filters=allwpilib-build-java
23+
build:build_cpp --test_tag_filters=+allwpilib-build-cpp --build_tag_filters=+allwpilib-build-cpp
24+
build:no_example --test_tag_filters=-wpi-example --build_tag_filters=-wpi-example
25+
test:no_example --test_tag_filters=-wpi-example --build_tag_filters=-wpi-example
26+
27+
# Build Buddy Cache Setup
28+
build:build_buddy --bes_results_url=https://app.buildbuddy.io/invocation/
29+
build:build_buddy --bes_backend=grpcs://remote.buildbuddy.io
30+
build:build_buddy --remote_cache=grpcs://remote.buildbuddy.io
31+
build:build_buddy --remote_timeout=3600
32+
33+
# Additional suggestions from buildbuddy for speed
34+
build:build_buddy --experimental_remote_cache_compression
35+
build:build_buddy --experimental_remote_cache_compression_threshold=100
36+
build:build_buddy --noslim_profile
37+
build:build_buddy --experimental_profile_include_target_label
38+
build:build_buddy --experimental_profile_include_primary_output
39+
build:build_buddy --nolegacy_important_outputs
40+
41+
build:build_buddy_readonly --noremote_upload_local_results
42+
43+
# This config should be used locally. It downloads more than the CI version
44+
build:remote_user --config=build_buddy
45+
build:remote_user --config=build_buddy_readonly
46+
build:remote_user --remote_download_toplevel
47+
48+
build:ci --config=build_buddy
49+
build:ci --remote_download_minimal
50+
51+
build --build_metadata=REPO_URL=https://github.com/wpilibsuite/allwpilib.git

.bazelversion

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
7.3.1
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: 'Setup BuildBuddy acache'
2+
description: 'Sets up the build buddy cache to be readonly / writing based on the presence of environment variables'
3+
4+
inputs:
5+
token:
6+
description: 'Build Buddy API token'
7+
8+
runs:
9+
using: "composite"
10+
steps:
11+
- name: Setup without key
12+
env:
13+
API_KEY: ${{ inputs.token }}
14+
if: ${{ env.API_KEY == '' }}
15+
shell: bash
16+
run: |
17+
echo "No API key secret detected, will setup readonly cache"
18+
echo "build:ci --config=build_buddy_readonly" > bazel_auth.rc
19+
20+
- name: Set with key
21+
env:
22+
API_KEY: ${{ inputs.token }}
23+
if: ${{ env.API_KEY != '' }}
24+
shell: bash
25+
run: |
26+
echo "API Key detected!"
27+
echo "build:build_buddy --remote_header=x-buildbuddy-api-key=${{ env.API_KEY }}" > bazel_auth.rc

.github/workflows/bazel.yml

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
name: Bazel
2+
3+
on: [pull_request, push]
4+
5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
7+
cancel-in-progress: true
8+
9+
jobs:
10+
build-windows:
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
include:
15+
- { name: "Windows (native)", os: windows-2022, action: "test", config: "--config=windows", }
16+
- { name: "Windows (arm)", os: windows-2022, action: "build", config: "--config=windows_arm", }
17+
- { name: "Windows (roborio)", os: windows-2022, action: "build", config: "--config=roborio", }
18+
19+
name: "Build ${{ matrix.name }}"
20+
runs-on: ${{ matrix.os }}
21+
steps:
22+
- uses: actions/checkout@v4
23+
with: { fetch-depth: 0 }
24+
- uses: actions/setup-java@v4
25+
with:
26+
distribution: 'zulu'
27+
java-version: 17
28+
architecture: x64
29+
30+
- id: Setup_build_buddy
31+
uses: ./.github/actions/setup-build-buddy
32+
with:
33+
token: ${{ secrets.BUILDBUDDY_API_KEY }}
34+
35+
- name: Build Release
36+
run: bazel --output_user_root=C:\\bazelroot ${{ matrix.action }} -k ... --config=ci -c opt ${{ matrix.config }} --verbose_failures
37+
shell: bash
38+
39+
- name: Build Debug
40+
run: bazel --output_user_root=C:\\bazelroot ${{ matrix.action }} -k ... --config=ci -c dbg ${{ matrix.config }} --verbose_failures
41+
shell: bash
42+
43+
build-mac:
44+
strategy:
45+
fail-fast: false
46+
matrix:
47+
include:
48+
- { name: "Mac (native)", os: macos-14, action: "test", config: "--config=macos", }
49+
- { name: "Mac (roborio)", os: macos-14, action: "build", config: "--config=roborio", }
50+
51+
name: "${{ matrix.name }}"
52+
runs-on: ${{ matrix.os }}
53+
steps:
54+
- uses: actions/checkout@v4
55+
with: { fetch-depth: 0 }
56+
57+
- id: Setup_build_buddy
58+
uses: ./.github/actions/setup-build-buddy
59+
with:
60+
token: ${{ secrets.BUILDBUDDY_API_KEY }}
61+
62+
- name: Build Release
63+
run: bazel ${{ matrix.action }} -k ... --config=ci -c opt ${{ matrix.config }} --nojava_header_compilation --verbose_failures
64+
shell: bash
65+
66+
- name: Build Debug
67+
run: bazel ${{ matrix.action }} -k ... --config=ci -c dbg ${{ matrix.config }} --nojava_header_compilation --verbose_failures
68+
shell: bash
69+
70+
build-linux:
71+
strategy:
72+
fail-fast: false
73+
matrix:
74+
include:
75+
- { name: "Linux (native)", os: ubuntu-22.04, action: "test", config: "--config=linux", }
76+
- { name: "Linux (roborio)", os: ubuntu-22.04, action: "build", config: "--config=roborio", }
77+
name: "${{ matrix.name }}"
78+
runs-on: ${{ matrix.os }}
79+
steps:
80+
- uses: actions/checkout@v4
81+
with: { fetch-depth: 0 }
82+
- uses: bazelbuild/setup-bazelisk@v3
83+
84+
- id: Setup_build_buddy
85+
uses: ./.github/actions/setup-build-buddy
86+
with:
87+
token: ${{ secrets.BUILDBUDDY_API_KEY }}
88+
89+
- name: Build and Test Release
90+
run: bazel ${{ matrix.action }} ... --config=ci -c opt ${{ matrix.config }} -k --verbose_failures
91+
92+
- name: Build and Test Debug
93+
run: bazel ${{ matrix.action }} ... --config=ci -c dbg ${{ matrix.config }} -k --verbose_failures
94+
95+
build-sanitizers:
96+
strategy:
97+
fail-fast: false
98+
matrix:
99+
include:
100+
- config: "asan"
101+
- config: "ubsan"
102+
runs-on: ubuntu-22.04
103+
name: "Sanitizer ${{ matrix.config }}"
104+
steps:
105+
- uses: actions/checkout@v4
106+
with: { fetch-depth: 0 }
107+
- uses: bazelbuild/setup-bazelisk@v3
108+
109+
- id: Setup_build_buddy
110+
uses: ./.github/actions/setup-build-buddy
111+
with:
112+
token: ${{ secrets.BUILDBUDDY_API_KEY }}
113+
114+
- name: Build and Test
115+
run: bazel test -k --config=ci --config=linux --config=${{ matrix.config }} //...
116+
117+
buildifier:
118+
name: "buildifier"
119+
runs-on: ubuntu-22.04
120+
steps:
121+
- name: Set up Go 1.15.x
122+
uses: actions/setup-go@v5
123+
with:
124+
go-version: 1.15.x
125+
id: go
126+
127+
- name: Install Buildifier
128+
run: |
129+
cd $(mktemp -d)
130+
GO111MODULE=on go get github.com/bazelbuild/buildtools/[email protected]
131+
132+
- uses: actions/checkout@v4
133+
with: { fetch-depth: 0 }
134+
135+
- name: Run buildifier
136+
run: buildifier -warnings all --lint=fix -r .
137+
138+
- name: Check Output
139+
run: git --no-pager diff --exit-code HEAD
140+
141+
- name: Generate diff
142+
run: git diff HEAD > bazel-lint-fixes.patch
143+
if: ${{ failure() }}
144+
145+
- uses: actions/upload-artifact@v4
146+
with:
147+
name: ${{ matrix.platform }}-bazel-lint-fixes
148+
path: bazel-lint-fixes.patch
149+
if: ${{ failure() }}

.github/workflows/comment-command.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
distribution: 'temurin'
4444
java-version: 17
4545
- name: Install wpiformat
46-
run: pip3 install wpiformat==2024.42
46+
run: pip3 install wpiformat==2024.44
4747
- name: Run wpiformat
4848
run: wpiformat
4949
- name: Run spotlessApply

.github/workflows/lint-format.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
with:
2828
python-version: '3.10'
2929
- name: Install wpiformat
30-
run: pip3 install wpiformat==2024.42
30+
run: pip3 install wpiformat==2024.44
3131
- name: Run
3232
run: wpiformat
3333
- name: Check output
@@ -66,7 +66,7 @@ jobs:
6666
with:
6767
python-version: '3.10'
6868
- name: Install wpiformat
69-
run: pip3 install wpiformat==2024.42
69+
run: pip3 install wpiformat==2024.44
7070
- name: Create compile_commands.json
7171
run: |
7272
./gradlew generateCompileCommands -Ptoolchain-optional-roboRio

.github/workflows/upstream-utils.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,4 +133,4 @@ jobs:
133133
- name: Add untracked files to index so they count as changes
134134
run: git add -A
135135
- name: Check output
136-
run: git --no-pager diff --exit-code HEAD
136+
run: git --no-pager diff --exit-code HEAD ':!*.bazel'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ imgui.ini
249249
/bazel-*
250250
user.bazelrc
251251
coverage_report/
252+
bazel_auth.rc
252253

253254
# ctest
254255
/Testing/

CMakeLists.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,14 @@ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
6666
option(BUILD_SHARED_LIBS "Build with shared libs (needed for JNI)" ON)
6767
option(WITH_JAVA "Include Java and JNI in the build" OFF)
6868
option(WITH_JAVA_SOURCE "Build Java source jars" ${WITH_JAVA})
69+
option(WITH_DOCS "Build Doxygen docs (needs Git for versioning)" OFF)
70+
cmake_dependent_option(
71+
DOCS_WARNINGS_AS_ERRORS
72+
"Make docs warnings into errors"
73+
OFF
74+
WITH_DOCS
75+
OFF
76+
)
6977
option(WITH_CSCORE "Build cscore (needs OpenCV)" ON)
7078
option(WITH_NTCORE "Build ntcore" ON)
7179
option(WITH_WPIMATH "Build wpimath" ON)
@@ -129,6 +137,12 @@ else()
129137
find_package(Java REQUIRED COMPONENTS Runtime)
130138
endif()
131139

140+
if(WITH_DOCS)
141+
find_package(Doxygen REQUIRED)
142+
find_package(Git REQUIRED)
143+
include(AddDoxygenDocs)
144+
add_doxygen_docs()
145+
endif()
132146
find_package(LIBSSH CONFIG 0.7.1)
133147

134148
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG ON)

0 commit comments

Comments
 (0)