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

Broken doc build pipeline: pdf generation: invalid literal for int() with base 16: 'ig' #84

Open
farshidtz opened this issue Jan 29, 2025 · 2 comments
Labels
bug Something isn't working CI Continuous Integration

Comments

@farshidtz
Copy link
Member

farshidtz commented Jan 29, 2025

The documentation build pipeline is blocked since 5ee6cbf due to a failure in the Sphinx pdf generator.

The error is unrelated to the local changes.
The error is triggered because of changes to docs/explanation/rr_scheduler.svg.

This effectively prevents the build of versioned documentation by RTD.

Build error:

# Traceback:
Traceback (most recent call last):
  File "/home/farshid/projects/real-time/real-time-ubuntu-docs/docs/.sphinx/venv/lib/python3.12/site-packages/sphinx/cmd/build.py", line 337, in build_main
    app.build(args.force_all, args.filenames)
  File "/home/farshid/projects/real-time/real-time-ubuntu-docs/docs/.sphinx/venv/lib/python3.12/site-packages/sphinx/application.py", line 378, in build
    self.builder.build_update()
  File "/home/farshid/projects/real-time/real-time-ubuntu-docs/docs/.sphinx/venv/lib/python3.12/site-packages/sphinx/builders/__init__.py", line 294, in build_update
    self.build(['__all__'], to_build)
  File "/home/farshid/projects/real-time/real-time-ubuntu-docs/docs/.sphinx/venv/lib/python3.12/site-packages/sphinx/builders/__init__.py", line 367, in build
    self.write(docnames, list(updated_docnames), method)
  File "/home/farshid/projects/real-time/real-time-ubuntu-docs/docs/.sphinx/venv/lib/python3.12/site-packages/sphinx/builders/latex/__init__.py", line 304, in write
    doctree = self.assemble_doctree(
              ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/farshid/projects/real-time/real-time-ubuntu-docs/docs/.sphinx/venv/lib/python3.12/site-packages/sphinx/builders/latex/__init__.py", line 370, in assemble_doctree
    self.env.resolve_references(largetree, indexfile, self)
  File "/home/farshid/projects/real-time/real-time-ubuntu-docs/docs/.sphinx/venv/lib/python3.12/site-packages/sphinx/environment/__init__.py", line 699, in resolve_references
    self.apply_post_transforms(doctree, fromdocname)
  File "/home/farshid/projects/real-time/real-time-ubuntu-docs/docs/.sphinx/venv/lib/python3.12/site-packages/sphinx/environment/__init__.py", line 711, in apply_post_transforms
    transformer.apply_transforms()
  File "/home/farshid/projects/real-time/real-time-ubuntu-docs/docs/.sphinx/venv/lib/python3.12/site-packages/sphinx/transforms/__init__.py", line 93, in apply_transforms
    super().apply_transforms()  # type: ignore[misc]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/farshid/projects/real-time/real-time-ubuntu-docs/docs/.sphinx/venv/lib/python3.12/site-packages/docutils/transforms/__init__.py", line 182, in apply_transforms
    transform.apply(**kwargs)
  File "/home/farshid/projects/real-time/real-time-ubuntu-docs/docs/.sphinx/venv/lib/python3.12/site-packages/sphinx/transforms/post_transforms/images.py", line 34, in apply
    self.handle(node)
  File "/home/farshid/projects/real-time/real-time-ubuntu-docs/docs/.sphinx/venv/lib/python3.12/site-packages/sphinx/transforms/post_transforms/images.py", line 254, in handle
    if self.convert(abs_srcpath, destpath):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/farshid/projects/real-time/real-time-ubuntu-docs/docs/.sphinx/venv/lib/python3.12/site-packages/sphinxcontrib/cairosvgconverter.py", line 54, in convert
    cairosvg.svg2pdf(file_obj=open(_from, 'rb'), write_to=_to)
  File "/home/farshid/projects/real-time/real-time-ubuntu-docs/docs/.sphinx/venv/lib/python3.12/site-packages/cairosvg/__init__.py", line 67, in svg2pdf
    return surface.PDFSurface.convert(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/farshid/projects/real-time/real-time-ubuntu-docs/docs/.sphinx/venv/lib/python3.12/site-packages/cairosvg/surface.py", line 133, in convert
    instance = cls(
               ^^^^
  File "/home/farshid/projects/real-time/real-time-ubuntu-docs/docs/.sphinx/venv/lib/python3.12/site-packages/cairosvg/surface.py", line 225, in __init__
    self.draw(tree)
  File "/home/farshid/projects/real-time/real-time-ubuntu-docs/docs/.sphinx/venv/lib/python3.12/site-packages/cairosvg/surface.py", line 472, in draw
    self.draw(child)
  File "/home/farshid/projects/real-time/real-time-ubuntu-docs/docs/.sphinx/venv/lib/python3.12/site-packages/cairosvg/surface.py", line 442, in draw
    *self.map_color(paint_color, fill_opacity))
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/farshid/projects/real-time/real-time-ubuntu-docs/docs/.sphinx/venv/lib/python3.12/site-packages/cairosvg/surface.py", line 278, in map_color
    rgba = color(string, opacity)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/farshid/projects/real-time/real-time-ubuntu-docs/docs/.sphinx/venv/lib/python3.12/site-packages/cairosvg/colors.py", line 227, in color
    plain_color = tuple(
                  ^^^^^^
  File "/home/farshid/projects/real-time/real-time-ubuntu-docs/docs/.sphinx/venv/lib/python3.12/site-packages/cairosvg/colors.py", line 228, in <genexpr>
    int(value, 16) / 255 for value in (
    ^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 16: 'ig'

It can be reproduced locally:

sudo make pdf-prep-force
make pdf-prep
make pdf
@farshidtz farshidtz added bug Something isn't working CI Continuous Integration labels Jan 29, 2025
@farshidtz
Copy link
Member Author

What made this very hard to pinpoint is that the PDF build only happens and fails on read-the-doc, not on Github workflows triggered on PRs and main.

@farshidtz
Copy link
Member Author

It looks like any DrawIO diagram exported to SVG via the current draw.io app (snapped v26.0.9) or https://app.diagrams.net/ trigger that error.

The light-dark css functions are at least one of the culprits, e.g. fill="light-dark(#000000, #ffffff)", style="color: light-dark(#000000, #ffffff);. Disabling the Appearance: Automatic when exporting to SVG doesn't remove those.

farshidtz added a commit that referenced this issue Feb 3, 2025
Temporary fix for #84, to unblock the documentation build.

Signed-off-by: Farshid Tavakolizadeh <farshid.tavakolizadeh@canonical.com>
farshidtz added a commit that referenced this issue Feb 3, 2025
Temporary fix for #84, to unblock the documentation build.

Signed-off-by: Farshid Tavakolizadeh <farshid.tavakolizadeh@canonical.com>
(cherry picked from commit b31585b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working CI Continuous Integration
Projects
None yet
Development

No branches or pull requests

1 participant