cpg: Cannot build with -Pexperimental

I tried to build with the following command under bash in Mac:

CPG_PYTHON_VIRTUALENV=py39; gradlew -Pexperimental build

where py39 is environment where I have installed jep. My default java version is 15

$ java -version
java version "15.0.2" 2021-01-19
Java(TM) SE Runtime Environment (build 15.0.2+7-27)
Java HotSpot(TM) 64-Bit Server VM (build 15.0.2+7-27, mixed mode, sharing)

When building, the following errors occur

> Task :cpg-library:test

PythonFrontendTest > testSimpleClass() FAILED
    java.util.concurrent.ExecutionException at PythonFrontendTest.kt:251
        Caused by: java.lang.UnsatisfiedLinkError at ClassLoader.java:2447

PythonFrontendTest > testCtor() FAILED
    java.util.concurrent.ExecutionException at PythonFrontendTest.kt:455
        Caused by: java.lang.UnsatisfiedLinkError at Jep.java:-2

PythonFrontendTest > testSelf() FAILED
    java.util.concurrent.ExecutionException at PythonFrontendTest.kt:369
        Caused by: java.lang.UnsatisfiedLinkError at Jep.java:-2

PythonFrontendTest > testIf() FAILED
    java.util.concurrent.ExecutionException at PythonFrontendTest.kt:207
        Caused by: java.lang.UnsatisfiedLinkError at Jep.java:-2

PythonFrontendTest > testLiteral() FAILED
    java.util.concurrent.ExecutionException at PythonFrontendTest.kt:56
        Caused by: java.lang.UnsatisfiedLinkError at Jep.java:-2

PythonFrontendTest > testFunctionDeclaration() FAILED
    java.util.concurrent.ExecutionException at PythonFrontendTest.kt:111
        Caused by: java.lang.UnsatisfiedLinkError at Jep.java:-2

PythonFrontendTest > testIfExpr() FAILED
    java.util.concurrent.ExecutionException at PythonFrontendTest.kt:312
        Caused by: java.lang.UnsatisfiedLinkError at Jep.java:-2

225 tests completed, 7 failed

I traced the errors, for example, the first one. The first line reads:

java.util.concurrent.ExecutionException: java.lang.UnsatisfiedLinkError: no jep in java.library.path: /Users/chenjie/lab/SDG/cpg/cpg-library/src/main/golang

I am not a go programmer and do not understand what it means. I only need the support of experimental language python and I have installed jep under the environment used for this build. Could you help me?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 16 (9 by maintainers)

Commits related to this issue

Most upvoted comments

@oxisto I confirm that --enable-experimental-python works. I guess the implementation is incomplete, but at least it generates a graph.

$ bin/cpg-neo4j --enable-experimental-python /Users/chenjie/lab/SDG/examples/counter.py
10:32:18,870 INFO  TranslationManager Parsing /Users/chenjie/lab/SDG/examples/counter.py
10:32:19,066 ERROR Jep visit_ClassDef	1182:	This is not (yet) implemented.
10:32:19,321 WARN  TypeManager No frontend available. Be aware that typedef resolving cannot currently be done
10:32:19,324 ERROR Jep visit_ClassDef	1182:	This is not (yet) implemented.

Thank you for the efforts!

@oxisto I confirm that using the suggested way to setup environments, I can successfully build and install.

It would be good to support also the conda way of environments, but I understand that you may have different priorities.