From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id 8Kj0F5fK7GQhxgAA9RJhRA:P1 (envelope-from ) for ; Mon, 28 Aug 2023 18:25:59 +0200 Received: from aspmx1.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 8Kj0F5fK7GQhxgAA9RJhRA (envelope-from ) for ; Mon, 28 Aug 2023 18:25:59 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 0F23537B86 for ; Mon, 28 Aug 2023 18:25:59 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=SUn0wLVj; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1693239959; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=wxDN7X7Il1IAV3LRKPDI9KygPQ45PHE9LQhV/JqBX1k=; b=g3V6HCZKEWlKChEKE3+Y0B5xaOdbz6Q38lKb1jIkJ1CejsrxlC6WtScMc1ATFPm3EwEccZ 9RDfgRYvEGgLoAf0WjqEOc7tzt241+LZVk+wRaqqPiL9QNo5kucMo4uE3HKrICimMuV/to Q+NLf5eaZE4/J5blNAzXHhiLSlL0t9sYTFfK5ktBm8NmeA5TDAwMncQOwJTPHxDSXAOPnB 4Sp8XPejCm4F7rAxt3Nq+QvRjfFg8z6UA9VHBcvjPxmSXUlyBlo05kjv6twDBOP3i1Eppf Nn7dh3ArN9KwhvIKGtDgZI/3X0cyyzTWpFFf8ZajdFhcWOKOAMNiQw7smpmYpA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=SUn0wLVj; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1693239959; a=rsa-sha256; cv=none; b=Xbks6x65ErxhEymS/mqF+z9ZpfWZRweD+fzYOE8fNbCV89iQkBaSZw/JCJagBECARuaAnS XdEBNMrYp0A+dcNgr3NfJhE0D7xiMlv2qJSf/60QjNkVSeCXs7rSnKrFGBv8+2IBHXlSex iIKenYnctL2twewOzU/w16/PIJFioWN6cAWM8bcy/1JxABi4gtQmfAq0lL8xxHnbw3GpL1 E/TbppMCK8SIV4w1+yu6ROASFLeayWrEj6Za20QUE88JhEgDODckn5c6+AicIjCSzVmCTa 7d9hJ3Q4Lt3wu7dBAp9pWxEpPPrbnUtbRLYc0AM1tl+YHUjBPZGyKgM7YcKfYQ== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qaedm-0002bk-O2; Mon, 28 Aug 2023 11:58:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qaedk-0002bW-6s for guix-patches@gnu.org; Mon, 28 Aug 2023 11:58:56 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qaedj-0006NK-VQ for guix-patches@gnu.org; Mon, 28 Aug 2023 11:58:55 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qaedp-0001Pm-Um for guix-patches@gnu.org; Mon, 28 Aug 2023 11:59:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#60571] [PATCH v2 4/4] gnu: skia: Activate tests. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 28 Aug 2023 15:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60571 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: Nicolas Graves Cc: 60571@debbugs.gnu.org Received: via spool by 60571-submit@debbugs.gnu.org id=B60571.16932383405431 (code B ref 60571); Mon, 28 Aug 2023 15:59:01 +0000 Received: (at 60571) by debbugs.gnu.org; 28 Aug 2023 15:59:00 +0000 Received: from localhost ([127.0.0.1]:48835 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qaedo-0001PW-27 for submit@debbugs.gnu.org; Mon, 28 Aug 2023 11:59:00 -0400 Received: from mail-qk1-x732.google.com ([2607:f8b0:4864:20::732]:62886) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qaedl-0001PH-Hr for 60571@debbugs.gnu.org; Mon, 28 Aug 2023 11:58:58 -0400 Received: by mail-qk1-x732.google.com with SMTP id af79cd13be357-76da819edc7so183213485a.1 for <60571@debbugs.gnu.org>; Mon, 28 Aug 2023 08:58:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693238325; x=1693843125; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=wxDN7X7Il1IAV3LRKPDI9KygPQ45PHE9LQhV/JqBX1k=; b=SUn0wLVjKJwvrn9rXqMfE9oa4iFhrZJ6ebm/VSwvFa0vAPsEUfQR6JB80S8KGG8PPW +oUetukeZSUBQbUy5BXR/o3m/hG60/EGWxiJsdzemFPE2s8nUQ3JlxV5smVTtYitMdi3 5glkVosiZQVfmntcmL77epxMH2KEwbudxh1WRWKaJJdaMoxbEi1n5wcMTNAU0hU7DBBX s25Z4VA4w8jQs3z10gkz8AO3A/iZU6aDSUs0c0td8fTyBUKWLpIp14qXgKbIYo5nnb3Z CqZV+Ntqff0/FUqAzUcjJKXoc6yqTPSuUJ33YDnFMxjPTzjbTxFzRoqcKNTVv3rp+yAu W9xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693238325; x=1693843125; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=wxDN7X7Il1IAV3LRKPDI9KygPQ45PHE9LQhV/JqBX1k=; b=WoRZio3KI4SgY+qemywzY7aqkuR+KkSoFClKN2+SDNaM4pH6gsKtLvhZCrGsIrtOPh JeiMm6gxsMqpdQ9fEGI0YQxmfhVsn+Bh4chtOQy2jqgiYG9lHU6yrKD9LJ8w7E0VS1f/ G9eZ6cTN+Yttri4bl6BabfmZLkLiYtihrvxJsntCJ4AM013kuXyVXqPPg07ue6vH6nX2 BQ+I/w+hsx6W/ku/0XbM2s9Ttm31MNhMjeSeVHqwUYNn7fv2ZZzGKDnnz4fRzYphQn7J 2bYV9hICNZo2N6sz6Cd49oVlriJmEx2wKpUSI6bWedCkpjp/xTFy/XK6cFcRvrZ4achj omeg== X-Gm-Message-State: AOJu0YzJWJ0KC3jRpyXK7pg2xhoiAe+20Y+/BSxtPEcWN0jC1fWxJKL+ Ii4obDHbw6jwJQ5nvACyo6uq3DU9XN8= X-Google-Smtp-Source: AGHT+IFB6aPWRrSmo/17T49jzT0hWsq7HMwbWKbujW1gA7NZXvFlkHWPKFqpfpwph9fmwsCmgx4aMg== X-Received: by 2002:a05:620a:4607:b0:76c:cd15:a8b5 with SMTP id br7-20020a05620a460700b0076ccd15a8b5mr21713qkb.21.1693238325048; Mon, 28 Aug 2023 08:58:45 -0700 (PDT) Received: from hurd (dsl-10-132-204.b2b2c.ca. [72.10.132.204]) by smtp.gmail.com with ESMTPSA id d15-20020a05620a140f00b007671678e325sm2450104qkj.88.2023.08.28.08.58.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Aug 2023 08:58:44 -0700 (PDT) From: Maxim Cournoyer References: Date: Mon, 28 Aug 2023 11:58:43 -0400 In-Reply-To: (Nicolas Graves's message of "Sun, 27 Aug 2023 14:53:42 +0200") Message-ID: <87zg2bf9ak.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx2.migadu.com X-Migadu-Spam-Score: 5.78 X-Spam-Score: 5.78 X-Migadu-Queue-Id: 0F23537B86 X-TUID: QHY3ujg4ohjJ Hello, Nicolas Graves writes: > * gnu/packages/graphics.scm (skia): Activate tests. Neat! > --- > gnu/packages/graphics.scm | 144 ++++++++++++++++++++++++++++++++++---- > 1 file changed, 132 insertions(+), 12 deletions(-) > > diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm > index 2a94bd51cc..edb0e82a54 100644 > --- a/gnu/packages/graphics.scm > +++ b/gnu/packages/graphics.scm > @@ -83,6 +83,7 @@ (define-module (gnu packages graphics) > #:use-module (gnu packages gstreamer) > #:use-module (gnu packages gtk) > #:use-module (gnu packages haskell-xyz) > + #:use-module (gnu packages icu4c) > #:use-module (gnu packages image) > #:use-module (gnu packages image-processing) > #:use-module (gnu packages imagemagick) > @@ -2017,10 +2018,6 @@ (define-public skia > (build-system gnu-build-system) ;actually GN + Ninja > (arguments > (list > - ;; Running the test suite would require 'dm'; unfortunately the tool > - ;; can only be built for debug builds, which require fetching third > - ;; party sources. > - #:tests? #f > #:phases > #~(modify-phases %standard-phases > (replace 'configure > @@ -2085,13 +2082,136 @@ (define-public skia > URL: https://skia.org/ > Version: ~a > Libs: -L${libdir} -lskia > -Cflags: -I${includedir}~%" #$output #$version)))))))) > - (native-inputs (list gn libjpeg-turbo ninja pkg-config python-wrapper)) > - (inputs (list expat fontconfig freetype harfbuzz mesa libwebp zlib)) > - (home-page "https://skia.org/") > - (synopsis "2D graphics library") > - (description > - "Skia is a 2D graphics library for drawing text, geometries, and images. > +Cflags: -I${includedir}~%" #$output #$version))))) > + (replace 'check > + (lambda* (#:key inputs native-inputs #:allow-other-keys) > + (let ((icu #$(this-package-native-input "icu4c-for-skia"))) > + ;; Configure SPIRV-Tools dependency. I think what this does is to unbundle these from the source? If that's the case, the comment should explicit that. > + (substitute* "BUILD.gn" > + (("deps \\+= \\[ \"\\/\\/third_party\\/externals\\/spirv-tools:spvtools_val\" \\]") > + "libs += [ \"SPIRV-Tools\" ]")) > + (substitute* "src/sksl/SkSLCompiler.cpp" > + (("\"spirv-tools/libspirv.hpp\"") > + "")) > + ;; Configure ICU dependency. > + (substitute* "third_party/icu/BUILD.gn" > + (("data_dir = \"\\.\\.\\/externals\\/icu\\/\"") > + (string-append "data_dir = \"" icu "/share/data/\"")) > + (("script = \"\\.\\.\\/externals\\/icu\\/scripts\\/") > + (string-append "script = \"" icu "/share/scripts/")) > + (("\\.\\.\\/externals\\/icu\\/common\\/icudtl.dat") > + (string-append icu "/share/data/icudtl.dat")) > + (("sources = icu_sources") > + "") > + (("sources \\+= \\[ \"\\$data_assembly\" \\]") > + "sources = [ \"$data_assembly\" ]")) The forward slashes (/) do not need to be escaped for ERE regexps, which is what Guile uses. This will help keep your above regexps more readable. > + ;; Enable system libraries without is_official_build=true. > + ;; Necessary because is_official_build prevents building dm. Please try to keep your comments full sentences, e.g. "This is necessary because ...". It may be a bit more efforts, but this effort pays off for the next human who'll read these :-). > + (for-each > + (lambda (libname) > + (let ((snake (string-join (string-split libname #\-) "_"))) > + (substitute* > + (string-append "third_party/" libname "/BUILD.gn") > + (((string-append "skia_use_system_" > + snake > + " = is_official_build.*")) > + (string-append "skia_use_system_" snake " = true"))))) > + '("zlib" "libjpeg-turbo" "harfbuzz" "libpng" "libwebp")) > + ;; Configure with gn. > + (invoke "gn" "gen" "out/Debug" > + (string-append > + "--args=" > + "cc=\"gcc\" " ;defaults to 'cc' > + "skia_compile_sksl_tests=false " ; disable some tests > + "skia_use_system_expat=true " ; use system expat library > + ;; Specify where to locate the includes. > + "extra_cflags=[" > + (string-join > + (map > + (lambda (lib) > + (string-append > + "\"-I" > + (search-input-directory > + inputs > + (string-append "include/" lib)) "\"")) > + '("harfbuzz" > + "freetype2" > + "spirv-tools" > + "spirv" > + "unicode")) > + ",") > + "] " > + ;; Otherwise the validate-runpath phase fails. > + "extra_ldflags=[" > + "\"-Wl,-rpath=" #$output "/lib\"" > + "] " > + ;; Disabled, otherwise the build system attempts to > + ;; download the SDK at build time. > + "skia_use_dng_sdk=false " > + "skia_use_runtime_icu=true ")) > + ;; Build dm testing tool. > + (symlink > + (string-append #$(this-package-native-input "gn") "/bin/gn") > + "./bin/gn") > + (invoke "ninja" "-C" "out/Debug" "dm") > + ;; Test require an X server. "The test suite requires ..." > + (let ((xvfb (search-input-file (or native-inputs inputs) > + "bin/Xvfb")) > + (display ":1")) > + (setenv "DISPLAY" display) > + (system (string-append xvfb " " display " &"))) > + ;; Run tests. > + (invoke "out/Debug/dm" "-v" > + "-w" "dm_output" > + "--codecWritePath" "dm_output" > + "--simpleCodec" > + "--skip" > + ;; These tests fail with segmentation fault. Upstream may be interested to know/have a solution. I'd try submitting a ticket to them, and link it here for future reference. > + "_" "_" "_" "Codec_trunc" > + "_" "_" "_" "AnimCodecPlayer" > + "_" "_" "_" "Codec_partialAnim" > + "_" "_" "_" "Codec_InvalidImages" > + "_" "_" "_" "Codec_GifInterlacedTruncated" > + "_" "_" "_" "SkText_UnicodeText_Flags" > + "_" "_" "_" "SkParagraph_FontStyle" > + "_" "_" "_" "flight_animated_image" What are these underscores? I don't know the 'dm' tool; a comment would be nice. > + ;; These tests fail because of Codec/Sk failure. > + "_" "_" "_" "AndroidCodec_computeSampleSize" > + "_" "_" "_" "AnimatedImage_invalidCrop" > + "_" "_" "_" "AnimatedImage_scaled" > + "_" "_" "_" "AnimatedImage_copyOnWrite" > + "_" "_" "_" "AnimatedImage" > + "_" "_" "_" "BRD_types" > + "_" "_" "_" "Codec_frames" > + "_" "_" "_" "Codec_partial" > + "_" "_" "_" "Codec_partialWuffs" > + "_" "_" "_" "Codec_requiredFrame" > + "_" "_" "_" "Codec_rewind" > + "_" "_" "_" "Codec_incomplete" > + "_" "_" "_" "Codec_InvalidAnimated" > + "_" "_" "_" "Codec_ossfuzz6274" > + "_" "_" "_" "Codec_gif_out_of_palette" > + "_" "_" "_" "Codec_xOffsetTooBig" > + "_" "_" "_" "Codec_gif" > + "_" "_" "_" "Codec_skipFullParse" > + "_" "_" "_" "AndroidCodec_animated_gif" > + ;; Other failures "These fail for unknown reasons". It's typically nice to forward these failures to upstream with the ticket URL referenced here. Often upstream can help explain them or find solutions. > + "_" "_" "_" "Gif" > + "_" "_" "_" "Wuffs_seek_and_decode" > + "_" "_" "_" "Skottie_Shaper_ExplicitFontMgr" > + "8888" "skp" "_" "_" > + "8888" "lottie" "_" "_" > + "gl" "skp" "_" "_" > + "gl" "lottie" "_" "_" > + "_" "_" "_" "ES2BlendWithNoTexture"))))))) > + (native-inputs (list gn libjpeg-turbo ninja pkg-config python-wrapper > + spirv-tools-for-skia spirv-headers-for-skia > + icu4c-for-skia glu xorg-server-for-tests)) > + (inputs (list expat fontconfig freetype harfbuzz mesa libwebp zlib)) > + (home-page "https://skia.org/") > + (synopsis "2D graphics library") > + (description > + "Skia is a 2D graphics library for drawing text, geometries, and images. > It supports: > @itemize > @item 3x3 matrices with perspective > @@ -2099,7 +2219,7 @@ (define-public skia > @item shaders, xfermodes, maskfilters, patheffects > @item subpixel text > @end itemize") > - (license license:bsd-3)))) > + (license license:bsd-3)))) Wooh! That must have taken some time to refine! Thanks a lot for the efforts! I think with the suggestions made above, a v3 would be ready to roll. -- Thanks, Maxim