wpilibsuite / allwpilib

Official Repository of WPILibJ and WPILibC
https://wpilib.org/
Other
1.08k stars 611 forks source link

Using development build fails with missing cscore object file #4263

Closed SherazF closed 2 years ago

SherazF commented 2 years ago

Describe the question you have. A clear and concise description of what you want clarification on. When trying to use the development build, the code would not run and we found that our riolog returned an error of the cscore object file missing. I've left a copy of the riolog below with the errors. We also tried removing all of our camera code and still ran into the same issue.

Additional context java.io.IOException: cscorejni could not be loaded from path or an embedded resource. attempted to load for platform /linux/athena/ Last Load Error: /usr/local/frc/third-party/lib/libcscorejni.so: libwpinet.so: cannot open shared object file: No such file or directory at edu.wpi.first.util.RuntimeLoader.loadLibrary(RuntimeLoader.java:94) at edu.wpi.first.cscore.CameraServerJNI.(CameraServerJNI.java:37) at edu.wpi.first.wpilibj.RobotBase.startRobot(RobotBase.java:406) at frc.robot.Main.main(Main.java:23)

PeterJohnson commented 2 years ago

We recently split the wpinet library out, and GR hasn’t yet been updated to match. We will need to do a 2023 alpha 1 release before development artifacts are easily usable again.

SherazF commented 2 years ago

Is there any current ETA for this? We're interested in using the updated libraries in our offseason, specifically the fixes to the pose estimator.

PeterJohnson commented 2 years ago

We'll talk about it later this week, so probably best case next weekend?

calcmogul commented 2 years ago

You can copy the relevant class from https://github.com/wpilibsuite/allwpilib/tree/main/wpimath/src/main/java/edu/wpi/first/math/estimator in the meantime.

Starlight220 commented 2 years ago

I think 2023 alpha was released, so this can be closed?

calcmogul commented 2 years ago

The alpha 1 build isn't working for me. https://github.com/calcmogul/Robot-2020/

diff --git a/build.gradle b/build.gradle
index af3ff4d..d33c71b 100644
--- a/build.gradle
+++ b/build.gradle
@@ -3,15 +3,15 @@ import org.gradle.internal.os.OperatingSystem
 plugins {
     id "cpp"
     id "google-test-test-suite"
-    id "edu.wpi.first.GradleRIO" version "2022.4.1"
+    id "edu.wpi.first.GradleRIO" version "2023.0.0-alpha-1"
     id "org.ysb33r.doxygen" version "0.7.0"
 }

 // For using remote development artifacts
-// wpi.maven.useLocal = false
-// wpi.maven.useDevelopment = true
-// wpi.versions.wpilibVersion = '2022.+'
-// wpi.versions.wpimathVersion = '2022.+'
+wpi.maven.useLocal = false
+wpi.maven.useDevelopment = true
+wpi.versions.wpilibVersion = '2023.+'
+wpi.versions.wpimathVersion = '2023.+'

 // For using local development artifacts
 // wpi.maven.useFrcMavenLocalDevelopment = true
FAILURE: Build failed with an exception.

* Where:
Build file '/home/tav/git/Robot-2020/build.gradle' line: 6

* What went wrong:
Plugin [id: 'edu.wpi.first.GradleRIO', version: '2023.0.0-alpha-1'] was not found in any of the following sources:

- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'edu.wpi.first.GradleRIO:edu.wpi.first.GradleRIO.gradle.plugin:2023.0.0-alpha-1')
  Searched in the following repositories:
    MavenLocal(file:/home/tav/.m2/repository)
    Gradle Central Plugin Repository
    frcHome(file:/home/tav/wpilib/2022/maven)
sciencewhiz commented 2 years ago

Gradlerio isn't published

calcmogul commented 2 years ago

We'll need to do that because builds with WPILib 2023.0.0-alpha-1 and GradleRIO 2022.4.1 fail due to not linking in wpinet.

PeterJohnson commented 2 years ago

We had published it but needed to unpublish it due to some tools not being published. I think those issues have been resolved so we can publish again.

PeterJohnson commented 2 years ago

This should work now (GR 2023.0.0-alpha-1 has been released).

calcmogul commented 2 years ago

It mostly worked. The removal of SpeedController broke the MotorController ABI, and thus REVLib.

/home/tav/.gradle/caches/transforms-3/156d6d5d888d571008412cf4792285e9/transformed/REVLib-cpp-2022.1.1-linuxathenastatic/linux/athena/static/libREVLib.a(CANSparkMaxLowLevel.o):(.data.rel.ro._ZTIN3frc15MotorControllerE[_ZTIN3frc15MotorControllerE]+0x8): undefined reference to `typeinfo for frc::SpeedController'
/home/tav/.gradle/caches/transforms-3/156d6d5d888d571008412cf4792285e9/transformed/REVLib-cpp-2022.1.1-linuxathenastatic/linux/athena/static/libREVLib.a(CANSparkMaxLowLevel.o):(.data.rel.ro+0x20): undefined reference to `frc::SpeedController::SetVoltage(units::unit_t<units::unit<std::ratio<1ll, 1ll>, units::base_unit<std::ratio<2ll, 1ll>, std::ratio<1ll, 1ll>, std::ratio<-3ll, 1ll>, std::ratio<0ll, 1ll>, std::ratio<-1ll, 1ll>, std::ratio<0ll, 1ll>, std::ratio<0ll, 1ll>, std::ratio<0ll, 1ll>, std::ratio<0ll, 1ll> >, std::ratio<0ll, 1ll>, std::ratio<0ll, 1ll> >, double, units::linear_scale>)'
calcmogul commented 2 years ago

^ That's unrelated to this issue though. The alpha release fixed the linkage issue the OP mentioned.