Skip to content

3.3 Two WPILib seasons in one tree

Tempo builds artifacts for WPILib 2026 (roboRIO) and WPILib 2027 (SystemCore) from one source tree, with no branch per season. This chapter explains how each binding picks its season, what differs between the two builds, and how a robot refuses an artifact built for another WPILib. Read it before touching java/build.gradle, java/wpilib2027Imports.tsv, cpp/include/tempo/wpi/WpiCompat.h, python/tempo/_wpi_compat.py, or anything that names a WPILib type.

The test gates per season are in Building and testing, and the Windows build and deploy steps are in Testing Tempo on Windows.

What differs between the seasons

20262027
WPILib version2026.2.1 (wpilib2026Version)one row of wpilib2027Bundles: 2027.0.0-alpha-6, -alpha-7 or -alpha-8
Java packagesedu.wpi.first.*org.wpilib.*
JDK17 (source and target 17)25 (Java toolchain 25; WPILib’s class files are major 69)
Robot controllerroboRIO, WPILib platform linuxathenaSystemCore, WPILib platform linuxsystemcore
Rust targetarm-unknown-linux-gnueabiaarch64-unknown-linux-gnu
JNA resource prefixlinux-armellinux-aarch64
Artifact versiontempoBaseVersion<tempoBaseVersion>-wpilib2027-<bundle>
Vendordep fileTempo.json in java/dist/vendordep/Tempo-wpilib2027-<bundle>.json in java/dist/vendordep-wpilib2027-<bundle>/
Vendordep year keyfrcYear: 2026wpilibYear: <bundle's wpilibYear>
C++ namespacesfrc::, frc2::, nt::, units::wpi::math::, wpi::cmd::, wpi::nt::, wpi::units::
Commands frameworkCommands v2v2 on alpha-6; v2 or v3 on alpha-7 and alpha-8

All lines share the Maven artifact id tempo-java, and a robot project picks its line by installing the vendordep that matches the WPILib it already has.

Selecting the year

Java

java/build.gradle reads the JDK Gradle runs on:

Gradle
def hostJavaMajor = Integer.parseInt(JavaVersion.current().majorVersion)
def wpilibYear = (findProperty('wpilibYear') as String) ?: (hostJavaMajor >= 25 ? '2027' : '2026')

JDK 25 or newer selects 2027, anything older 2026, and -PwpilibYear=2026|2027 overrides that, and any other value fails configuration. A 2027 build on a JDK older than 25 fails with a message naming the JDK inside the WPILib 2027 install. Set both JAVA_HOME and -Dorg.gradle.java.home to the JDK for the season:

Shell
cd java
sh gradlew build -PwpilibYear=2026            # on JDK 17
sh gradlew build -PwpilibYear=2027            # on JDK 25, default bundle alpha8
sh gradlew build -PwpilibYear=2027 -Pwpilib2027Bundle=alpha6

./gradlew check verifyNativePackaging with an explicit -PwpilibYear, once for 2026 on JDK 17 and once for 2027 on JDK 25, checks both seasons.

C++

cpp/include/tempo/detail/WpilibYear.h defines TEMPO_WPILIB_YEAR when nothing else has. It checks __has_include(<wpi/commands2/Command.hpp>), a header that exists only in 2027, and falls back to 2026, including desktop builds with no WPILib at all. -DTEMPO_WPILIB_YEAR=2027 overrides detection.

cpp/CMakeLists.txt keeps a TEMPO_WPILIB_YEAR cache variable (default "2026"), rejects any value other than 2026 or 2027 when the WPILib adapter is built, and adds it as a PUBLIC compile definition on tempo_wpi (or on tempo when the adapter is compiled into the core library), so consuming code sees the same types the .cpp files saw. The same value becomes TEMPO_PACK_YEAR on the tempo target, which selects the bundled default pack. When the adapter builds as the separate tempo_wpi library, the tempo target also gets TEMPO_HAL_SIMULATION_RUNTIME (1 for 2027, 2 for 2026), the HAL_GetRuntimeType value that means simulation in that season.

