GNU bug report logs - #42409
weasyprint fails to build

Previous Next

Package: guix;

Reported by: Michael Rohleder <mike <at> rohleder.de>

Date: Fri, 17 Jul 2020 17:52:01 UTC

Severity: normal

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 42409 in the body.
You can then email your comments to 42409 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#42409; Package guix. (Fri, 17 Jul 2020 17:52:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Michael Rohleder <mike <at> rohleder.de>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Fri, 17 Jul 2020 17:52:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Michael Rohleder <mike <at> rohleder.de>
To: bug-guix <at> gnu.org
Subject: weasyprint fails to build
Date: Fri, 17 Jul 2020 19:51:08 +0200
[Message part 1 (text/plain, inline)]
weasyprint fails in tests:

...
=================================== FAILURES ===================================
__________________________________ test_acid2 __________________________________

    @assert_no_logs
    @requires('cairo', (1, 12, 0))
    def test_acid2():
        def render(filename):
            return HTML(resource_filename(filename)).render(enable_hinting=True)
    
        with capture_logs():
            # This is a copy of http://www.webstandards.org/files/acid2/test.html
            document = render('acid2-test.html')
            intro_page, test_page = document.pages
            # Ignore the intro page: it is not in the reference
            test_image, width, height = document.copy(
                [test_page]).write_image_surface()
    
        # This is a copy of http://www.webstandards.org/files/acid2/reference.html
        ref_image, ref_width, ref_height = render(
            'acid2-reference.html').write_image_surface()
    
        assert (width, height) == (ref_width, ref_height)
>       assert_pixels_equal(
            'acid2', width, height, image_to_pixels(test_image, width, height),
            image_to_pixels(ref_image, width, height), tolerance=2)

weasyprint/tests/test_acid2.py:37: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

name = 'acid2', width = 794, height = 1123
raw = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00...00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
expected_raw = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00...00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
tolerance = 2

    def assert_pixels_equal(name, width, height, raw, expected_raw, tolerance=0):
        """Take 2 matrices of pixels and assert that they are the same."""
        if raw != expected_raw:  # pragma: no cover
            for i, (value, expected) in enumerate(zip(raw, expected_raw)):
                if abs(value - expected) > tolerance:
                    write_png(name, raw, width, height)
                    write_png(name + '.expected', expected_raw,
                              width, height)
                    pixel_n = i // 4
                    x = pixel_n // width
                    y = pixel_n % width
                    i % 4
                    pixel = tuple(list(raw[i:i + 4]))
                    expected_pixel = tuple(list(
                        expected_raw[i:i + 4]))
>                   assert 0, (
                        'Pixel (%i, %i) in %s: expected rgba%s, got rgba%s'
                        % (x, y, name, expected_pixel, pixel))
E                   AssertionError: Pixel (124, 160) in acid2: expected rgba(191, 127, 127, 255), got rgba(128, 0, 0, 255)

weasyprint/tests/test_draw/__init__.py:163: AssertionError
------------------------------ Captured log call -------------------------------
INFO     weasyprint.progress:__init__.py:106 Step 1 - Fetching and parsing HTML - /tmp/guix-build-weasyprint-51.drv-0/WeasyPrint-51/weasyprint/tests/resources/acid2-test.html
INFO     weasyprint.progress:__init__.py:315 Step 2 - Fetching and parsing CSS - CSS string
WARNING  weasyprint:__init__.py:825 Invalid or unsupported selector '[class=second two] ', (<IdentToken two>, 'expected ], got ident')
WARNING  weasyprint:__init__.py:86 Ignored `error: \}` at 90:74, unknown property.
WARNING  weasyprint:__init__.py:86 Ignored `m
rgin: 2em` at 93:14, unknown property.
WARNING  weasyprint:__init__.py:825 Invalid or unsupported selector ';
   .parser ', (<LiteralToken ;>, 'expected a compound selector, got literal')
