WALA icon indicating copy to clipboard operation
WALA copied to clipboard

com.ibm.wala.ide JAR is missing dependencies

Open khatchad opened this issue 2 years ago • 4 comments
trafficstars

I don't think the following is working:

https://github.com/wala/WALA/blob/d15ca9b6eac43b9bcca0524ac4068c81cf9ff096/ide/build.properties#L1-L7

I just built locally off of d15ca9b6eac43b9bcca0524ac4068c81cf9ff096. Then, I had a look at ide/build/libs/com.ibm.wala.ide-1.6.1-SNAPSHOT.jar. In that JAR, there's a META-INF directory, but no WALA JARs. The only other things in the JAR are the IDE class files.

$ jar tf ./com.ibm.wala.ide-1.6.1-SNAPSHOT.jar 
META-INF/
META-INF/MANIFEST.MF
com/
com/ibm/
com/ibm/wala/
com/ibm/wala/ide/
com/ibm/wala/ide/classloader/
com/ibm/wala/ide/classloader/EclipseSourceDirectoryTreeModule.class
com/ibm/wala/ide/classloader/EclipseSourceFileModule.class
com/ibm/wala/ide/plugin/
com/ibm/wala/ide/plugin/CorePlugin.class
com/ibm/wala/ide/client/
com/ibm/wala/ide/client/EclipseProjectSourceAnalysisEngine.class
com/ibm/wala/ide/client/EclipseProjectAnalysisEngine.class
com/ibm/wala/ide/ui/
com/ibm/wala/ide/ui/ViewIRAction.class
com/ibm/wala/ide/ui/SWTTreeViewer.class
com/ibm/wala/ide/ui/SWTTreeViewer$GraphViewer.class
com/ibm/wala/ide/ui/ViewIFDSLocalAction.class
com/ibm/wala/ide/ui/IFDSExplorer.class
com/ibm/wala/ide/ui/ViewIFDSLocalAction$Labels.class
com/ibm/wala/ide/ui/AbstractJFaceRunner.class
com/ibm/wala/ide/ui/SWTTreeViewer$GraphViewer$GraphLabelProvider.class
com/ibm/wala/ide/ui/SWTTreeViewer$GraphViewer$GraphContentProvider.class
com/ibm/wala/ide/util/
com/ibm/wala/ide/util/EclipseProjectPath$AnalysisScopeType.class
com/ibm/wala/ide/util/EclipseProjectPath$Loader.class
com/ibm/wala/ide/util/EclipseFileProvider.class
com/ibm/wala/ide/util/EclipseFileProvider$EclipseUtil.class
com/ibm/wala/ide/util/HeadlessUtil.class
com/ibm/wala/ide/util/HeadlessUtil$EclipseCompiler.class
com/ibm/wala/ide/util/EclipseProjectPath$ILoader.class
com/ibm/wala/ide/util/ProgressMonitorDelegate.class
com/ibm/wala/ide/util/EclipseProjectPath.class
com/ibm/wala/ide/util/HeadlessUtil$Parser.class
com/ibm/wala/ide/util/EclipseAnalysisScopeReader.class

My guess is that this is a Gradle problem.

Originally posted by @khatchad in https://github.com/wala/WALA/issues/1260#issuecomment-1505323972

khatchad avatar Apr 13 '23 15:04 khatchad

I don't think Gradle (or even Maven Tycho for that matter) reads builds.properties. What is probably missing is the Gradle analog of https://github.com/wala/WALA/issues/1260#issuecomment-1505304391.

khatchad avatar Apr 13 '23 15:04 khatchad

No other WALA jar files include their dependencies. Is there some reason that this one must?

If yes, then should this jar include all transitive dependencies, or only the subset of transitive dependencies that are also part of WALA?

If just the WALA subset, then presumably there is some mechanism for identifying and making non-WALA dependencies available. Why does that mechanism not also work for dependencies that are part of WALA?

liblit avatar Apr 16 '23 06:04 liblit

I believe that these dependencies are needed because the rest of WALA is no longer being packaged as OSGi components.

The other dependencies are packaged as OSGi components in p2 repos (i.e., Eclipse dependencies).

khatchad avatar Apr 17 '23 17:04 khatchad

More thorough answer:

No other WALA jar files include their dependencies.

Right. That is the ideal situation, especially if you are using a build system that handles dependencies.

Is there some reason that this one must?

Looks like @msridhar does a good job explaining it here: https://github.com/wala/WALA/commit/12dc0600adc56af68fb9a3823f4d65af94c3fe1e.

My thinking, as I mentioned above, is that when the rest of the WALA subprojects were still OSGi components, including the JARs was unnecessary. Now, they are just normal dependencies. And, OSGi components have traditionally included the JARs for "normal" dependencies. That's no longer the case, though; it is now possible to add dependencies from, say, Maven Central, using M2E.

If the com.ibm.wala.ide subproject` gets pulled out into its own repo, we could use Maven and Tycho to include these dependencies from Maven Central.

If yes, then should this jar include all transitive dependencies, or only the subset of transitive dependencies that are also part of WALA?

AFAIK, these JARs suffice. However, I am unsure if they themselves include transitive dependencies. I don't think that they do.

If just the WALA subset, then presumably there is some mechanism for identifying and making non-WALA dependencies available. Why does that mechanism not also work for dependencies that are part of WALA?

We'll need Maven to do that since it's done through Tycho and Tycho does not yet seem to be supported in Gradle.

khatchad avatar Apr 27 '23 14:04 khatchad