Python

One wheel set serves both years, and a source checkout and a wheel behave the same. python/tempo/_wpilib_version.py reads the year from the installed RobotPy’s wpilib version and refuses a year outside SUPPORTED_YEARS (2026 and 2027). The bundled default pack is _pack_defaults.DEFAULTS for that year, or the newest year’s without RobotPy. python/pyproject.toml requires robotpy>=2026,<2028, and a test holds it to SUPPORTED_YEARS. python/build-wheels.sh builds the four wheels into python/dist-wheels/.

At runtime Python has no translation step. python/tempo/_wpi_compat.py resolves every RobotPy name Tempo reads by listing the accepted spellings, 2027 first, and asking the installed RobotPy which one it has. Its module docstring records the differences it covers, checked against RobotPy 2026.2.2, 2027.0.0a6.post1, 2027.0.0a7 and 2027.0.0a8 (a8 has a7’s names):

  • wpimath submodules in 2026, a flat wpimath in 2027, and ChassisSpeeds renamed ChassisVelocities.
  • The alliance on MatchState and robot state on RobotState in 2027.
  • snake_case methods in wpilib and commands2 on a7 (resolve_snake, call_snake), and CANCEL_SELF / CANCEL_INCOMING.
  • wpilib.SendableChooser in 2026 and a6, tunables.Selectable in a7.

Nothing in _wpi_compat.py imports RobotPy at module scope.

The Java 2027 source set

The 2026 tree under java/src/main/java and java/src/test/java is the only hand-written Java, and a 2027 build compiles a generated copy.

Translation

generateWpilib2027Sources writes java/build/generated/wpilib2027/{main,test}/java:

  1. Every .java file in the 2026 tree is read and rewritten with the rows of java/wpilib2027Imports.tsv.
  2. For alpha-7 and alpha-8 test sources, lifecycleTestSource also rewrites Commands v2 types to Tempo’s neutral command types (com.tempo.internal.commands.Lifecycle, com.tempo.testcommands.*), with a short list of files kept on real Commands v2.
  3. Whole-file replacements are copied over the translations, first from java/src/{main,test}/java-wpilib2027/ (every bundle), then from each java/src/{main,test}/java-wpilib2027-<id>/ the selected row’s overlays list names, in order. alpha6 applies its own, alpha7 its own, and alpha8 alpha-7’s and then its own, since it keeps the alpha-7 API.
  4. Every generated line is searched for edu.wpi.first, and any hit fails the build with the file, line and text, before javac runs.

When is2027, the main and test source sets point at the generated directories, every JavaCompile task depends on the generator, and the test resources add java/src/test/resources-wpilib2027 (which registers WpiNativeBootstrap).

The mapping table

java/wpilib2027Imports.tsv has two tab-separated columns, 2026 and 2027, plus an optional third column naming the bundles a row applies to. The rules, from readWpilib2027Mappings and translateWpilib2027:

  • Rows apply longest key first, so a fully qualified name beats the bare name that ends it.
  • A key starting with a dot is a member row. When it ends in an identifier character it matches only a whole member name, so .kPi rewrites Rotation2d.kPi and leaves arm.kPivot alone.
  • Every other row is a literal replacement, which the package-prefix rows rely on.
  • A third column must name ids from wpilib2027Bundles, and an unknown id fails the build. A scoped row is skipped for other bundles.

As examples of scoped rows, alpha-7 and alpha-8 (alpha7,alpha8) map SendableChooser to org.wpilib.tunable.Selectable and .kCancelSelf, .kCancelIncoming, .kZero to their uppercase forms, while alpha-6 keeps the k-prefixed names.

checkWpilib2027Translation (part of check) runs the matcher on literal samples on every build. Because the generator’s inputs include the selected bundle, switching -Pwpilib2027Bundle regenerates the tree.

