-
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move to libzim7 #72
Move to libzim7 #72
Conversation
@kelvinhammond Thank you for your PR. Should I try to build it and see how we could use it with mwoffliner? |
@kelson42 Its not quite ready yet, the creator doesn't work because there are some issues with accessing the javascript objects via a thread. I'm working on figuring that out. Single threaded might work but its missing some functions such as add illustration etc. |
@kelvinhammond FYI We have also made a new maintenance release of libzim, the version 7.1.0 https://download.openzim.org/release/libzim/. Nothing really important for you, but please use it if possible. Here is the changelog https://github.com/openzim/libzim/blob/master/ChangeLog |
@kelvinhammond Any news on this PR? Is there anything which can be done to help you to make it ready for review? |
@kelson42 Sorry about the delay, I've been busy with life. I'll get started on this gain this weekend and hopefully finish this up. |
6683281
to
5a8c7c2
Compare
Rebase from master and force pushed with lease to this branch. |
@@ -1,13 +1,16 @@ | |||
{ | |||
"name": "@openzim/libzim", | |||
"main": "dist/index.js", | |||
"types": "dist/index.d.js", | |||
"version": "2.4.4", | |||
"description": "Libzim bindings for NodeJS", | |||
"scripts": { | |||
"clean": "rm -rf dist build/native/build", | |||
"tsc": "tsc", |
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.
We could probably remove this, no longer required, just use src/index.js
directly. Typescript applications can automatically source the src/index.d.ts
that is provided in the types
config here. Tests are in typescript.
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.
No opinion on this...
@kelson42 Can someone review this? I've basically rewritten the library again so that it supports the new libzim7 architecture. I'll updated mwoffliner after this has been merged and released. |
26e3412
to
229dbf8
Compare
Codecov Report
@@ Coverage Diff @@
## master #72 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 1
Lines 1 1
=========================================
Hits 1 1 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Not sure how to fix the CI builds. Some of the builds use node 12 which is end of life this month. The ones that use node 14x+ pass. Can someone update those? Codefactor is currently outdated and does not currently align with the CPPLint.cfg in the project for some reason. |
@kelvinhammond |
Done, and all the CI pass, so if something does not anymore with this PR. This is probably a regression. BTW, we have meanwhile a libzim7.2.0 released at https://download.openzim.org/release/libzim/ and you can also anytime test with the cutting edge nightly at https://download.openzim.org/nightly/ (a few improvements have been done after your reported a problem and might be useful for you). If necessary, we could consider a patch release "just for you" getting the latest codebase for node-libzim 2.5.0 |
I'll make that push / commit soon then |
Its ready |
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.
@kelvinhammond So great to read we near us to the end of this PR! But before diving in details, my first points are:
- What about the macos CI, why does it fail?
- We should also look to the Codefactor fail (but probably far easier to fix).
- The branch should be rebased on
origin/master
@kelson42 It says node 14x but then I see this |
It seems to be a weakness in cpplint! cpplint/cpplint#65 |
Still waiting on the node-addon-api team for a fix, not sure when they'll have something. Any ideas on what to do next? |
@kelvinhammond What is exactly the impact of the nodejs "bug" in mwoffliner? Is that aporadic, systematic? |
@kelson42 The issue happens on pretty much every run, it is reproducible. |
@kelvinhammond Would that be wise/workable to start a PR on mwoffliner to adapt the code to new libzim7? |
I've already started looking at mwoffliner |
@kelvinhammond What about merging this PR and opening a dedicated ticket for the crash scenario? This would make it easier to move on I believe. |
The test-mem-leak test does not pass because of this and also will not work with larger zim files because of this bug. |
@kelson42 @mgautierfr Does this seem normal for speed on an ssd laptop?
|
@kelvinhammond I'm not sure to understand the question. Where this log comes from. What has been done to get it? |
I was testing libzim calls and it was doing about 52 iterations per second which seemed kinda slow. I wanted to know if this was normal or if there was a bottleneck somewhere. |
@kelvinhammond Unfortunately I have no opinion on this |
Iterations on what ? In any case, it seems a bit slow yes. |
I seem to be stuck with the nodejs bug at the moment, not sure what I should do from here. |
@kelvinhammond Yes, not easy. I would recommend to push on the mwoffliner front in the meantime, so we will be ready there too when this bug will be fixed. |
@kelvinhammond libzim8.0.0 has been published. |
- getContentProvider has replaced contentProvider object - getIndexData has replaced indexData similar to getContentProvider
I think this PR is ready to go, what do we need to do next? |
@kelvinhammond Agree with you, but before merging, can you please open a ticket with a clear description of the problem/regression please? |
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.
@kelvinhammond Thank you so much for the work on this big and crucial PR
Fixes #69
Fixes #79
This is a work in progress. The test script is what I'm using to test things as I develop, I'll add proper tests later. Once I figure out the threading issues I'll remove / cleanup the code.
Let me know if you want the API changed. I went with accessor methods for some of the C++ class methods because that is the current javascript style. This code could be dried out with all the try catch stuff but then it ends up looking a bit unwieldy so its not dry for readability and flexibility in this way.