Skip to content

Commit b9147c6

Browse files
samfreundcswilson252
authored andcommitted
Make 2027 build (PhotonVision#2422)
This PR updates everything for 2027. This includes removing GradleRIO, simplifying our wpilib version defintion, updating APIs, updating to Java 21, and more. Note that photonlibpy is failing because robotpy has not been fully updated yet. Examples are omitted because they need to be updated for our new PhotonPoseEstimator API and still need some changes from WPILIB. photonlib windows build is failing because we're waiting for some upstream changes. Finally, images are failing since they don't have Java 21 yet.
1 parent 60ccad7 commit b9147c6

111 files changed

Lines changed: 629 additions & 577 deletions

File tree

Some content is hidden

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

.github/workflows/build.yml

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,9 @@ jobs:
4545
# fetch-depth: 0
4646
# - name: Fetch tags
4747
# run: git fetch --tags --force
48-
# - name: Install Java 17
49-
# uses: actions/setup-java@v5
48+
# - uses: actions/setup-java@v5
5049
# with:
51-
# java-version: 17
50+
# java-version: 21
5251
# distribution: temurin
5352
# - name: Install SystemCore Toolchain
5453
# run: ./gradlew installSystemCoreToolchain
@@ -104,10 +103,9 @@ jobs:
104103
fetch-depth: 0
105104
- name: Fetch tags
106105
run: git fetch --tags --force
107-
- name: Install Java 17
108-
uses: actions/setup-java@v5
106+
- uses: actions/setup-java@v5
109107
with:
110-
java-version: 17
108+
java-version: 21
111109
distribution: temurin
112110
- name: Install pnpm
113111
uses: pnpm/action-setup@v5
@@ -145,10 +143,9 @@ jobs:
145143
fetch-depth: 0
146144
- name: Fetch tags
147145
run: git fetch --tags --force
148-
- name: Install Java 17
149-
uses: actions/setup-java@v5
146+
- uses: actions/setup-java@v5
150147
with:
151-
java-version: 17
148+
java-version: 21
152149
distribution: temurin
153150
- name: Install pnpm
154151
uses: pnpm/action-setup@v5
@@ -198,10 +195,9 @@ jobs:
198195
with:
199196
fetch-depth: 0
200197

201-
- name: Install Java 17
202-
uses: actions/setup-java@v5
198+
- uses: actions/setup-java@v5
203199
with:
204-
java-version: 17
200+
java-version: 21
205201
distribution: temurin
206202

207203
# grab all tags
@@ -240,10 +236,9 @@ jobs:
240236
- uses: actions/checkout@v6
241237
with:
242238
fetch-depth: 0
243-
- name: Install Java 17
244-
uses: actions/setup-java@v5
239+
- uses: actions/setup-java@v5
245240
with:
246-
java-version: 17
241+
java-version: 21
247242
distribution: temurin
248243
- run: git fetch --tags --force
249244
- run: ./gradlew photon-targeting:build photon-lib:build
@@ -265,13 +260,13 @@ jobs:
265260
fail-fast: false
266261
matrix:
267262
include:
268-
- container: wpilib/systemcore-cross-ubuntu:2025-24.04
263+
- container: wpilib/systemcore-cross-ubuntu:2027-24.04
269264
artifact-name: SystemCore
270265
build-options: "-Ponlylinuxsystemcore"
271-
- container: wpilib/raspbian-cross-ubuntu:bookworm-24.04
266+
- container: wpilib/raspbian-cross-ubuntu:2027-bookworm-24.04
272267
artifact-name: Raspbian
273268
build-options: "-Ponlylinuxarm32"
274-
- container: wpilib/aarch64-cross-ubuntu:bookworm-24.04
269+
- container: wpilib/aarch64-cross-ubuntu:2027-bookworm-24.04
275270
artifact-name: Aarch64
276271
build-options: "-Ponlylinuxarm64"
277272

@@ -347,10 +342,9 @@ jobs:
347342
- uses: actions/checkout@v6
348343
with:
349344
fetch-depth: 0
350-
- name: Install Java 17
351-
uses: actions/setup-java@v5
345+
- uses: actions/setup-java@v5
352346
with:
353-
java-version: 17
347+
java-version: 21
354348
distribution: temurin
355349
- name: Install pnpm
356350
uses: pnpm/action-setup@v5
@@ -431,15 +425,16 @@ jobs:
431425
artifact-name: photonvision-*-winx64.jar
432426
- os: macos-latest
433427
artifact-name: photonvision-*-macarm64.jar
428+
- os: ubuntu-24.04-arm
429+
artifact-name: photonvision-*-linuxarm64.jar
434430

435431

436432
runs-on: ${{ matrix.os }}
437433

438434
steps:
439-
- name: Install Java 17
440-
uses: actions/setup-java@v5
435+
- uses: actions/setup-java@v5
441436
with:
442-
java-version: 17
437+
java-version: 21
443438
distribution: temurin
444439
- uses: actions/download-artifact@v8
445440
with:

.github/workflows/dependency-submission.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@ jobs:
1313
steps:
1414
- name: Checkout sources
1515
uses: actions/checkout@v6
16-
- name: Setup Java
17-
uses: actions/setup-java@v5
16+
- uses: actions/setup-java@v5
1817
with:
1918
distribution: 'temurin'
20-
java-version: 17
19+
java-version: 21
2120
- name: Generate and submit dependency graph
2221
uses: gradle/actions/dependency-submission@v5

.github/workflows/lint-format.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
fetch-depth: 0
6262
- uses: actions/setup-java@v5
6363
with:
64-
java-version: 17
64+
java-version: 21
6565
distribution: temurin
6666
- run: |
6767
set +e

.github/workflows/photon-api-docs.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,9 @@ jobs:
6060
fetch-depth: 0
6161
- name: Fetch tags
6262
run: git fetch --tags --force
63-
- name: Install Java 17
64-
uses: actions/setup-java@v5
63+
- uses: actions/setup-java@v5
6564
with:
66-
java-version: 17
65+
java-version: 21
6766
distribution: temurin
6867
- name: Build javadocs/doxygen
6968
run: |

build.gradle

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ plugins {
44
id "cpp"
55
id "com.diffplug.spotless" version "8.1.0"
66
id "org.wpilib.WPILibRepositoriesPlugin" version "2027.0.0"
7-
id "org.wpilib.GradleRIO" version "2027.0.0-alpha-2"
8-
id 'org.photonvision.tools.WpilibTools' version '2.4.1-photon'
9-
id 'com.google.protobuf' version '0.9.3' apply false
7+
id 'org.wpilib.NativeUtils' version '2027.4.1' apply false
8+
id 'org.wpilib.DeployUtils' version '2027.1.0' apply false
9+
id 'org.photonvision.tools.WpilibTools' version '3.0.0-photon'
10+
id 'com.google.protobuf' version '0.9.5' apply false
1011
id 'org.wpilib.GradleJni' version '2027.0.0'
1112
id "org.ysb33r.doxygen" version "2.0.0" apply false
12-
id 'com.gradleup.shadow' version '8.3.4' apply false
13+
id 'com.gradleup.shadow' version '9.0.0' apply false
1314
id "com.github.node-gradle.node" version "7.0.1" apply false
1415
}
1516

@@ -33,16 +34,20 @@ ext.allOutputsFolder = file("$project.buildDir/outputs")
3334
apply from: "versioningHelper.gradle"
3435

3536
ext {
36-
wpilibVersion = "2027.0.0-alpha-3-203-g0001ddc7e"
37+
wpilibVersion = "2027.0.0-alpha-4"
3738
wpimathVersion = wpilibVersion
3839
openCVYear = "2025"
3940
openCVversion = "4.10.0-3"
41+
ejmlVersion = "0.43.1";
42+
jacksonVersion = "2.15.2";
43+
quickbufVersion = "1.3.3";
44+
4045
javalinVersion = "6.7.0"
4146
libcameraDriverVersion = "v2026.0.0"
4247
rknnVersion = "dev-v2026.0.1-1-g89b2888"
4348
rubikVersion = "dev-v2026.0.1-4-g13d6279"
44-
frcYear = "2027_alpha1"
45-
mrcalVersion = "dev-v2026.0.0-1-g239d80e";
49+
frcYear = "2027_alpha4"
50+
mrcalVersion = "v2027.0.1";
4651

4752
pubVersion = versionString
4853
isDev = pubVersion.startsWith("dev")
@@ -95,7 +100,7 @@ spotless {
95100
}
96101

97102
wrapper {
98-
gradleVersion = '8.14.3'
103+
gradleVersion = '9.2.0'
99104
}
100105

101106
ext.getCurrentArch = {

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=permwrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

photon-core/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ext.licenseFile = file("$rootDir/LICENSE")
66
ext.externalLicensesFolder = file("$rootDir/ExternalLicenses")
77
apply from: "${rootDir}/shared/common.gradle"
88

9-
wpilibTools.deps.wpilibVersion = wpi.versions.wpilibVersion.get()
9+
wpilibTools.deps.wpilibVersion = wpilibVersion
1010

1111
def nativeConfigName = 'wpilibNatives'
1212
configurations {
@@ -28,7 +28,7 @@ dependencies {
2828
wpilibNatives wpilibTools.deps.wpilib("cscore")
2929
wpilibNatives wpilibTools.deps.wpilib("apriltag")
3030
wpilibNatives wpilibTools.deps.wpilib("hal")
31-
wpilibNatives wpilibTools.deps.wpilibOpenCv("frc" + openCVYear, wpi.versions.opencvVersion.get())
31+
wpilibNatives wpilibTools.deps.wpilibOpenCv("frc" + openCVYear, openCVversion)
3232

3333
// These stay as implementation dependencies since they don't have native code that gets packaged
3434
implementation 'org.zeroturnaround:zt-zip:1.14'

photon-core/src/main/java/org/photonvision/common/dataflow/networktables/NetworkTablesManager.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
import org.photonvision.common.networking.NetworkUtils;
3636
import org.photonvision.common.util.TimedTaskManager;
3737
import org.photonvision.common.util.file.JacksonUtils;
38+
import org.wpilib.driverstation.Alert;
39+
import org.wpilib.driverstation.Alert.Level;
3840
import org.wpilib.networktables.LogMessage;
3941
import org.wpilib.networktables.MultiSubscriber;
4042
import org.wpilib.networktables.NetworkTable;
@@ -43,8 +45,6 @@
4345
import org.wpilib.networktables.NetworkTableInstance;
4446
import org.wpilib.networktables.StringSubscriber;
4547
import org.wpilib.smartdashboard.SmartDashboard;
46-
import org.wpilib.util.Alert;
47-
import org.wpilib.util.Alert.AlertType;
4848
import org.wpilib.vision.apriltag.AprilTagFieldLayout;
4949
import org.wpilib.vision.camera.CameraServerJNI;
5050

@@ -66,9 +66,9 @@ public class NetworkTablesManager {
6666
new MultiSubscriber(ntInstance, new String[] {kRootTableName + "/" + kCoprocTableName + "/"});
6767

6868
// Creating the alert up here since it should be persistent
69-
private final Alert conflictAlert = new Alert("PhotonAlerts", "", AlertType.kWarning);
69+
private final Alert conflictAlert = new Alert("PhotonAlerts", "", Level.MEDIUM);
7070

71-
private final Alert mismatchAlert = new Alert("PhotonAlerts", "", AlertType.kWarning);
71+
private final Alert mismatchAlert = new Alert("PhotonAlerts", "", Level.MEDIUM);
7272

7373
public boolean conflictingHostname = false;
7474
public String conflictingCameras = "";

photon-core/src/main/java/org/photonvision/common/hardware/HardwareManager.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
import org.photonvision.common.logging.LogGroup;
3737
import org.photonvision.common.logging.Logger;
3838
import org.photonvision.common.util.ShellExec;
39-
import org.photonvision.common.util.TimedTaskManager;
4039
import org.wpilib.networktables.IntegerPublisher;
4140
import org.wpilib.networktables.IntegerSubscriber;
4241

photon-core/src/main/java/org/photonvision/common/hardware/OsImageData.java

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -35,30 +35,8 @@
3535
public class OsImageData {
3636
private static final Logger logger = new Logger(OsImageData.class, LogGroup.General);
3737

38-
private static Path imageVersionFile = Path.of("/opt/photonvision/image-version");
3938
private static Path imageMetadataFile = Path.of("/opt/photonvision/image-version.json");
4039

41-
/**
42-
* The OS image version string, if available. This is legacy, use {@link ImageMetadata}.
43-
* Deprecated for removal in 2027.
44-
*/
45-
@Deprecated public static final Optional<String> IMAGE_VERSION = getImageVersion();
46-
47-
private static Optional<String> getImageVersion() {
48-
if (!imageVersionFile.toFile().exists()) {
49-
logger.warn("Photon cannot locate base OS image version at " + imageVersionFile.toString());
50-
return Optional.empty();
51-
}
52-
53-
try {
54-
return Optional.of(Files.readString(imageVersionFile).strip());
55-
} catch (IOException e) {
56-
logger.error("Couldn't read image-version file", e);
57-
}
58-
59-
return Optional.empty();
60-
}
61-
6240
public static final Optional<ImageMetadata> IMAGE_METADATA = getImageMetadata();
6341

6442
public static record ImageMetadata(

0 commit comments

Comments
 (0)