Whole-file overrides

DirectoryFiles
java/src/main/java-wpilib2027/com/tempo/internal/AllianceSignal.java, com/tempo/wpi/PoseResults.java
java/src/main/java-wpilib2027-alpha7/com/tempo/wpi/CommandResults.java, com/tempo/wpi/TempoCommand.java, com/tempo/internal/Choosers.java, com/tempo/internal/cmd3/Adapter.java
java/src/test/java-wpilib2027/ChildJvm.java, WpiNativeBootstrap.java
java/src/test/java-wpilib2027-alpha6/CommandsV3VersionGuardTest.java
java/src/test/java-wpilib2027-alpha7/Commands v2/v3 and framework-isolation tests, WpiNativeBootstrap, chooser picks, HeadlessOpMode, test commands, CommandsV3TestExits without an exit callback
java/src/main/java-wpilib2027-alpha7/, -alpha8/com/tempo/internal/cmd3/Exits.java, which does nothing on alpha-7, whose v3 Command has no onExit. On alpha-8 it forwards Command.onExit(), where whenExited(...) cleanup runs, from the adapter’s wrappers to the team’s command
java/src/test/java-wpilib2027-alpha8/HeadlessOpMode over alpha-8’s RobotStateFetcher (which replaced OpModeFetcher and also reports enabled, because alpha-8’s scheduler refuses, while disabled, a command that requires a mechanism not controllable while disabled), CommandsV3TestExits with whenExited

An override replaces a file whole, so it must keep everything the canonical file does that is not WPILib-specific. checkWpilib2027Guards enforces one case, that when the canonical file calls WpilibVersionGuard.require();, its override must too. The alpha-7 command adapter design (internal.cmd2 / internal.cmd3, scheduler probing in Frameworks) is in Java command framework boundary.

To fix a surviving edu.wpi.first name, add a row to the table. Use an override only when a file’s structure differs between seasons.

The bundle rows

wpilib2027Bundles in java/build.gradle holds one row per supported 2027 WPILib. -Pwpilib2027Bundle=<id> selects one, the default is alpha8, and an unknown id fails configuration.

The newest published 2027 alpha is the default, the alpha before it stays supported, and an older alpha stays only while a major vendor example still needs it. Alpha-6 stays for REV’s rev-maxswerve C++ 2027 branch, which is on alpha-6. Its row, overrides, scoped mapping rows, fixture cases and toolchain notes go once REV moves.

Fieldalpha6alpha7alpha8
wpilibVersion2027.0.0-alpha-62027.0.0-alpha-72027.0.0-alpha-8
mavenUrlfrcmaven.wpi.edu/artifactory/release-2027/frcmaven.wpi.edu/artifactory/release/frcmaven.wpi.edu/artifactory/release/
wpilibYear (vendordep stamp)2027_alpha52027_alpha72027_alpha7
vendordepUuidb124570e-3f05-4912-9455-ddf06ca03e108884b82a-83cb-48bf-af4f-aeb1e1c26884bfdadcc6-de9a-4181-80a2-e2cc721e05e6
extraJavaModulesnonetelemetry-java, tunables-java, commandsv3-javaas alpha-7
extraCppHeaderModulesnonetelemetry-cpp, tunables-cppas alpha-7
extraTestRuntimenoneio.avaje:avaje-jsonb:3.14as alpha-7
overlaysalpha6alpha7alpha7, alpha8
commandsV3falsetruetrue

The wpilibYear stamp is what each GradleRIO compares with String.equals while the robot project configures, and alpha-6’s GradleRIO expects 2027_alpha5, so that row stamps it. GradleRIO alpha-8 keeps alpha-7’s 2027_alpha7. Within each pair that shares a stamp (alpha-5 and alpha-6, alpha-7 and alpha-8), the runtime version guard reports a mismatch. The 2026 line uses tempoVendordepUuid (4f4207fb-0f71-4b90-a5e6-03e0fe2782f3), and the build fails if two lines share a uuid. A uuid is fixed for the life of its line, because GradleRIO identifies a vendordep by uuid, and a changed one installs a second copy.

