Skip to content

4.3 Testing Tempo on Windows

Commands use cmd.exe unless labeled PowerShell, and Gradle and CMake use native Windows launchers. The canonical Python gate is python/run-suites.sh, so that step also requires sh, for example from Git for Windows/Git Bash. Use Windows Python with RobotPy, because a Linux/WSL run is a separate platform result.

testing.md describes suite coverage. The current Rust sequencer has no selectable host fallback.

1. Shell and toolchain setup

POSIX formWindows form
sh gradlew buildgradlew.bat build in cmd, .\gradlew.bat build in PowerShell
export JAVA_HOME=...set "JAVA_HOME=..." in cmd, $env:JAVA_HOME = "..." in PowerShell
"$JAVA_HOME"%JAVA_HOME% in cmd, $env:JAVA_HOME in PowerShell
ctest with a single-config buildctest -C Release for the MSVC multi-config build

Use JDK 17 for WPILib 2026 and JDK 25 for 2027, and both build from the same Tempo source tree. For a standard 2026 WPILib installation, this selects the JDK for the current cmd session:

CMD
set "JAVA_HOME=C:\Users\Public\wpilib\2026\jdk"
"%JAVA_HOME%\bin\java" -version

Use the installed 2027 bundle’s JDK for that season. setx changes future terminals, not the current one. Gradle’s running JDK determines the default season, and -PwpilibYear=2026|2027 makes the choice explicit. If an existing org.gradle.java.home override is present, align it with the intended JDK.

Also install Rust 1.97.1 with the MSVC host toolchain, Visual Studio 2022 Build Tools with C++23 support, CMake >= 3.21, and Python 3.10+ with pytest. The core workspace declares Rust MSRV 1.75 and library CI pins 1.97.1. Use the same toolchain and dependency lockfiles when comparing results.

CMD
rustup show active-toolchain
rustc --version
python --version
cmake --version

Keep the clone outside folders that sync or restore files during a build. Unexpected source changes invalidate a result, so inspect Git status and the sync/backup tool before retrying.

2. Checkout bytes and scope

From the intended Tempo task branch:

CMD
git branch --show-current
git status --short
git config --get core.autocrlf
git ls-files --eol

.gitattributes preserves bytes for pinned fixtures and source files. For a clone with pre-existing line-ending drift, first preserve local edits and compare the checkout with the tracked bytes, and do not reset the whole tree to repair a pin. A fresh clone with the repository’s attributes is an alternative when the existing checkout must remain intact.

Do not start a gate with an unconditional pull or branch switch, so the gate tests the branch that is checked out.

3. The binding gate in order

Each block starts at the Tempo repository root and returns there. Stop on a failed command.

Rust:

CMD
cd rust
cargo fmt --all --check
cargo clippy --all-targets -- -D warnings
cargo test -p tempo-core
cargo build --release -p tempo-core
cd ..

Java, using the selected season’s JDK:

CMD
cd java
gradlew.bat build
cd ..

Cross-season changes require both the 2026/JDK 17 and 2027/JDK 25 builds. The default 2027 bundle is alpha8, whose release packaging needs a GCC 13 or newer SystemCore compiler (wpilib-years.md).

Python, with sh available and the Windows default interpreter configured:

CMD
cd python
python -m pip install pytest robotpy robotpy-commands-v2
sh run-suites.sh
cd ..

The gate runs the default interpreter and a verified commands2 interpreter. If they share an environment, the second run is skipped because it would collect the same tests. For a separate Windows RobotPy environment, set TEMPO_WPI_PYTHON to its executable, such as .venv-wpi/Scripts/python.exe relative to python/. The script’s automatic venv path is .venv-wpi/bin/python, so Windows venvs need the explicit override. A missing or unusable RobotPy interpreter fails the gate.

C++, using the helper from the Tempo root:

CMD
powershell -ExecutionPolicy Bypass -File .\cpp\build.ps1 -NoTest
cmake -E copy_if_different rust\target\release\tempo_core.dll cpp\build\Release\tempo_core.dll
ctest --test-dir cpp\build -C Release --output-on-failure

build.ps1 -NoTest builds the Rust release library, configures the VS 2022 x64 generator and builds the tests. The explicit final copy/test also covers a Rust-only rebuild where the C++ executable stays up to date and its post-build copy does not run. Use Debug paths and -C Debug if that is the selected C++ configuration. Avoid -SkipRust unless the native artifact has independently been verified fresh, and -NoTest is only a build result.

In PowerShell, invoke the helper as .\cpp\build.ps1. Environment settings persist for that session, so clear task-specific overrides when finished with Remove-Item Env:TEMPO_WPI_PYTHON (PowerShell) or set TEMPO_WPI_PYTHON= (cmd).

The default CMake target is WPILib-free. Java’s build checks the adapter headers/compilation, and the packaged consumer and scheduler tests in tests/robot/cpp_docs are a separate gate. Its Linux CI helper and requirements are documented in testing.md. A Windows CTest pass alone does not claim that consumer gate ran on Windows.

4. Example simulation and passing results

Stage the intended 2026 JAR on JDK 17, then run the tests/robot/java_sim/ project. Start at the repository root:

CMD
cd java
gradlew.bat publishMavenPublicationToTempoVendordepRepository -PwpilibYear=2026
cd ..
cd tests\robot\java_sim
gradlew.bat test --no-daemon

