openzim / libzim

Reference implementation of the ZIM specification
https://download.openzim.org/release/libzim/
GNU General Public License v2.0
169 stars 50 forks source link

fix: dll export issue on Windows #796

Closed xiaoyifang closed 1 year ago

xiaoyifang commented 1 year ago

supercedes https://github.com/openzim/libzim/pull/792

fixes #795

try to fix the dll export issue on Windows.

The current situation : the dll exported is not whole , most of the methods have not been exported to the dll . which is disscussed in this https://github.com/openzim/libzim/issues/795

The reason: When put LIBZIM_EXPORT_DLL in private_conf, the generated config.h was not included in zim.h . That's why it does not work while -DLIBZIM_EXPORT_DLL works.

The solution: move LIBZIM_EXPORT_DLL to public_conf which will be generate in zim/zim_config.h and put the include file before the macro check

codecov[bot] commented 1 year ago

Codecov Report

Patch and project coverage have no change.

Comparison is base (0f0016c) 57.46% compared to head (0853d1f) 57.46%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #796 +/- ## ======================================= Coverage 57.46% 57.46% ======================================= Files 98 98 Lines 4528 4528 Branches 1903 1903 ======================================= Hits 2602 2602 Misses 674 674 Partials 1252 1252 ``` | [Impacted Files](https://app.codecov.io/gh/openzim/libzim/pull/796?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openzim) | Coverage Δ | | |---|---|---| | [include/zim/archive.h](https://app.codecov.io/gh/openzim/libzim/pull/796?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openzim#diff-aW5jbHVkZS96aW0vYXJjaGl2ZS5o) | `94.82% <ø> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

kelson42 commented 1 year ago

@xiaoyifang What is the status of this PR? Can you please put a PR description?

xiaoyifang commented 1 year ago

Added

xiaoyifang commented 1 year ago

the windows dll generated by vcpkg has 294 methods vcpkg dll.txt

lacks the _toPathOrder method which is used by Archive::iterByTitle

after this fix, the _toPathOrder has been exported to dll also new dll.txt

xiaoyifang commented 1 year ago

zstd failed in the above aarch64_dyn checks

FAILED: subprojects/zstd-1.5.4/build/meson/programs/zstd 
/home/runner/SOURCE/aarch64/aarch64-rpi3-linux-gnu/bin/aarch64-rpi3-linux-gnu-gcc  -o subprojects/zstd-1.5.4/build/meson/programs/zstd subprojects/zstd-1.5.4/build/meson/programs/zstd.p/.._.._.._programs_zstdcli.c.o subprojects/zstd-1.5.4/build/meson/programs/zstd.p/.._.._.._programs_util.c.o subprojects/zstd-1.5.4/build/meson/programs/zstd.p/.._.._.._programs_timefn.c.o subprojects/zstd-1.5.4/build/meson/programs/zstd.p/.._.._.._programs_fileio.c.o subprojects/zstd-1.5.4/build/meson/programs/zstd.p/.._.._.._programs_fileio_asyncio.c.o subprojects/zstd-1.5.4/build/meson/programs/zstd.p/.._.._.._programs_benchfn.c.o subprojects/zstd-1.5.4/build/meson/programs/zstd.p/.._.._.._programs_benchzstd.c.o subprojects/zstd-1.5.4/build/meson/programs/zstd.p/.._.._.._programs_datagen.c.o subprojects/zstd-1.5.4/build/meson/programs/zstd.p/.._.._.._programs_dibio.c.o subprojects/zstd-1.5.4/build/meson/programs/zstd.p/.._.._.._programs_zstdcli_trace.c.o -Wl,--as-needed -Wl,--no-undefined '-Wl,-rpath,$ORIGIN/../lib:$ORIGIN/../../../../xz-5.2.11/src/liblzma:/usr/lib/x86_64-linux-gnu' -Wl,-rpath-link,/__w/libzim/libzim/build/subprojects/zstd-1.5.4/build/meson/lib -Wl,-rpath-link,/__w/libzim/libzim/build/subprojects/xz-5.2.11/src/liblzma -Wl,-rpath-link,/usr/lib/x86_64-linux-gnu -Wl,--start-group subprojects/zstd-1.5.4/build/meson/lib/libzstd.so.1.5.4 subprojects/zstd-1.5.4/build/meson/lib/libzstd_objlib.a subprojects/xz-5.2.11/src/liblzma/liblzma.so -pthread /usr/lib/x86_64-linux-gnu/libz.so -Wl,--end-group
/home/runner/SOURCE/aarch64/aarch64-rpi3-linux-gnu/bin/../lib/gcc/aarch64-rpi3-linux-gnu/13.1.0/../../../../aarch64-rpi3-linux-gnu/bin/ld.bfd: /usr/lib/x86_64-linux-gnu/libz.so: error adding symbols: file in wrong format
collect2: error: ld returned 1 exit status
[146/187] Compiling C object subprojects/zstd-1.5.4/build/meson/programs/zstd-frugal.p/.._.._.._programs_zstdcli.c.o

and this error in https://github.com/openzim/libzim/actions/runs/5080340451/jobs/9127178249?pr=796

Dependency libzstd from subproject subprojects/zstd-1.5.4 found: YES 1.5.4
Run-time dependency xapian-core found: NO (tried pkgconfig)

meson.build:51:17: ERROR: Dependency "xapian-core" not found, tried pkgconfig

Seems not related with this PR @kelson42

kelson42 commented 1 year ago

@mgautierfr Why wasm related CI fails?

mgautierfr commented 1 year ago

Why wasm related CI fails?

This was a network failure.