frescobaldi / python-poppler-qt5

Python binding to libpoppler-qt5
Other
42 stars 32 forks source link

sip-install and poppler-annotation.sip problems #55

Closed fedelibre closed 1 year ago

fedelibre commented 2 years ago

I'm trying to update Frescobaldi flatpak and use the recently added PyQt baseapp, which provides some dependencies I used to install within the flatpak manifest I maintain. As you can see in pull 6, the latest aarch64 build is failing with the following error:

Building module python-poppler-qt5 in /srv/buildbot/worker/build-aarch64-7/build/.flatpak-builder/build/python-poppler-qt5-1
========================================================================
]2;flatpak-builder: Building python-poppler-qt5FB: Running: cp -al /srv/buildbot/worker/build-aarch64-7/build/.flatpak-builder/git/https_github.com_frescobaldi_python-poppler-qt5_ /srv/buildbot/worker/build-aarch64-7/build/.flatpak-builder/build/python-poppler-qt5-1/.git
FB: Running: git config --bool core.bare false
FB: Running: git checkout master
Already on 'master'
FB: Running: git rev-parse --verify --quiet master:.gitmodules
]2;flatpak-builder: Installing python-poppler-qt5Running: sip-install --verbose --target-dir /app/lib/python3.9/site-packages
FB: Running 'flatpak build --die-with-parent --env=FLATPAK_BUILDER_BUILDDIR=/run/build/python-poppler-qt5 --nofilesystem=host:reset --filesystem=/srv/buildbot/worker/build-aarch64-7/build/.flatpak-builder/build/python-poppler-qt5-1 --bind-mount=/run/build/python-poppler-qt5=/srv/buildbot/worker/build-aarch64-7/build/.flatpak-builder/build/python-poppler-qt5-1 --build-dir=/run/build/python-poppler-qt5 --bind-mount=/run/ccache=/srv/buildbot/worker/build-aarch64-7/build/.flatpak-builder/ccache --unshare=network --env=SOURCE_DATE_EPOCH=1651439730 '--env=CFLAGS=-O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer ' '--env=CXXFLAGS=-O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer ' '--env=LDFLAGS=-L/app/lib -Wl,-z,relro,-z,now -Wl,--as-needed ' --env=CCACHE_DIR=/run/ccache/disabled --env=PATH=/app/bin:/usr/bin --env=LD_LIBRARY_PATH=/app/lib --env=PKG_CONFIG_PATH=/app/lib/pkgconfig:/app/share/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig --env=FLATPAK_BUILDER_N_JOBS=64 /srv/buildbot/worker/build-aarch64-7/build/.flatpak-builder/rofiles/rofiles-bap1B5 /bin/sh -c 'sip-install --verbose --target-dir /app/lib/python3.9/site-packages'' on host
Querying qmake about your Qt installation...
/usr/bin/qmake -query
These bindings will be built: Poppler-Qt5.
Generating the Poppler-Qt5 bindings...
sip-install: /run/build/python-poppler-qt5/poppler-annotation.sip: line 614 column 13: '%' is unexpected
/run/build/python-poppler-qt5/poppler-annotation.sip: line 617 column 21: '(' is unexpected
/run/build/python-poppler-qt5/poppler-annotation.sip: line 619 column 36: '=' is unexpected
/run/build/python-poppler-qt5/poppler-annotation.sip: line 632 column 39: '=' is unexpected
/run/build/python-poppler-qt5/poppler-annotation.sip: line 651 column 39: '=' is unexpected
/run/build/python-poppler-qt5/poppler-annotation.sip: line 652 column 40: '=' is unexpected
/run/build/python-poppler-qt5/poppler-annotation.sip: line 662 column 5: '}' is unexpected
/run/build/python-poppler-qt5/poppler-annotation.sip: line 685 column 3: 'private' is unexpected
/run/build/python-poppler-qt5/poppler-annotation.sip: line 689 column 1: too many '%End' directives
/run/build/python-poppler-qt5/poppler-annotation.sip: line 691 column 1: '}' is unexpected
/run/build/python-poppler-qt5/poppler-annotation.sip: line 1228 column 1: '}' is unexpected
FB: host_command_exited_cb 2826373 256

