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

Supporting local Windows weasyprint builds #406

Open
agitter opened this issue Jan 1, 2021 · 1 comment
Open

Supporting local Windows weasyprint builds #406

agitter opened this issue Jan 1, 2021 · 1 comment

Comments

@agitter
Copy link
Member

agitter commented Jan 1, 2021

The Manubot build environment is not currently supported on Windows. However, the main limitation was previously the pango package, and pango now has win-64 support on the conda-forge channel.

The current conda environment cannot be installed on Windows and gives the ResolvePackageNotFound error reported in #405. However, if I unpin the cairo, cairocffi, and pango versions, I am able to install the manubot conda environment. I end up with

  • cairo 1.16.0
  • cairocffi 1.2.0
  • pango 1.42.4

bash build/build.sh shows they are still missing dependencies:

OSError: cannot load library 'gobject-2.0': error 0x7e.  Additionally, ctypes.util.find_library() did not manage to locate a library called 'gobject-2.0'

This is related to Kozea/WeasyPrint#971.

I tried conda install -c conda-forge gtk3 and installed version 3.24.24. That did not resolve the error.

It looked like I had the missing DLLs in .conda\envs\manubot\Library\bin but they did not have the expected names. I copied gobject-2.0-0.dll as libgobject-2.0-0.dll, pango-1.0-0.dll as pango-1.0.dll, and pangocairo-1.0-0.dll as pangocairo-1.0.dll. This gave a new error further into the weasyprint build:

(process:11000): GLib-GObject-WARNING **: 08:49:54.950: cannot register existing type 'PangoLayout'
(process:11000): GLib-CRITICAL **: 08:49:54.950: g_once_init_leave: assertion 'result != 0' failed
(process:11000): Pango-CRITICAL **: 08:49:54.950: pango_layout_get_iter: assertion 'PANGO_IS_LAYOUT (layout)' failed
Error producing PDF.

Perhaps local Windows builds with weasyprint are now possible, but I'm not planning to troubleshoot this further at this time.

@agitter
Copy link
Member Author

agitter commented Jan 4, 2021

I confirmed that building the manuscript locally on Windows with Git for Windows does work when Docker is available. This line in the build script

--volume="$(pwd)/output:/converted/" \

needs to be changed to:

    --volume="/$(pwd)/output:/converted/" \

and then bash build/build.sh works as expected.

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

No branches or pull requests

1 participant