Skip to content

[wpimath, wpiutil]: Specify that java_multiple_files is true in Protobuf files and regenerate#8555

Open
cswilson252 wants to merge 15 commits intowpilibsuite:2027from
cswilson252:javaMultipleProtobufAttrib
Open

[wpimath, wpiutil]: Specify that java_multiple_files is true in Protobuf files and regenerate#8555
cswilson252 wants to merge 15 commits intowpilibsuite:2027from
cswilson252:javaMultipleProtobufAttrib

Conversation

@cswilson252
Copy link
Contributor

Closes #8256

@cswilson252 cswilson252 requested review from a team and PeterJohnson as code owners January 8, 2026 04:20
@github-actions github-actions bot added component: wpiutil Utility library component: wpimath Math library 2027 2027 target labels Jan 8, 2026
@KangarooKoala
Copy link
Contributor

For the aid of other reviewers, I could run the below commands in zsh on 75d0211 without any output from git diff:

% git restore --source $(git merge-base 2027 HEAD) -- $(find wpimath/src -type f -path '*/java/*' -not -path '*/generated/*')
% sed -e 's/^\(import .*proto\.\)[^.]*\.\(Protobuf[a-zA-Z0-9]*;\)/\1\2/' -i .old $(find wpimath/src -type f)
% git diff

(% is the command prompt)

@Gold856
Copy link
Member

Gold856 commented Jan 13, 2026

This should probably also set the outer class name, since that's what the original issue was about. Probably want to call it something like Protobuf<name>Descriptor to differentiate from the other classes (both the normal classes and the other protobuf classes).

@cswilson252
Copy link
Contributor Author

This should probably also set the outer class name, since that's what the original issue was about. Probably want to call it something like Protobuf<name>Descriptor to differentiate from the other classes (both the normal classes and the other protobuf classes).

the outer class name of the .java generated files, or the .proto files themselves?

@Gold856
Copy link
Member

Gold856 commented Jan 15, 2026

The Java generated files. I really don’t want to see protobuf_name_descriptor.h in includes.

Copy link
Member

@Gold856 Gold856 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use option java_outer_classname in the .proto file to rename the classes. You'll have to use a name other than a Protobuf prefix because of the name conflict with ProtobufTrajectory. Protobuf<Name>Descriptor is probably fine. Also, resolve all merge conflicts.

@cswilson252 cswilson252 requested review from a team as code owners January 31, 2026 06:08
@cswilson252 cswilson252 requested a review from a team as a code owner January 31, 2026 06:08
@github-actions github-actions bot added component: ntcore NetworkTables library component: wpilibj WPILib Java component: wpilibc WPILib C++ component: hal Hardware Abstraction Layer component: examples labels Jan 31, 2026
@cswilson252
Copy link
Contributor Author

ok this PR is kinda broken again 😭 on to v3 I guess. thanks a lot #8468

@cswilson252 cswilson252 reopened this Jan 31, 2026
@github-actions github-actions bot removed component: ntcore NetworkTables library component: wpilibj WPILib Java component: wpilibc WPILib C++ component: hal Hardware Abstraction Layer component: examples labels Jan 31, 2026
@cswilson252 cswilson252 requested a review from Gold856 January 31, 2026 06:33
@KangarooKoala
Copy link
Contributor

You'll need to delete the old generated Java protobuf files (e.g., proto/Spline.java, proto/ProtobufController.java, proto/ProtobufPlant.java, etc.). The pregenerate CI failing also suggests you'll need to regenerate quickbuf and nanopb because of the changes to how linear system is organized.
The easiest approach will probably be to delete all of the generated Java protobuf files and then rerun wpimath/generate_quickbuf.py. You'll need to rerun wpimath/generate_quickbuf.py anyways, and deleting every file is simpler/easier than selectively deleting around a dozen files. (In the VSCode file tree, just click the first file in the directory, shift + click the last file (every file should be selected), and press delete.)

@cswilson252
Copy link
Contributor Author

You'll need to delete the old generated Java protobuf files (e.g., proto/Spline.java, proto/ProtobufController.java, proto/ProtobufPlant.java, etc.). The pregenerate CI failing also suggests you'll need to regenerate quickbuf and nanopb because of the changes to how linear system is organized. The easiest approach will probably be to delete all of the generated Java protobuf files and then rerun wpimath/generate_quickbuf.py. You'll need to rerun wpimath/generate_quickbuf.py anyways, and deleting every file is simpler/easier than selectively deleting around a dozen files. (In the VSCode file tree, just click the first file in the directory, shift + click the last file (every file should be selected), and press delete.)

done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2027 2027 target component: wpimath Math library component: wpiutil Utility library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants