-
Notifications
You must be signed in to change notification settings - Fork 8
Migrate to SDK.v3 - protocol.v2 with decode #84
Conversation
Signed-off-by: Alexander Bezzubov <bzz@apache.org>
Signed-off-by: Alexander Bezzubov <bzz@apache.org>
Signed-off-by: Alexander Bezzubov <bzz@apache.org>
Many tests are Ignored or are expected to fail, due to rest of the native API not implemented yet. Signed-off-by: Alexander Bezzubov <bzz@apache.org>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First round is done! I don't understand most of the JNI code, but at least the Scala code is clear. Not marked as approved because there are still few changes needed (like mentioned in the FIXME
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments in passing.
It's funny, because I was just feeling much more comfortable with the C++ portion. Which I suppose says something about my poor life-choices. 😀 |
Signed-off-by: Alexander Bezzubov <bzz@apache.org>
It also adds a temp job that will be kept updated and is expected to pass for bblfsh#83 and track it's progress. Signed-off-by: Alexander Bezzubov <bzz@apache.org>
Signed-off-by: Alexander Bezzubov <bzz@apache.org>
Signed-off-by: Alexander Bezzubov <bzz@apache.org>
CI is expected to have 1 profile that is passing now. Initial feedback addressed. 2 things that are left as are waiting for the feedback:
And a CI fix for |
64f96a5
to
18a67bc
Compare
Signed-off-by: Alexander Bezzubov <bzz@apache.org>
Signed-off-by: Alexander Bezzubov <bzz@apache.org>
Signed-off-by: Alexander Bezzubov <bzz@apache.org>
9a7ff1f
to
bde14f9
Compare
Only tests that are passing on V2 are currently enabled for every PR. Signed-off-by: Alexander Bezzubov <bzz@apache.org>
@creachadair @dennwc all feedback was addressed, CI v2-enabled profile is green and it's ready to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few questions left.
object BblfshClient { | ||
val DEFAULT_MAX_MSG_SIZE = 100 * 1024 * 1024 // bytes | ||
|
||
val PreOrder = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These don't seem to be used anywhere—are they mean to support the iterator implementation that is coming later?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, exactly - this is part of the old code that was moved forward and going to be used for iterator implementation.
extern const char *CLS_CTX; | ||
|
||
JNIEnv *getJNIEnv(); | ||
jobject NewJavaObject(JNIEnv *, const char *, const char *, ...); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I follow the naming convention in use here. Google style is MixedCaseLeadingCaps
for classes and functions (with a carve-out for class accessors to follow snake_case
style). But we seem to be mixing that and conventional camel.
(I'm not wedded to Google style, I only mentioned that because you included a clang-format config based on that style)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an old code, I belive it follow the same that was used in libuast.
TBH Google one from above was just placed randomly, to have at least something, and mostly because of 2-space indentation.
I'm not settled on this one either, but I think it's totally fine to use almost whatever in a the well-localized JNI wrappers themselves.
Will be happy to refactor it, if needed, and add a better formatter config to all the projects later on, as soon as we have something functional in scala-client. For now, I'm mostly not very worried about it because of the limited scope and no expectations for this native piece to grow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this doesn't need to be addressed right now, I just wanted to make a note of it while we're paying attention to this code. 🙂
Signed-off-by: Alexander Bezzubov <bzz@apache.org>
@creachadair I tried to answer all of those and address the feedback, let me know what you think! |
Partially addresses #83
org.bblfsh.client.v2
decode()
androot()
are implementedRight now failing with
java.lang.IllegalStateException: Linux build failed -> fatal error: libuast.h: No such file or directory
A bit improved tests of.decode()
As C++ API does not expose
.Kind()
for nodes, this can be done later, after.load()
is implemented.Main CI is expected to fail due to still missing native API that will be added in separate PRs.