Skip to content
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

Remove listing/titleOrdered/v0. #949

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Remove listing/titleOrdered/v0. #949

wants to merge 6 commits into from

Conversation

mgautierfr
Copy link
Collaborator

@mgautierfr mgautierfr commented Feb 5, 2025

Fix #800

This PR needs testing files from openzim/zim-testing-suite#13
(and a release of zim-testing-suite project to be correctly used here) and so, CI is failing (as expected).
The simpler for locally testing this PR is to copy https://github.com/openzim/zim-testing-suite/tree/no_v0/data/nov0 into you local zim-testing-suite v0.6.0 directory.

This has few consequences on the creation process:
- TitleListingHandle generate only the v1 title listing.
- TitleListingHandle store the dirent only if it is a front article,
  so we can remove the "isFrontArticle" from the dirent.
- We don't have to track titleListingHandle as a special handler and we
  don't need to store `m_titleListBlobOffset`.
- We set title idx pos to 0 in the header.
  So reader part (fast check, getMimeListEndUpperLimit) has to adapt.
- The tricky part is that we still need to create the handtlers dirents
  before setting the entry indexes. This is done through the
  `handler->getDirents()` call.
Reader part now checks the minor version before trying to read offset
in header.
This seems not relevant right now as we have only one category but it will
be when we'll have more.
PR openzim/zim-testing-suite#11 changes the zim
file wikipedia_en_climate_change to a more recent version.

However, no release of zim-testing-suite has been done and no adaptation
on libzim side neither.

It is time to do so. Especially as we will update our testing content.
PR [TOFIX] adds a new "nov0" test category, ie zim files without v0 title
index.

We have to adapt our tests to this.
mgautierfr added a commit to openzim/zim-testing-suite that referenced this pull request Feb 5, 2025
Generated files are using the commands:
```
mkdir data/nov0
scripts/create_test_zimfiles --all src/small_zimfile_data/ data/nov0
zimrecreate data/withns/wikipedia_en_climate_change_mini_2024-06.zim data/nov0/wikipedia_en_climate_change_mini_2024-06.zim
zimrecreate data/withns/wikibooks_be_all_nopic_2017-02.zim data/nov0/wikibooks_be_all_nopic_2017-02.zim
zimsplit data/nov0/wikibooks_be_all_nopic_2017-02.zim --prefix data/nov0/wikibooks_be_all_nopic_2017-02_splitted.zim --size 51200
```

`zimwriterfs`, `zimrecreate`, `zimsplit` are localy build using
- commit b5127fc9 of libzim (commit in PR openzim/libzim#949)
- commit 482a6708 of zimtools (head of PR openzim/zim-tools#452)

Using non released version of libzim was necessary as we need test files
to test the PR and without the PR merged, we cannot release a libzim
generating such kind of files.
@mgautierfr mgautierfr marked this pull request as ready for review February 5, 2025 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove old (v0) titleindex (title pointer list)
1 participant