msys2 / MSYS2-packages

Package scripts for MSYS2.
https://packages.msys2.org
BSD 3-Clause "New" or "Revised" License
1.29k stars 485 forks source link

gnome-doc-utils: depends on removed Python 2 support for libxml2 #1935

Closed revelator closed 4 years ago

revelator commented 4 years ago

Some packages like gnome-doc-utils still need it, we can skip the numpy dependency without any problems as far as i have been able to determine (atleast for gnome-doc-utils). fedora has released a patch updating gnome-doc-utils for python3 support, unfortunatly it seems its not working correctly on windows (utf8 error).

Alexpux commented 4 years ago

Where gnome-doc-utils used? As i know it not used for a long time. Can you point me to patch from fedora?

revelator commented 4 years ago

patch hosted here https://github.com/Oleh-Kravchenko/portage/tree/master/app-text/gnome-doc-utils/files

still used in clutter clutter-gst cogl libgda and pitivi according to PKGBUILD files.

lazka commented 4 years ago

My plan was to drop gnome-doc-utils next (by either patching things or dropping packages, since cogl and clutter are not really maintained and on the way out, like gnome-doc-utils itself)

lazka commented 4 years ago

@revelator What's the problem you are facing with gnome-doc-utils not working?

revelator commented 4 years ago

Ah ok. Well the problem with the fedora python3 patches for gnome-doc-utils (i suspect you mean those ?) are that the build fails with some utf8 errors. Still investigating causes but it seems related to our python3 package not handling utf8 well.

lazka commented 4 years ago

I mean what's the actual problem that motivated you opening this issue :) So we can focus on fixing that first.

revelator commented 4 years ago

i was updating my private fork after the deprecation of most python2 packages and noticed gnome-doc-utils was no longer building because of it.

I maintain a special build of your mingw-w64-gcc with the now defunct TDM patchset (which i have updated continuously) for codeblocks users who prefer static runtime linking while still being able to throw exceptions across dll boundaries.

I try to make sure as many of your packages still build with this fork to avoid problems that earlier versions of TDMs gcc compilers had. Just had the notion that you might appreciate getting bug reports and potential fixes.

revelator commented 4 years ago

clutter is still needed by eye of gnome plugins i think ?, and cogl seems to be used by clutter, pitivi does not seem to be used by any package anymore so that might go.

Not sure how much relevance clutter has in eog or if it can be replaced by something different.

lazka commented 4 years ago

ok, thanks for the context. it's appreciated :)

revelator commented 4 years ago

No problem :+1:

If there is any interrest i can provide the updated TDM patchset for those wanting to do specialized gcc builds. It was recently upated for gcc-9.3.0 as well and works like a charm in most cases.

It will however still link to the libstdc++ dll if building some c++ code unless you rename the import library.

I havent found a foolprof way to get around this yet with code changes, but if you build a static gcc it works without this hack.

I also removed TDMs specialized winpthreads build so threaded code will allways depend on the winpthread dll.

The reason this was done was because it broke several packages that expect the shared version, it could probably be patched out of those but it would be a lot of work.

lazka commented 4 years ago

Consider opening a new issue for this, so others see it too (I don't know much about the toolchain...)

revelator commented 4 years ago

Will do.

Ede123 commented 4 years ago

FWIW we're still using gnome-doc-utils (specifically xml2po) to create documentation for Inkscape.

The documentation is built separately (so it does not affect the Inkscape build itself) but we still depend on xml2po until somebody finds the time to migrate to something more modern.

lazka commented 4 years ago

Here is the fedora patch: https://src.fedoraproject.org/rpms/gnome-doc-utils/blob/master/f/gnome-doc-utils-0.20.10-python3.patch (same as posted above..)

I'll give that a try.

revelator commented 4 years ago

heres the error im getting, interrested if you get the same.

Traceback (most recent call last): File "F:/mingw-w64-gnome-doc-utils/src/build-x86_64-w64-mingw32/doc/xslt/../../xml2po/xml2po/xml2po", line 191, in <module> main(sys.argv[1:]) File "F:/mingw-w64-gnome-doc-utils/src/build-x86_64-w64-mingw32/doc/xslt/../../xml2po/xml2po/xml2po", line 174, in main xml2po_main.merge(mofile, filenames[0]) File "F:/mingw-w64-gnome-doc-utils/src/gnome-doc-utils-0.20.10/xml2po/xml2po/__init__.py", line 611, in merge self.out.write(doc.doc.serialize('utf-8', 1)) File "C:/Msys64/mingw64/lib/python3.8/encodings/cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode characters in position 3643-3648: character maps to <undefined>

revelator commented 4 years ago

From what i can glean it seems related to windows command processor not treating utf-8 well.

revelator commented 4 years ago

and finally found a fix...

export PYTHONIOENCODING=UTF-8 <- put this in the pkgbuild script just before PYTHON=${MINGW_PREFIX}/bin/python3

and it builds and works with python3 after using the fedora patch.

revelator commented 4 years ago

Can close this issue now if you like i just built the few dependent packages with the patched version and my fix and all works well.

lazka commented 4 years ago

and finally found a fix...

export PYTHONIOENCODING=UTF-8 <- put this in the pkgbuild script just before PYTHON=${MINGW_PREFIX}/bin/python3

and it builds and works with python3 after using the fedora patch.

Yeah, that's the usual porting bug for code assuming a utf-8 locale on Linux.

Can close this issue now if you like i just built the few dependent packages with the patched version and my fix and all works well.

I'll create a PR, since the fix seems easy enough.

lazka commented 4 years ago

uh, there are lots of cases not ported actually

lazka commented 4 years ago

See #1938

revelator commented 4 years ago

good catch :+1: i had a feeling there might be more places needing attention in the original patch.

lazka commented 4 years ago

gnome-doc-utils in the repo is using Python 3 now. If there are any more problems please open a separate issue for that. Thanks!