Each row ships as its own release. One sh gradlew vendordep -Pwpilib2027Bundle=<id> run builds one bundle.

Adding a bundle

  1. Add a row with a fresh uuid, the Maven version and repository, the wpilibYear the new GradleRIO expects (wpilibYear.convention in its WPIExtension.java), its overlays and commandsV3, and make it the default. Remove the row before the previous one unless a major vendor example still needs it (see above).
  2. Add scoped rows to java/wpilib2027Imports.tsv and any java-wpilib2027-<id>/ overrides the API change needs.
  3. Build -PwpilibYear=2027 -Pwpilib2027Bundle=<id> and run check, which includes checkWpiAdapter (the C++ adapter compiled against the bundle’s headers).
  4. Add the version to CHECKED_2027 in python/tempo/_wpilib_version.py once _wpi_compat.py resolves every name on the matching RobotPy, and run the Python gate on that RobotPy.
  5. Add the version to the supported table in tests/fixtures/api/wpilibVersionGuard.json, with the compare cases and messages the new line needs, and its DCMotor models to tests/fixtures/api/motorPresets.json.
  6. Add the line to the release builds and the website’s installLinks.ts.
  7. Regenerate the GUI’s table of names that exist in only one year with gui/web/scripts/wpilib-year-names.py, passing every supported Maven tree and a RobotPy interpreter for each year. No test checks this file, and the GUI treats a name missing from it as valid in both years.

Artifacts built before a row existed do not name it in their refusal message, since the supported table is baked in at build time.

C++ across seasons

cpp/include/tempo/wpi/WpiCompat.h is the one adapter header that knows the season. It includes the union of headers the adapter needs for the detected year and defines aliases in tempo::wpilib (for example ChassisSpeeds is ::wpi::math::ChassisVelocities on 2027). Adapter code spells every WPILib name through those aliases. Every 2027 alias keeps a leading ::, because Tempo’s own adapter namespace is tempo::wpi. Within 2027, __has_include(<wpi/tunables/Selectable.hpp>) picks alpha-7’s Selectable over alpha-6’s SendableChooser (TEMPO_WPILIB_SELECTABLE).

Other alpha-7 differences (alpha-8 keeps them) handled in tree:

  • Translation2d::Angle() returns std::optional<Rotation2d>, and the detail::AngleLike concept in cpp/include/tempo/detail/Geometry.h accepts both shapes.
  • wpi/util/Endian.hpp needs C++23, so cpp/CMakeLists.txt sets CMAKE_CXX_STANDARD 23.

For packaging, Gradle resolves the season’s C++ headers from Maven at the artifact’s WPILib version (stageWpilibCppHeaders, into java/build/cpp-dist/wpilib-headers), independent of any installed WPILib, and checkWpiAdapter compiles cpp/src/wpi against them. The editor’s src/code/wpilibCppHeaders.test.ts reads staged headers through TEMPO_WPILIB_CPP_HEADERS_2026 / _2027 (Frontend checks).

Version guards

Each binding compares the WPILib version an artifact was built for with the one the robot runs, before Tempo’s first native call. Java and C++ refuse any other WPILib version, except that an artifact built for a final release also runs on a later final release of the same year (Version.runsOn in java/src/main/java/com/tempo/internal/WpilibVersionGuard.java), and Python refuses a RobotPy of another year. The parse rules, comparison rules and every message are in tests/fixtures/api/wpilibVersionGuard.json (keys supported, parse, compare), which WpilibVersionGuardTest, cpp/tests/test_wpilib_version.cpp and python/tests/test_wpilib_version.py read.