I guess that poppler-annotation.sip is not compliant with the sip-install version I'm using? As I cannot control the sip version used by PyQt.BaseApp, can you upgrade this file?

PyQt.BaseApp is using sip 6.6.1 and and PyQt5-sip 12.10.1.

fedelibre commented 2 years ago

For the records, I can build in a Fedora 36 container:

$ rpm -q sip6
sip6-6.5.0-2.fc36.x86_64

$ sip-install --qmake /usr/lib64/qt5/bin/qmake --target-dir ~/.local/lib/python3.10/site-packages/
Querying qmake about your Qt installation...
These bindings will be built: Poppler-Qt5.
Generating the Poppler-Qt5 bindings...
Generating the .pro file for the popplerqt5 module...
Generating the top-level .pro file...
Generating the Makefiles...
Compiling the project...
Installing the project...
The project has been installed.
pchampin commented 2 years ago

FWIW, I encounter the same problem when running

pip install git+https://github.com/frescobaldi/python-poppler-qt5

in Ubuntu 22.04.

> python --version
Python 3.10.4
> pip --version
pip 22.0.2 from /home/pa/MyPyEnv/lib/python3.10/site-packages/pip (python 3.10)
fedelibre commented 2 years ago

@pchampin What's the output of sip-build --version?

pchampin commented 2 years ago
> sip-build --version
sip-build: pyproject.toml: unable to parse file: [Errno 2] No such file or directory: 'pyproject.toml'

:-( (note that all the process is ran by pip in a temporary dir, so I don't have easy access to pyproject.toml)

If that's any help:

> pip freeze | grep sip
PyQt5-sip==12.10.1
sip==5.0.0
fedelibre commented 2 years ago

@wbsoft Can you help?

dwintergruen commented 2 years ago

It works for me only with sip == 6.5.0 PyQt5-sip == 12.10.1

all other version of sip don't work for me.

Ultimator14 commented 2 years ago

This works for me:
PyQt5-sip: 12.10.1
sip: 6.6.2

Sip version 6.6.0 switched to another .sip file parser.
I guess it's a bug that was fixed in version 6.6.2.

pchampin commented 2 years ago

thanks @dwintergruen @Ultimator14 . Forcing sip to version 6.5.0 or 6.6.2 does indeed solves the problem above for me. However, it only reveals a further problem :cry::

> pip install git+https://github.com/frescobaldi/python-poppler-qt5
Collecting git+https://github.com/frescobaldi/python-poppler-qt5
  Cloning https://github.com/frescobaldi/python-poppler-qt5 to /tmp/pip-req-build-9v1dkout
  Running command git clone --filter=blob:none --quiet https://github.com/frescobaldi/python-poppler-qt5 /tmp/pip-req-build-9v1dkout
  Resolved https://github.com/frescobaldi/python-poppler-qt5 to commit b9b95ae34b7892ec702fa67d1ff2e8c68ccd076a
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [9 lines of output]
      Querying qmake about your Qt installation...
      These bindings will be built: Poppler-Qt5.
      Generating the Poppler-Qt5 bindings...
      Generating the .pro file for the popplerqt5 module...
      Generating the top-level .pro file...
      Generating the Makefiles...
      Compiling the project...
      Installing the project...
      _in_process.py: 'make install' failed returning 2
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
Ultimator14 commented 2 years ago

@pchampin I used these commands for installation in a local directory (absolute path names requried).

git clone https://github.com/frescobaldi/python-poppler-qt5.git
cd python-poppler-qt5
mkdir build out
sip-install --verbose --qmake /usr/bin/qmake5 --target-dir="/absolute/path/to/out" --build-dir="/absolute/path/to/build"

The installation via pip also gives me a similar error.

fedelibre commented 1 year ago

I'm trying to update Frescobaldi flatpak and use the recently added PyQt baseapp, which provides some dependencies I used to install within the flatpak manifest I maintain. As you can see in pull 6, the latest aarch64 build is failing with the following error:

For the records, I managed to build it after some updates. See this PR.