This patch is taken from the upstream repository https://github.com/pydot/pydot/commit/a10ced4d132361027a545a471af4541dea8c5cf5.patch It should be included in the 1.4.2 release. From a10ced4d132361027a545a471af4541dea8c5cf5 Mon Sep 17 00:00:00 2001 From: Peter Nowee Date: Wed, 26 Jun 2019 15:43:38 +0800 Subject: [PATCH] Fix multi.dot Graphviz regression test Commit d6602ad of 2018-12-01 fixed the regression test broken by commit 2d55978 of 2016-07-01. This revealed that `test/graphs/multi.dot` was failing. `multi.dot` was introduced in commit 2b3f088 of 2010-11-07 together with many of the other tests still here today. It has not been touched since. It is a DOT-file containing two digraphs. The regression test compares the JPEG images rendered from the DOT-file by pydot with those rendered by Graphviz's dot directly. Commit 66734d2 of 2016-07-01 is the actual cause of the failure. It changed one of the render methods of the regression test, `_render_with_pydot`, from calculating a single hash for all the JPEG images to calculating separate hashes for each JPEG image and then concatenating those hashes in one long string. The other render method, `_render_with_graphviz`, still calculates a single hash over all data. For DOT-files that generate only one image the end result is the same, but because `multi.dot` has two graphs, it produces two images and this leads to comparing a string of two hashes with one single hash. I do not think the change in generating the hash was intentional, for the following reasons: - Commit 66734d2 states that its purpose was to adapt the test to an API change in pydot. It does not mention a deliberate choice to change the testing method. - There was no effort to change `_render_with_graphviz` to also produce multiple hashes. - Except for easier debugging in case of a failing test with multiple images (AFAICT, only;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2016 Christine Lemmer-Webber <cwebber@dustycloud.org> ;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name> ;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com> ;;; Copyright © 2020, 2022 Tobias Geerinckx-Rice <me@tobias.gr> ;;; Copyright © 2020 Mathieu Othacehe <m.othacehe@gmail.com> ;;; Copyright © 2022 Pavel Shlyak <p.shlyak@pantherx.org> ;;; Copyright © 2022 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> ;;; Copyright © 2023 Efraim Flashner <efraim@flashner.co.il> ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. (define-module (gnu build image) #:use-module (guix build store-copy) #:use-module (guix build syscalls) #:use-module (guix build utils) #:use-module (guix store database) #:use-module (guix utils) #:use-module (gnu build bootloader) #:use-module (gnu build install) #:use-module (gnu build linux-boot) #:use-module (gnu image