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

Add Windows Support #196

Merged
merged 33 commits into from
Sep 3, 2024
Merged

Add Windows Support #196

merged 33 commits into from
Sep 3, 2024

Conversation

rgaudin
Copy link
Member

@rgaudin rgaudin commented Aug 31, 2024

Added Windows x64 support via libzim 9.2.3-2
Fixed #191
Fixed #91

- self.arch to use lowercase as we expect cibuildwheel to pass amd64 while platform.machine() returns AMD64 on windows
- Added Windows and amd64 as supported (list check)
- Added archive suffix and archive format to support ZIP archive
- Custom rename of arch in filename as openZIM uses x86_64
- Copying dll from bin/ folder (tree is different) and .lib file (not sure if needed)
- Cleaning dll/lib as well
- Setting to the exact nightly date we have it for (not targetting lastest nightly as it requires addtional ZIP handling TBD)
- forcing cibuildwheel to only do windows py312 on amd64 for tests speed
- forcing those wheels on windows branch
Copy link

codecov bot commented Sep 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.44%. Comparing base (0f77346) to head (438dfd1).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #196   +/-   ##
=======================================
  Coverage   93.44%   93.44%           
=======================================
  Files           1        1           
  Lines         519      519           
=======================================
  Hits          485      485           
  Misses         34       34           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Windows has no runtime_library path that's practical for us
  - require user to set PATH specificaly before running python
  - require user to use os.add_dll_directory() before `import python`
  - require user to load libzim DLL (via `ctypes.CDLL()`) in memory before `import python`
  - require us to change our API to use of of those trick before importing wrapper

Most practical solution found was thus to install our companion DLLs (libzim and libicu)
next to the wrapper one.
This is done via a new command that edits the built wheel

Added conditional support for _DEBUG as this is required to link against debug libzim DLLs
@rgaudin rgaudin marked this pull request as ready for review September 3, 2024 16:37
@rgaudin rgaudin merged commit a4ea3c2 into main Sep 3, 2024
25 checks passed
@rgaudin rgaudin deleted the windows branch September 3, 2024 16:37
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.

Update to libzim 9.2 Support Microsoft Windows
1 participant