The rules, from the fixture’s description:

  • A release runs on that release and any later release of its year.
  • A pre-release runs only on the same pre-release.
  • A development build (a git-describe suffix) is checked as the release it follows, with a note.
  • A local WPILib build (minor version 424242) runs unchecked within its year, with a note.
  • A version that cannot be read prints a note and runs unchecked.

Verdicts are match, note, mismatch and unreadable.

Java

writeWpilibBuildInfo writes com/tempo/internal/wpilib-build.properties into the JAR with wpilibVersion and supported (version=vendordep pairs). com.tempo.internal.WpilibVersionGuard reads it and reads the running version reflectively from edu.wpi.first.wpilibj.util.WPILibVersion or org.wpilib.system.WPILibVersion (a direct field read would be inlined at compile time). A mismatch is printed once and reported on the Driver Station, and WpilibVersionGuard.require() then throws TempoException with the same text.

refusal() never throws, so a class initializer can call it. NativeLoader.loadTempoNative(), which initializes TempoNative.INSTANCE, calls it first, and on a refusal it returns refusedNative(...), a java.lang.reflect.Proxy whose every method throws the refusal as TempoException. Whichever class first reaches the core gets that exception on the call, and every later call, instead of an ExceptionInInitializerError that would leave the class unusable. TempoNativeFast still registers, since its calls are pure arithmetic and no route reaches them without first building a runtime through TempoNative. require() is also called from Setlist, Pose, RouteCommand, AutoRegistry and CoreMath.

C++

cpp/src/wpi/internal/WpilibVersionCheck.h defines require_wpilib_version(), using the parser in cpp/src/internal/WpilibVersion.h. It reads the running version from WPILib’s global GetWPILibVersion() and the built version and table from TEMPO_WPILIB_BUILT_VERSION and TEMPO_WPILIB_SUPPORTED, which the Gradle packaging passes to CMake. A build without them skips the check. The first call prints a note or mismatch, and on a mismatch every call throws std::runtime_error, which WPILib’s own RunRobot reports to the Driver Station. The adapter calls it from TempoCommand.cpp, Pose.cpp, TempoAutos.cpp and Setlist.cpp.

Python

import tempo runs _wpilib_version.check(), which reads RobotPy’s version from package metadata without importing RobotPy and prints what it finds. Entry points that reach WPILib (Tempo.configure, Setlist.configure, importing tempo.wpi, and RobotPy lookups in _geometry and _wpi_compat) call require(). A source checkout follows whichever RobotPy is installed and is never refused for running 2027. CHECKED_2027 lists the pre-releases the adapter was checked against, and another 2027 pre-release prints a note. The Python gate runs against each of them (Building and testing).

Game packs and the field origin

assets/fields/DEFAULT maps each artifact year to a registered pack:

2026=rebuilt-2026
2027=latest

latest resolves at build time to the unique newest registered pack whose year is no later than the artifact year, which today is rebuilt-2026 for both years (Bundled and deployed game packs). Java and C++ bake the selection in, and Python picks at runtime:

  • Java: copyDefaultPack writes com/tempo/packs/DEFAULT into the JAR for wpilibYear.
  • Python: tools/packs/sync-bundled-pack.py writes python/tempo/_pack_defaults.py, and Tempo reads DEFAULTS[year] for the installed RobotPy’s year, or the newest year’s pack without RobotPy.
  • C++: the generated cpp/src/internal/BundledPacks.h picks kDefaultPack with #if TEMPO_PACK_YEAR == <year> and fails to compile for a year with no entry.

rust/core/src/field.rs accepts two origins in a pack’s [field] origin: alwaysBlue (blue driver-station corner, x in [0, length], y in [0, width]) and fieldCenter (origin at the geometric center). How red elements derive from blue follows the pack’s symmetry and not its origin. Rotational symmetry negates both coordinates about the center, mirror symmetry negates x only, and none derives nothing (mirror_point_sym in field.rs). The bundled rebuilt-2026 pack declares origin = "alwaysBlue", so a 2027 artifact plans in the blue-corner frame unless robot code or deploy/tempo/ supplies a fieldCenter pack. rust/core/tests/center_origin_field.rs covers the center frame.

