Package: python3-sipbuild
Version: 6.6.1+dfsg-1
Severity: important
Tags: patch upstream
X-Debbugs-Cc: s...@highlab.com

I'm having trouble building libSavitar 5.0-beta (part of Cura, a slicer
for 3d printers): <https://github.com/Ultimaker/libsavitar/tree/5.0-beta>

When building with sip 6.6.1+dfsg-1 it fails with this traceback:

    '/usr/bin/cmake' '-E' 'env' 
'PYTHONPATH=::/home/seb/cura-debs/libsavitar-docker-sandbox/.pybuild/cpython3_3.9/build'
 '/usr/bin/sip-build' '--pep484-pyi' '--no-protected-is-public' '--verbose'
    Using the CMake builder
    These bindings will be built: pySavitar.
    Generating the source files
    Generating the pySavitar bindings...
    sip-build: An internal error occurred...
    Traceback (most recent call last):
      File "/usr/bin/sip-build", line 33, in <module>
        sys.exit(load_entry_point('sip==6.6.1', 'console_scripts', 
'sip-build')())
      File "/usr/lib/python3/dist-packages/sipbuild/tools/build.py", line 37, 
in main
        handle_exception(e)
      File "/usr/lib/python3/dist-packages/sipbuild/exceptions.py", line 81, in 
handle_exception
        raise e
      File "/usr/lib/python3/dist-packages/sipbuild/tools/build.py", line 34, 
in main
        project.build()
      File "/usr/lib/python3/dist-packages/sipbuild/project.py", line 249, in 
build
        self.builder.build()
      File 
"/home/seb/cura-debs/libsavitar-docker-sandbox/.pybuild/cpython3_3.9/build/CMakeBuilder.py",
 line 12, in build
        self._generate_bindings()
      File "/usr/lib/python3/dist-packages/sipbuild/builder.py", line 277, in 
_generate_bindings
        buildable = bindings.generate()
      File "/usr/lib/python3/dist-packages/sipbuild/bindings.py", line 166, in 
generate
        spec, sip_files = parse(self.sip_file, SIP_VERSION, encoding,
      File 
"/usr/lib/python3/dist-packages/sipbuild/generator/parser/parser.py", line 35, 
in parse
        protected_is_public, include_dirs, strict).parse(sip_file)
      File 
"/usr/lib/python3/dist-packages/sipbuild/generator/parser/parser_manager.py", 
line 1454, in parse
        self._parser.parse(self._read(sip_file), lexer=self._lexer,
      File "/usr/lib/python3/dist-packages/ply/yacc.py", line 331, in parse
        return self.parseopt(input, lexer, debug, tracking, tokenfunc)
      File "/usr/lib/python3/dist-packages/ply/yacc.py", line 823, in parseopt
        p.callable(pslice)
      File "/usr/lib/python3/dist-packages/sipbuild/generator/parser/rules.py", 
line 3097, in p_variable
        fq_cpp_name = normalised_scoped_name(cpp_name, pm.scope)
      File "/usr/lib/python3/dist-packages/sipbuild/generator/utils.py", line 
156, in normalised_scoped_name
        fq_scoped_name.prepend(scope.iface_file.fq_cpp_name)
      File 
"/usr/lib/python3/dist-packages/sipbuild/generator/specification.py", line 748, 
in prepend
        new_name = list(scoped_name._name)
    AttributeError: 'NoneType' object has no attribute '_name'

Building the same version of libSavitar on testing, which has sip
6.5.1+dfsg-1, works fine.

The problem is present in upstream, and is due to upstream's ongoing
effort to switch from parsing with bison & flex, to parsing with PLY
instead.  The new pure-python parser is not quite fully functional yet.
(The sip 6.5 in testing still uses the old bison/flex-based parser.)

After applying patches from upstream's mercurial repo, r2748 through
r2761, the parser now successfully handles libSavitar 5.0-beta.

Here is a gbp branch with these changes from upstream applied:

    https://salsa.debian.org/seb_kuzminsky-guest/sip6/-/commits/debian/master/

That probably isn't in the correct format, if you give me feedback i'll
try to fix it, or feel free to do with it what you will.

We may also want to consider staying on sip 6.5 for a while, until the
new parser is more mature, but I defer to your judgement on this.


-- System Information:
Debian Release: 11.3
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.10.0-14-rt-amd64 (SMP w/12 CPU threads; PREEMPT)
Kernel taint flags: TAINT_WARN
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Reply via email to