WARNING  weasyprint:__init__.py:86 Ignored `width: 200` at 95:14, invalid value.
WARNING  weasyprint:__init__.py:86 Ignored `border: 5em solid red ! error` at 96:14, invalid value.
WARNING  weasyprint:__init__.py:86 Ignored `background: red pink` at 97:14, invalid value.
INFO     weasyprint.progress:__init__.py:315 Step 2 - Fetching and parsing CSS - data:text/css,.picture%20%7B%20background%3A%20none%3B%20%7D
INFO     weasyprint.progress:__init__.py:67 Step 3 - Applying CSS
INFO     weasyprint.progress:document.py:371 Step 4 - Creating formatting structure
ERROR    weasyprint:images.py:231 Failed to load image at "file:///tmp/guix-build-weasyprint-51.drv-0/WeasyPrint-51/weasyprint/tests/resources/404" (URLError: <urlopen error [Errno 2] No such file or directory: '/tmp/guix-build-weasyprint-51.drv-0/WeasyPrint-51/weasyprint/tests/resources/404'>)
ERROR    weasyprint:images.py:231 Failed to load image at "data:application/x-unknown,ERROR" (Pixbuf error: Unrecognized image file format)
INFO     weasyprint.progress:pages.py:798 Step 5 - Creating layout - Page 1
INFO     weasyprint.progress:pages.py:798 Step 5 - Creating layout - Page 2
INFO     weasyprint.progress:document.py:751 Step 6 - Drawing
INFO     weasyprint.progress:__init__.py:106 Step 1 - Fetching and parsing HTML - /tmp/guix-build-weasyprint-51.drv-0/WeasyPrint-51/weasyprint/tests/resources/acid2-reference.html
INFO     weasyprint.progress:__init__.py:315 Step 2 - Fetching and parsing CSS - CSS string
INFO     weasyprint.progress:__init__.py:67 Step 3 - Applying CSS
INFO     weasyprint.progress:document.py:371 Step 4 - Creating formatting structure
INFO     weasyprint.progress:pages.py:798 Step 5 - Creating layout - Page 1
INFO     weasyprint.progress:document.py:751 Step 6 - Drawing
______________________________ test_line_content _______________________________

    @assert_no_logs
    def test_line_content():
        for width, remaining in [(100, 'text for test'),
                                 (45, 'is a text for test')]:
            text = 'This is a text for test'
            _, length, resume_at, _, _, _ = make_text(
                text, width, font_family=SANS_FONTS.split(','), font_size=19)
>           assert text[resume_at:] == remaining
E           AssertionError: assert 'a text for test' == 'text for test'
E             - a text for test
E             ? --
E             + text for test

../../../WeasyPrint-51/weasyprint/tests/test_text.py:37: AssertionError
______________________________ test_line_breaking ______________________________

    @assert_no_logs
    def test_line_breaking():
        string = 'Thïs is a text for test'
    
        # These two tests do not really rely on installed fonts
        _, _, resume_at, _, _, _ = make_text(string, 90, font_size=1)
        assert resume_at is None
    
        _, _, resume_at, _, _, _ = make_text(string, 90, font_size=100)
        assert string.encode('utf-8')[resume_at:].decode('utf-8') == (
            'is a text for test')
    
        _, _, resume_at, _, _, _ = make_text(
            string, 100, font_family=SANS_FONTS.split(','), font_size=19)
>       assert string.encode('utf-8')[resume_at:].decode('utf-8') == (
            'text for test')
E       AssertionError: assert 'a text for test' == 'text for test'
E         - a text for test
E         ? --
E         + text for test

../../../WeasyPrint-51/weasyprint/tests/test_text.py:62: AssertionError

...

