-
Notifications
You must be signed in to change notification settings - Fork 28
cibuildwheel-related work #369
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
Conversation
manually updated cfx_seekablestreamproxy.cpp to newer pdfium version tested that patches apply and build on little endian
@wojiushixiaobai FYI, as you seem to be using this patch downstream already: |
see PR comment above
Thanks @wojiushixiaobai for noticing
a14e153
to
5d4f312
Compare
try to fix error: "Unrecognized named-value: 'matrix'"
I'm starting to notice I might not be too happy with cibuildwheel... The abstraction layer may be convenient, but it is also restrictive. Unfortunately, I don't know docker yet, |
Ok, I made some progress to get docker (and cibuildwheel) running locally on Fedora after all: sudo dnf in moby-engine # this provides the docker command
sudo systemctl start docker
sudo systemctl enable docker
sudo usermod -aG docker $USER
# then reboot, e.g. via `systemctl reboot` Then make a fresh checkout of pypdfium2 (in particular, to avoid an existing toolchained checkout), otherwise you might get a halt on the "Copy project into container" step: git clone https://github.com/pypdfium2-team/pypdfium2.git pypdfium2_fresh
cd pypdfium2_fresh/
git checkout cibuildwheel # current dev branch Now we should be ready to run cibuildwheel: export CIBW_BUILD="cp38-manylinux_x86_64" # p.ex.
export CIBW_BEFORE_BUILD="python setupsrc/pypdfium2_setup/build_native.py --vendor icu"
export CIBW_ENVIRONMENT="PDFIUM_PLATFORM=sourcebuild"
export CIBW_BEFORE_ALL_LINUX="dnf -y install gn ninja-build freetype-devel glib2-devel lcms2-devel libjpeg-devel libpng-devel libtiff-devel openjpeg2-devel zlib-devel"
cibuildwheel . --output-dir wheelhouse We can test the resulting wheel in a virtual env: python3 -m venv testenv
./testenv/bin/pip install wheelhouse/pypdfium2-*-py3-none-manylinux_2_28_x86_64.whl
./testenv/bin/pypdfium2 -v
./testenv/bin/pip install pillow
mkdir out
./testenv/bin/pypdfium2 render ~/Downloads/$SOME_DOC.pdf --scale 3 -o out/ |
393bf55
to
e168ef8
Compare
I believe this is ready for merge. @wojiushixiaobai If you have anything to add, feel free to suggest changes and I'll try to incorporate them in main or a follow-up PR. |
@wojiushixiaobai Also, I just field IBM/actionspz#37 as you suggested on #339 (comment). |
@@ -19,8 +19,9 @@ jobs: | |||
fail-fast: false | |||
matrix: | |||
# On GH actions, macOS <=13 is Intel, whereas macOS >=14 will be ARM64 | |||
# Google's toolchain doesn't seem to run on Linux arm64 natively. The toolchain-free build (or cross-compilation from x86_64) should work, though. | |||
os: ['ubuntu-latest', 'macos-13', 'macos-latest', 'windows-latest'] # 'ubuntu-24.04-arm' | |||
# Google's toolchain doesn't seem to run on Linux/Windows arm64 natively. The toolchain-free build (or cross-compilation from x86_64) should work, though. |
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.
xxx: native sourcebuild doesn't work on Windows yet - need to cross compile from amd64 in that case.
probably best to split this up in two separate comments
builder = dict(native=build_native, toolchained=build_toolchained).get(sub_target) | ||
if builder: | ||
build_params = vars(builder.parse_args(build_params)) | ||
build_params.update(dict(build_ver=pdfium_ver)) |
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.
todo: do this only if build_ver evaluates to True / is non-None to avoid always shadowing --version
CC #368, @wojiushixiaobai