Commit Graph

339 Commits

Author SHA1 Message Date
Peter Johnson
02c8d5c9db [hal] Revamp notifiers (#8424)
This changes the HAL notifier interface to:
- Use wpiutil signal objects. This means waiting is done through the
`WPI_WaitObject` API instead of a dedicated function and allows for
higher level code to simultaneously wait on notifiers and other events.
- Interval timers are supported at the HAL layer
- Handlers are now required to acknowledge notifications. This is
invisible to users unless they're directly using the HAL API.
- For interval timers, an overrun count is maintained to detect if the
handler didn't acknowledge

The underlying implementation still uses condition variables for the
actual waiting. In basic testing using this approach seemed to be lower
jitter than timerfd.

Currently, the simulation and systemcore implementations are nearly
identical except for a few additional sim hook bits. This could be
refactored, but keeping them separate may make sense to keep the
systemcore implementation easy to read and reason about, or if we ever
choose to use a different underlying timer implementation on systemcore.

The simulation side API is unchanged in form but does change in
function--waiting for notifiers now only waits for currently running (or
newly signaled) notifiers to acknowledge. To avoid a race condition in
sim stepTiming, users of the low level API must make any alarm updates
(especially for one-shot alarms) prior to acknowledging the previous
alarm.

The only current use of the interval timer feature is the `Notifier`
class. The `TimedRobot` implementation still uses a single notifier and
its own interval timing logic to ensure consistent callback order. Using
separate notifiers for each user-level interval would substantially
increase complexity. `Watchdog` also doesn't use the interval timer, as
it's looking for an amount of time since the last `set` call rather than
a recurring interval time.

To reduce flicker, the sim GUI uses a fade out when a timeout goes from
set to unset.

This fixes tsan for wpilib and commands, and also fixes some spurious
test failures.
2025-11-29 11:00:18 -08:00
Peter Johnson
704b6ccaee Merge branch 'main' into 2027 2025-11-29 10:41:16 -08:00
Tyler Veness
b482fa02df Shorten wpiformat config (#8427) 2025-11-27 17:30:06 -08:00
Tyler Veness
c9b989ac6a [ci] Upgrade to wpiformat 2025.77 (#8426)
This release associates .cpp and .hpp files as C++ files by default.
2025-11-27 11:45:18 -08:00
David Vo
6059cc8b79 [ci] Build only publish artifacts in Bazel cross-compile jobs (#8416)
#8363 split all the cross-compilation into separate jobs, however these
jobs are still also building the world (including the tests) targeting
the host.

Since `//:publish` and its dependencies are transitioned to target the
desired platforms for each artifact, `bazel build //:publish` in the CI
jobs that aren't running tests to only build what we actually care about
in these jobs.

This saves around 1 to 1.5 minutes for each cross-compile job with 100%
cache hit rates.
2025-11-22 08:36:17 -08:00
Ryan Blue
f6b4ad575b [ci] Pin docker-run-action and remove rm command (#8415)
The fix was made but has not been tagged.
2025-11-22 07:55:44 -08:00
Thad House
32fc543dc8 [hal,wpilib] Add Touchpad support (#8401) 2025-11-21 13:57:11 -08:00
David Vo
e2cbde2061 [ci] Use Java headers for macOS Bazel build (#8413)
I'm not entirely sure why Java header compilation is disabled for the
macOS build. But this option will be causing rebuilds to happen more
often than strictly necessary.

[Turbine](https://github.com/google/turbine) takes Java class sources
and spits out .class files with all method bodies, and private fields
and methods stripped. This provides a .jar with sufficient information
on the classpath to build dependent Java libraries without depending on
the implementation in the build graph.
2025-11-21 12:53:17 -08:00
David Vo
84aec2b8c1 [ci] Remove Java and deprecated Bazelisk setup from Bazel workflow (#8412)
We download the JDK in the workspace and tell Bazel to use it for all
Java actions in our config, so we don't need to download another one.


99af9d775c/.bazelrc (L12-L15)

The
[bazelbuild/setup-bazelisk](https://github.com/bazelbuild/setup-bazelisk)
action is deprecated, and is redundant with the
[bazel-contrib/setup-bazel](https://github.com/bazel-contrib/setup-bazel)
action we use after it.
2025-11-21 12:52:34 -08:00
PJ Reiniger
fbabcc2022 [ci] Run robotpy gen steps in series instead of simultaneously (#8404)
The update yaml step _might_ cause changes that would affect the build
file generation. Since `bazel run //:write_robotpy_update_yaml_files`
runs them all at once, user that was using the github action to fix
their python stuff would end up having to run it twice.

By running the steps individually in series, this should be able to get
it in one swoop.
2025-11-18 21:30:26 -08:00
Tyler Veness
aba592bec0 [ci] Upgrade to wpiformat 2025.69 (#8394) 2025-11-17 15:36:32 -07:00
Peter Johnson
0e621e8ec1 [ci] Remove command robotpy PR responder (#8392)
This is no longer required with the merge of Python commands.
2025-11-16 16:57:10 -08:00
Tyler Veness
1705b2d61c Upgrade wpiformat and use clang-format's include sorting (#8350)
This PR also uses the newly added -default-branch flag to generate the list of changed files with respect to the correct branch (2027).
2025-11-11 18:05:12 -08:00
Austin Schuh
a0f4727179 [ci] Run each of the various bazel builds in a separate worker (#8363)
We are running out of disk space.  If we split the
build up more in parallel, that'll use less space in each build.

Signed-off-by: Austin Schuh <austin.linux@gmail.com>
2025-11-11 18:03:47 -08:00
Ryan Blue
418b3814bc Change SystemCore to Systemcore (#8359) 2025-11-10 18:18:58 -08:00
PJ Reiniger
dc9e70ef05 [ci] Decrease CI verbosity (#8361)
Offline conversations have pointed out that the bazel output is very noisy upon a failure. The -k that was there for a while was recently deleted in another PR, and this one removes --verbose_failures. --verbose_failures prints all of the command line arguments, which can be quite lengthy and make it harder to find the actual compiler error.

This also removes the -vv from the clang-tidy step. I have found it very hard to find the actual errors when its printing out all of the debug information.
2025-11-10 18:16:56 -08:00
Austin Schuh
00ff8b941d [bazel] Publish almost all artifacts (#8141)
This uses all the infrastructure we put together earlier to actually build and publish all the artifacts.

We might still want to adjust what is built by default to control CI times.

Signed-off-by: Austin Schuh <austin.linux@gmail.com>
Co-authored-by: PJ Reiniger <pj.reiniger@gmail.com>
Co-authored-by: David Vo <auscompgeek@users.noreply.github.com>
2025-11-10 10:10:49 -07:00
PJ Reiniger
892666fbbe [robotpy] Add build scripts for wpilib and dependencies (#8348)
This gets the majority of projects from mostrobotpy building in this mirror. Projects missing still are cscore and the halsim wrappers.
2025-11-09 10:32:58 -08:00
Austin Schuh
04fb95a897 [bazel] Use the new gitlib-bazel.wpi.edu cache server (#8342)
This is owned by WPI, so we can make it as big or small as we want.
This lets us check in more of the bazel build.

Signed-off-by: Austin Schuh <austin.linux@gmail.com>
2025-11-08 16:59:26 -08:00
PJ Reiniger
10b4a0c971 SCRIPT fixup project rename 2025-11-07 23:09:21 -08:00
Peter Johnson
cc043df07f Merge branch 'main' into 2027 2025-11-01 09:39:08 -07:00
Tyler Veness
cd237e57d4 [ci] Upgrade to macOS 15 runner image (#8321)
This fixes a compiler bug (rejecting out-of-line definitions of constrained members) newer versions of Sleipnir were encountering.
2025-11-01 09:17:09 -07:00
Tyler Veness
4aef52a117 [ci] Upgrade to wpiformat 2025.36 (#8308)
clang-format 21 made some formatting changes. Since wpiformat's stdlib
task was removed, I removed NOLINT comments for it and removed some
std:: prefixes it added to comments.
2025-10-28 20:17:04 -07:00
Ryan Blue
873e960e93 [ci] Update tools workflow for 2026 (#8301) 2025-10-25 17:23:12 -07:00
Gold856
4f133c6aa1 [build][ci] Update vcpkg baseline (#8300) 2025-10-25 10:28:39 -07:00
Peter Johnson
7ff312bb69 Merge branch 'main' into 2027 2025-10-06 19:43:02 -07:00
Gold856
6447011bc3 [ci] Consolidate docs jobs (#7910)
We build docs in three different places, which is annoying to deal with, and it means we build docs two more times than necessary. Now, docs are built just once in the main Gradle workflow, with warnings promoted to errors, eliminating the need for the separate job in lint-format.yml. The uploaded docs artifact is then unpacked and commited to the GitHub Pages repo like normal.
2025-09-29 18:02:42 -07:00
Tyler Veness
bb5ee73e46 [build] Build JNI and benchmarks as release by default (#8257)
It doesn't make sense to benchmark debug binaries. Also, wpimath JNI
performance in unit tests is drastically impacted by debug vs release.
2025-09-29 17:47:17 -07:00
Gold856
7aabc19977 [bazel] Update Bazel to 8.4.1 to fix Windows builds (#8258)
- Fix missing epilogue deps
- Compress debug info to save space in CI
2025-09-27 22:50:21 -07:00
Peter Johnson
1ce2854a1e Merge branch 'main' into 2027 2025-09-20 11:19:40 -07:00
Ryan Blue
2639e0365b [ci] Update sentinel build with Windows FFI changes (#8218) 2025-09-07 21:33:19 -07:00
Ryan Blue
08f11488b0 [ci] Add 2027 development repo to cleanup task (#8217) 2025-09-07 06:16:26 -07:00
Ryan Blue
ed904851eb [ci] Fix CMake Android build caching (#8206)
sccache was enabled but didn't have write credentials
2025-08-31 21:55:13 -07:00
Gold856
d4311d5a29 [wpiutil,glass,dlt] Replace libprotobuf with upb for dynamic decode (#7988)
libprotobuf is a very annoying dependency to deal with, and with the switch to nanopb for generated C++ code, libprotobuf is only used for dynamic decode in the GUI apps. libprotobuf has been swapped out with upb, a much smaller C-based library that supports reflection and can therefore do dynamic decode. This means we can remove the libprotobuf dependency and stop dealing with build issues because of it.
2025-08-16 22:56:32 -07:00
Peter Johnson
ed7982563b Merge branch 'main' into 2027 2025-08-03 11:51:25 -07:00
Gold856
c42fde5d07 [ci] Make upstream_utils check error with a more clear message (#8153)
Now it links to the README in upstream_utils.
2025-08-03 11:37:40 -07:00
Austin Schuh
23f5725853 [bazel] Reduce number of windows builds in CI (#8145)
Windows is proving to be a *lot* slower than everything else.  I supect
this is because we are building both arm64 and x86 every time, which
ends up being twice the work.  Leave those builds in place, but skip
doing them in CI.  This should be a 2x speedup when building Windows
code.

Signed-off-by: Austin Schuh <austin.linux@gmail.com>
2025-08-02 23:09:29 -07:00
Austin Schuh
db95f55394 [bazel] Handle debug symbols and debug builds like gradle (#8118)
This follows the gradle build accurately.  Gradle copies debug symbols
into a second file (libfoo.so.debug) and links it back into the .so
file.  Disable this behavior when gradle doesn't do it today.

Also, name everything correctly.  When building debug builds, most
libraries get a 'd' at the end of them.  Do that here too.
2025-07-30 20:07:06 -07:00
Tyler Veness
e678a338b4 [ci] Upgrade wpiformat (#8124)
See https://github.com/wpilibsuite/styleguide/pull/312
2025-07-30 11:10:12 -06:00
Jade
e93c8cdb29 [build] Upgrade to Java 21 (#7547)
Signed-off-by: Jade Turner <spacey-sooty@proton.me>
Co-authored-by: sciencewhiz <sciencewhiz@users.noreply.github.com>
2025-07-25 15:45:40 -07:00
Austin Schuh
60098b0685 [bazel] Build a single maven artifact bundle (#8049)
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
Co-authored-by: PJ Reiniger <pj.reiniger@gmail.com>
Co-authored-by: David Vo <auscompgeek@users.noreply.github.com>
2025-07-22 14:26:20 -06:00
sciencewhiz
b445d48033 [ci] Remove tools build (#8098) 2025-07-18 20:44:46 -07:00
PJ Reiniger
abeaa40e38 [ci] Install bazel on docker image builds (#8079)
Co-authored-by: David Vo <auscompgeek@users.noreply.github.com>
2025-07-13 22:12:45 -05:00
Peter Johnson
7c1a22376b Merge branch 'main' into 2027 2025-07-13 20:11:31 -07:00
sciencewhiz
8d7bed791c [ci] Revert Bazel artifactory caching (#8080)
* Revert "[bazel] Set remote cache header to prevent redirects (#8065)"

This reverts commit 082de35ad7.

* Revert "[ci] Add Bazel caching (#8006)"

This reverts commit c3b327d57b.
2025-07-13 21:56:00 -05:00
Peter Johnson
7142fb1f5f Merge branch 'main' into 2027 2025-07-08 19:54:03 -07:00
Gold856
c3b327d57b [ci] Add Bazel caching (#8006) 2025-07-03 23:15:18 -05:00
Peter Johnson
82ce317083 Merge branch 'main' into 2027 2025-06-30 20:21:11 -07:00
Gold856
a3ce880334 [ci] Update Homebrew protobuf version for CMake (#8045)
protobuf@3 will be deactivated July 1st, so it's been replaced with protobuf@29.
2025-06-30 00:10:37 -07:00
Gold856
22b58c1853 [upstream_utils] Upgrade to LLVM 20.1.7 (#8033)
Also removes xxhash, Hashing, and MapVector to reduce the size of the patches and to speed up compile times by a smidge.
2025-06-24 22:36:22 -07:00