Cross toolchains

The Rust core has no WPILib dependency, so its robot native needs only a C cross-linker. Gradle resolves one per target and passes it to cargo through CARGO_TARGET_<TRIPLE>_LINKER, which outranks rust/.cargo/config.toml.

TargetTaskCompiler lookup
roboRIO, arm-unknown-linux-gnueabibuildRustRoboRioFRC_GCC_PATH, then -PfrcGccPath, then the WPILib default 2026/roborio/bin/arm-frc2025-linux-gnueabi-gcc for the OS
SystemCore, aarch64-unknown-linux-gnubuildRustSystemcoreSYSTEMCORE_GCC_PATH, then -PsystemcoreGccPath, then a gcc in the selected bundle’s WPILib install, then one in any other WPILib install, then aarch64-linux-gnu-gcc on PATH
Windows, x86_64-pc-windows-gnubuildRustWindowsMINGW_GCC_PATH, then -PmingwGccPath, then x86_64-w64-mingw32-gcc on PATH

The roboRIO build uses soft-float calling with -Ctarget-cpu=cortex-a9, which turns on the Zynq-7020’s VFPv3/NEON unit. rust/.cargo/config.toml records the 2026-08-14 field measurement behind it, where plain soft-float made a 156 ms x86 plan take 72 seconds on the roboRIO.

SystemCore discovery looks in the install’s systemcore/bin/ for a file named aarch64-<vendor>-linux-gnu-gcc, since WPILib puts a vendor component in the name. The alpha-5 install carries aarch64-bookworm-linux-gnu-gcc (GCC 12.2.0), and the alpha-7 install carries aarch64-systemcore2027-linux-gnu-gcc 14.3.0. The alpha-8 installer installs into that same ~/wpilib/2027_alpha7 folder (its upgradeConfig.json names wpilibYearFolder: 2027_alpha7) with the same compiler. Alpha-7’s <format> headers need GCC 13 or newer for C++ packaging, so the alpha-7 bundle packages its SystemCore C++ with its own install’s compiler. The C++ cross compiler is the same path with gcc replaced by g++ (cxxFor), so C++ and Rust find their compilers by the same rules.

A missing toolchain makes its cross task log a warning and skip. verifyNativePackaging then fails the build when the selected year’s robot native (linux-armel for 2026, linux-aarch64 for 2027) is absent, or is older than the Rust sources while its toolchain is missing, and the other season’s native is advisory. Desk builds can pass -PallowMissingRoboRioNative, -PallowMissingSystemcoreNative or -PallowStaleNatives, and such a build must never be deployed or released. Install the Rust targets once per machine:

Shell
rustup target add arm-unknown-linux-gnueabi aarch64-unknown-linux-gnu x86_64-pc-windows-gnu

Checking both seasons before a merge

CheckCommand
Java 2026cd java && sh gradlew build -PwpilibYear=2026 on JDK 17
Java 2027 default bundlecd java && sh gradlew build -PwpilibYear=2027 on JDK 25
Java 2027 alpha-7 and alpha-6the same with -Pwpilib2027Bundle=alpha7, then alpha6
Python 2026 and 2027cd python && sh run-suites.sh, then again with TEMPO_WPI_PYTHON pointing at a RobotPy 2027 interpreter
WPILib sim gate (2026)tests/robot/java_sim, ./gradlew test --no-daemon on JDK 17, after staging the 2026 artifact
Version guard rulesWpilibVersionGuardTest, test_wpilib_version.cpp, test_wpilib_version.py

A change to a shared Java file runs through both compilers, so build both years locally before pushing. A new WPILib name that the 2026 compiler accepts can still fail the 2027 build at the edu.wpi.first check.

esc

Loading search...