Python integration into WPILibSuite via gradle #8176
Replies: 3 comments 6 replies
-
semiwrap only supports reading C/C++ header files. My 2c: if a vendor is writing native code in a language other than C or C++, their tooling should be outputting a C or C++ header file to build against anyway for C++ teams. Rust is a good example here, where |
Beta Was this translation helpful? Give feedback.
-
|
I support this. I'm of the opinion that a lot of the reason C++ is so well supported by vendors is the fact that the vendordep template makes it so easy. Finding a way to make python just as easy would be a great way to get vendor support for it. |
Beta Was this translation helpful? Give feedback.
-
|
There's a lot of different things to unpack here.
2/3/4.
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
How?
vendor-templatemodification to publish whls, maybe add an option into the vendordep json.vendor-templatewould have asrc/main/pythonfolder for python files to be combined into the whl.src/main/python/semiwrapwould have thesemiwrapyml files which will try to be generated via scraping thesrc/main/nativeLOCALLY if option is set totruein gradle.semiwrapwould run AFTERdriverandnativeare built using compiled shared object librariessemiwrapwould generate a gradle file to build it that would then be loaded viaapplyin adoLastblock.semiwrapwould package thedriverandnativeshared object files into thewhlwith a generated.pcfile that points the include dir to be/usr/local/include/wpilib/vendorsand lib to be/usr/local/lib/wpilib/vendorswhere the whl setup could place the vendordep.so's into their respective locations and the.pcinto its respective location on the robot.build.gradlefor python projects which "builds"requirements.txtTHEN vendordep python packages from maven repo's in the vendordep json..soto.robotpy/lib/and vendordep native headers to.robot/includefor easier deployment.venv.robotpy/venvdeploy.gradlefor python projects.robotpy/python.robotpy/packagesto python packages on the robotWhy?
It is no secret that vendor support for Python is lacking. RobotPy development feels very different from traditional development within modern FRC since it is very disconnected from standard tooling. SystemCore will be much more capable of handling python and students will want to take advantage of that.
Python development shouldn't feel isolated, more difficult, or more limited than Java or C++ development. Vendors have already sunken in so much time into created their projects for existing languages that it would be considered a "waste" to focus on python when very few teams use it, the trade off isn't there. So we will have to make it easier on them to link and build inside of their existing infrastructure.
It is assumed that vendors update their vendordep gradle's annually so this would line up with those updates if done in the offseason and will especially benefit vendors who develop everything in C++ anyways.
Problems
Unfortunately those who don't use C++ as their
nativecode will have to make their ownsemiwrapyml files for now, it may be possible to read and parse symbols to get classes/functions however that will not resolve parameter parsing unless done with real RE software like Ghidra or a similar tool. We could provide a Ghidra script to generatesemiwrapyml files as well, possibly even a headless one that can run in CI; however the parameter resolution will not be perfect, unless done on a compiled object with debug symbols, it will be a decent start.This is a HUGE undertaking and likely won't be ready until 2027.
Beta Was this translation helpful? Give feedback.
All reactions