= 41 failed, 1132 passed, 1 deselected, 7 xfailed, 1 warning in 84.56s (0:01:24) =
command "pytest" "-k" "not test_flex_column_wrap_reverse" failed with status 1
builder for `/gnu/store/5c9h7c9pnrbpmk1015vrckrwsf5hd5xr-weasyprint-51.drv' failed with exit code 1


-- 
"We all know Linux is great...it does infinite loops in 5 seconds."
(Linus Torvalds about the superiority of Linux on the Amterdam
Linux Symposium)
[signature.asc (application/pgp-signature, inline)]

Reply sent to Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:
You have taken responsibility. (Sun, 29 Nov 2020 19:10:01 GMT) Full text and rfc822 format available.

Notification sent to Michael Rohleder <mike <at> rohleder.de>:
bug acknowledged by developer. (Sun, 29 Nov 2020 19:10:01 GMT) Full text and rfc822 format available.

Message #10 received at 42409-done <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Michael Rohleder <mike <at> rohleder.de>
Cc: 42409-done <at> debbugs.gnu.org
Subject: Re: bug#42409: weasyprint fails to build
Date: Sun, 29 Nov 2020 14:09:11 -0500
Hello,

Michael Rohleder <mike <at> rohleder.de> writes:

> weasyprint fails in tests:
>
> ...
> =================================== FAILURES ===================================
>
>
>     @assert_no_logs
>     @requires('cairo', (1, 12, 0))
>     def test_acid2():
>         def render(filename):
>             return HTML(resource_filename(filename)).render(enable_hinting=True)
>     
>         with capture_logs():
>             # This is a copy of http://www.webstandards.org/files/acid2/test.html
>             document = render('acid2-test.html')
>             intro_page, test_page = document.pages
>             # Ignore the intro page: it is not in the reference
>             test_image, width, height = document.copy(
>                 [test_page]).write_image_surface()
>     
>         # This is a copy of http://www.webstandards.org/files/acid2/reference.html
>         ref_image, ref_width, ref_height = render(
>             'acid2-reference.html').write_image_surface()
>     
>         assert (width, height) == (ref_width, ref_height)
>>       assert_pixels_equal(
>             'acid2', width, height, image_to_pixels(test_image, width, height),
>             image_to_pixels(ref_image, width, height), tolerance=2)
>
> weasyprint/tests/test_acid2.py:37: 
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
>
> name = 'acid2', width = 794, height = 1123
> raw = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00...00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
> expected_raw = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00...00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
> tolerance = 2
>
>     def assert_pixels_equal(name, width, height, raw, expected_raw, tolerance=0):
>         """Take 2 matrices of pixels and assert that they are the same."""
>         if raw != expected_raw:  # pragma: no cover
>             for i, (value, expected) in enumerate(zip(raw, expected_raw)):
>                 if abs(value - expected) > tolerance:
>                     write_png(name, raw, width, height)
>                     write_png(name + '.expected', expected_raw,
>                               width, height)
>                     pixel_n = i // 4
>                     x = pixel_n // width
>                     y = pixel_n % width
>                     i % 4
>                     pixel = tuple(list(raw[i:i + 4]))
>                     expected_pixel = tuple(list(
>                         expected_raw[i:i + 4]))
>>                   assert 0, (
>                         'Pixel (%i, %i) in %s: expected rgba%s, got rgba%s'
>                         % (x, y, name, expected_pixel, pixel))
> E                   AssertionError: Pixel (124, 160) in acid2: expected rgba(191, 127, 127, 255), got rgba(128, 0, 0, 255)
>
> weasyprint/tests/test_draw/__init__.py:163: AssertionError
>
> INFO weasyprint.progress:__init__.py:106 Step 1 - Fetching and parsing
> HTML -
> /tmp/guix-build-weasyprint-51.drv-0/WeasyPrint-51/weasyprint/tests/resources/acid2-test.html
> INFO     weasyprint.progress:__init__.py:315 Step 2 - Fetching and parsing CSS - CSS string
> WARNING weasyprint:__init__.py:825 Invalid or unsupported selector
> '[class=second two] ', (<IdentToken two>, 'expected ], got ident')
> WARNING  weasyprint:__init__.py:86 Ignored `error: \}` at 90:74, unknown property.
> WARNING  weasyprint:__init__.py:86 Ignored `m
> rgin: 2em` at 93:14, unknown property.
> WARNING  weasyprint:__init__.py:825 Invalid or unsupported selector ';
>    .parser ', (<LiteralToken ;>, 'expected a compound selector, got literal')
> WARNING  weasyprint:__init__.py:86 Ignored `width: 200` at 95:14, invalid value.
> WARNING  weasyprint:__init__.py:86 Ignored `border: 5em solid red ! error` at 96:14, invalid value.
> WARNING  weasyprint:__init__.py:86 Ignored `background: red pink` at 97:14, invalid value.
> INFO weasyprint.progress:__init__.py:315 Step 2 - Fetching and parsing
> CSS - data:text/css,.picture%20%7B%20background%3A%20none%3B%20%7D
> INFO     weasyprint.progress:__init__.py:67 Step 3 - Applying CSS
> INFO     weasyprint.progress:document.py:371 Step 4 - Creating formatting structure
> ERROR weasyprint:images.py:231 Failed to load image at
> "file:///tmp/guix-build-weasyprint-51.drv-0/WeasyPrint-51/weasyprint/tests/resources/404"
> (URLError: <urlopen error [Errno 2] No such file or directory:
> '/tmp/guix-build-weasyprint-51.drv-0/WeasyPrint-51/weasyprint/tests/resources/404'>)
> ERROR weasyprint:images.py:231 Failed to load image at
> "data:application/x-unknown,ERROR" (Pixbuf error: Unrecognized image
> file format)
> INFO     weasyprint.progress:pages.py:798 Step 5 - Creating layout - Page 1
> INFO     weasyprint.progress:pages.py:798 Step 5 - Creating layout - Page 2
> INFO     weasyprint.progress:document.py:751 Step 6 - Drawing
> INFO weasyprint.progress:__init__.py:106 Step 1 - Fetching and parsing
> HTML -
> /tmp/guix-build-weasyprint-51.drv-0/WeasyPrint-51/weasyprint/tests/resources/acid2-reference.html
> INFO     weasyprint.progress:__init__.py:315 Step 2 - Fetching and parsing CSS - CSS string
> INFO     weasyprint.progress:__init__.py:67 Step 3 - Applying CSS
> INFO     weasyprint.progress:document.py:371 Step 4 - Creating formatting structure
> INFO     weasyprint.progress:pages.py:798 Step 5 - Creating layout - Page 1
> INFO     weasyprint.progress:document.py:751 Step 6 - Drawing
>
>
>     @assert_no_logs
>     def test_line_content():
>         for width, remaining in [(100, 'text for test'),
>                                  (45, 'is a text for test')]:
>             text = 'This is a text for test'
>             _, length, resume_at, _, _, _ = make_text(
>                 text, width, font_family=SANS_FONTS.split(','), font_size=19)
>>           assert text[resume_at:] == remaining
> E           AssertionError: assert 'a text for test' == 'text for test'
> E             - a text for test
> E             ? --
> E             + text for test
>
> ../../../WeasyPrint-51/weasyprint/tests/test_text.py:37: AssertionError
>
>     @assert_no_logs
>     def test_line_breaking():
>         string = 'Thïs is a text for test'
>     
>         # These two tests do not really rely on installed fonts
>         _, _, resume_at, _, _, _ = make_text(string, 90, font_size=1)
>         assert resume_at is None
>     
>         _, _, resume_at, _, _, _ = make_text(string, 90, font_size=100)
>         assert string.encode('utf-8')[resume_at:].decode('utf-8') == (
>             'is a text for test')
>     
>         _, _, resume_at, _, _, _ = make_text(
>             string, 100, font_family=SANS_FONTS.split(','), font_size=19)
>>       assert string.encode('utf-8')[resume_at:].decode('utf-8') == (
>             'text for test')
> E       AssertionError: assert 'a text for test' == 'text for test'
> E         - a text for test
> E         ? --
> E         + text for test
>
> ../../../WeasyPrint-51/weasyprint/tests/test_text.py:62: AssertionError
>
> ...
>
> = 41 failed, 1132 passed, 1 deselected, 7 xfailed, 1 warning in 84.56s (0:01:24) =
> command "pytest" "-k" "not test_flex_column_wrap_reverse" failed with status 1
> builder for `/gnu/store/5c9h7c9pnrbpmk1015vrckrwsf5hd5xr-weasyprint-51.drv' failed with exit code 1

These failures were due to the 'DejaVu Sans' font not being available.
This is now fixed, along with an updated Weasyprint and some of its
dependencies, as of commit c601e2bf9adb05dc9dd9f3a565f693e968eb785c.

Thank you for the report!

Closing.

Maxim




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 28 Dec 2020 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 120 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.