The example resolves com.tempo exclusively from this checkout’s java/build/vendordep-stage/maven/. Confirm the source revision and fresh publication, because Maven local cannot substitute another checkout’s JAR. Keep Spotless enabled, and add --rerun-tasks when cached results would hide a changed artifact.

SuiteRequired result
RustThe selected suite completes without failures; fmt and Clippy pass
JavaBuild and tests pass, including header/adapter checks and selected-season packaging
Pythonrun-suites.sh passes with RobotPy coverage; it skips the second run when both interpreters share an environment
C++CTest runs the intended configuration and reports no failures with the fresh DLL
Java exampleSelected 2026 import, fresh checkout-staged JAR, no failures; only explicitly environment-gated benchmark skips

Record skips and their reason. A skipped WPILib suite is not an acceptable substitute for RobotPy coverage.

For the wasm commands, use the wasm steps in testing.md, because a core-only run does not cover that surface.

5. Diagnosing platform and artifact failures

  • UnsatisfiedLinkError or a missing native symbol: inspect the library actually loaded and the JAR’s platform entries. Java’s NativeLoader prefers an explicit usable jna.library.path, then its packaged native, then the system loader. A stale ambient copy can invalidate other bindings too (see ffi-contract.md).
  • Missing Java methods in the Java example: compare the example source revision with the locally published Tempo artifact and republish the intended JAR.
  • A plain MSVC ctest without a configuration: rerun with -C Release or the configuration being tested, and confirm that the suite executes.
  • Hash mismatch: inspect line endings and the exact changed source/fixture before following the pin procedure. Never change an expectation to make a Windows run pass.
  • Files changing during a build: capture Git status and timestamps and inspect sync/backup interference. A platform-specific failure is a finding until its cause is established.

6. Deploying to a roboRIO (WPILib 2026)

The JAR must contain linux-armel/libtempo_core.so, built for 32-bit ARM soft-float, and Windows cross-compiles it when the FRC toolchain is installed. Compiler lookup follows FRC_GCC_PATH, -PfrcGccPath, then the standard WPILib roboRIO toolchain location. A missing compiler can skip the cross-build, and verifyNativePackaging turns the missing required native into a failure.

Publish on JDK 17 without bypassing the roboRIO requirement:

CMD
cd java
gradlew.bat publishMavenPublicationToTempoVendordepRepository -PwpilibYear=2026
cd ..

The natives packaged in ... line must include linux-armel. The other season’s SystemCore native is advisory for 2026, so its absence does not require a bypass. -PallowMissingRoboRioNative is for desk-only builds and must never be used for a roboRIO deployment, and stale-native bypasses do not produce a verified deploy artifact either.

After publication, run the full example gate on JDK 17. PowerShell, from the Tempo root:

POWERSHELL
Push-Location .\tests\robot\java_sim
.\gradlew.bat test --no-daemon
Pop-Location

This does not replace the Python/C++/wasm gates. Before deployment, Constants.robot must select the intended physical robot (COMPBOT or PRACBOT), and SIMBOT is blocked by CheckDeploy. The example project’s .wpilib/wpilib_preferences.json supplies the team. Confirm the actual robot network and configuration before deployment. Only after the required checks and deployment approval, run .\gradlew.bat deploy from tests/robot/java_sim/.

After deploying, confirm the log’s build metadata, a disabled warmup with no [Tempo] warmup skipped line, and that the native loaded, before driving. Capture the .wpilog, battery voltage, routine, alliance and timestamp of each run. Watch start latency, TempoDiag/Seq/*, command-path mismatch, hardware signal age and tracking error. There is no host-sequencer fallback to arm.

7. Building for SystemCore (WPILib 2027)

Use JDK 25 and the matched WPILib/GradleRIO bundle. The same core source tree produces tempo-java-0.9.0-wpilib2027-<bundle>.jar, and it must carry linux-aarch64/libtempo_core.so for 64-bit ARM Linux.

Compiler selection uses SYSTEMCORE_GCC_PATH / -PsystemcoreGccPath, installed WPILib SystemCore toolchains, then an AArch64 GCC on PATH. The alpha7 and alpha8 C++ headers require a GCC 13+ SystemCore toolchain for complete release packaging, and the alpha-7 and alpha-8 WPILib installs carry GCC 14.3.0. alpha8 is the configured default (java/build.gradle) and -Pwpilib2027Bundle=alpha7 or alpha6 selects another row.

A Windows-hosted compatible AArch64 compiler can be supplied explicitly, and a Linux build machine or WSL build is another artifact source, with its own recorded test scope. Install the Rust target in the environment that builds it:

CMD
rustup target add aarch64-unknown-linux-gnu

On JDK 25 with the matching compiler configured:

CMD
cd java
gradlew.bat publishMavenPublicationToTempoVendordepRepository -PwpilibYear=2027
cd ..

Require linux-aarch64 in the packaging output and do not use -PallowMissingSystemcoreNative for a SystemCore deployment. A core build does not prove that the separate TempoExample 2027 branch, which is not part of this repository, is deployable, so verify its current GradleRIO/vendor prerequisites and its own checks first.

Reuse the normal build directories. Keep per-run reports small, remove temporary artifacts in the same session, and check available disk space before/after large loops. Never create a new whole build tree per attempt.

esc

Loading search...