From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 6CF8Kb4hQ1/eJQAA0tVLHw (envelope-from ) for ; Mon, 24 Aug 2020 02:11:10 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id WONOJb4hQ19VEgAA1q6Kng (envelope-from ) for ; Mon, 24 Aug 2020 02:11:10 +0000 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 11FEC940704 for ; Mon, 24 Aug 2020 02:11:09 +0000 (UTC) Received: from localhost ([::1]:58704 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kA1wy-0008Jt-RC for larch@yhetil.org; Sun, 23 Aug 2020 22:11:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39406) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kA1wq-0008Jj-6Q for guix-devel@gnu.org; Sun, 23 Aug 2020 22:11:00 -0400 Received: from mail-qk1-x72b.google.com ([2607:f8b0:4864:20::72b]:43506) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kA1wo-0002UZ-3l for guix-devel@gnu.org; Sun, 23 Aug 2020 22:10:59 -0400 Received: by mail-qk1-x72b.google.com with SMTP id o64so82388qkb.10 for ; Sun, 23 Aug 2020 19:10:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=gjbDQl3S/SuUhFz+M5hlmUxmq2iTQ/4gORy6PiEi/ik=; b=AgEMoLRN0QkDKSPvJ92PjsjUrie3AlyRnqpYdkuUF9kvauLsHbGplHToO2PKuRHpJH ajVie8njXj3QKMCCxIgJHOcyK0SI6uiV7u7aW32iFsyPy+G1z4gZBKuVBTX2gOnBRLMm 8zmBIzwDrQ3cHVeXj5639PgopP3fuunLlCG207Ifk+V8sA6cFy851kb9eZBGfhaiVVyT Sjt68xNKYH9jWkOpLnwtd18b+vQIjjRwP6hcm1bfM+sfEosvgwQU4r27QuppdvZVpBYK UC/h14IPesWboX/L9thdh5jWWQ8Xnqt+26pBtNm2kQ6klyFQCmuDEzQ7F32OgyKYXv1v De/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=gjbDQl3S/SuUhFz+M5hlmUxmq2iTQ/4gORy6PiEi/ik=; b=bPOTa4iWuLI0cQTVQOtnCtCLWH+FVSlQ7YocCjwepvBEM/gvTrjpxvC7U7VqiImp+x MIUIuM+GdI/WlECjUutvKp5/PWh/SGKenzA3MtPfNFnMC4tSj+S9qyGJYAn/5UYscsNe FSOWC7PNMbUCl5e0JdrVzvBnEqbQaT4loSPoAClbNFfbrippzetl4h/upDHaFWhtcZHk /s6Ijmd1D7ajvm0AKlIKp/gMcTce0wzNtsUuy9h8l0X1a7DfD5XSSd7L4xWRN8TpdzPS 6xhAeKEZpbQSKQIC5BGh6vA24wJGCGO/FujOvE1lEMpjLRnG3uAH8UZTCR38jqNHxiUH eDLA== X-Gm-Message-State: AOAM533f4g2sALX+eWT+TBuj8wiAEZ4i+dsedgveUvxDWmz7bJAQ8cVE SMqw0O97A6k87TXQGpiSoAaHdQ9j5e0= X-Google-Smtp-Source: ABdhPJypZponnVaCPt2b1FCuMpYhesMKDkgFVRczKX7hU5Et61y+12LeCvRqX72cVIGBoQI/hnP6Jw== X-Received: by 2002:a37:67c7:: with SMTP id b190mr2796191qkc.383.1598235056199; Sun, 23 Aug 2020 19:10:56 -0700 (PDT) Received: from hurd (dsl-155-199.b2b2c.ca. [66.158.155.199]) by smtp.gmail.com with ESMTPSA id k1sm8575158qkf.12.2020.08.23.19.10.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Aug 2020 19:10:55 -0700 (PDT) From: maxim.cournoyer@gmail.com To: guix-devel Subject: Dependency cycle issues when using a Gexp-based snippet Date: Sun, 23 Aug 2020 22:10:50 -0400 Message-ID: <87h7ssx07p.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::72b; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qk1-x72b.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=AgEMoLRN; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Spam-Score: -0.21 X-TUID: EHfM4zgCwenU Hello, While trying to move some of the patching done to qtbase into a snippet, with the goal of having at least the ./configure script runnable in a guix environment without having to manually run patching phases: --8<---------------cut here---------------start------------->8--- modified gnu/packages/qt.scm @@ -45,6 +45,7 @@ #:use-module (guix build-system gnu) #:use-module (guix build-system trivial) #:use-module (guix build-system python) + #:use-module (guix gexp) #:use-module (guix packages) #:use-module (guix deprecation) #:use-module (guix utils) @@ -349,27 +350,36 @@ developers using C++ or QML, a CSS & JavaScript like language.") ;; TODO Remove ((gnu packages kde) qtbase-for-krita) when upgrading qtbase. (version "5.14.2") (source (origin - (method url-fetch) - (uri (string-append "https://download.qt.io/official_releases/qt/" - (version-major+minor version) "/" version - "/submodules/" name "-everywhere-src-" - version ".tar.xz")) - (sha256 - (base32 - "12mjsahlma9rw3vz9a6b5h2s6ylg8b34hxc2vnlna5ll429fgfa8")) - ;; Use TZDIR to avoid depending on package "tzdata". - (patches (search-patches "qtbase-use-TZDIR.patch" - "qtbase-moc-ignore-gcc-macro.patch")) - (modules '((guix build utils))) - (snippet - ;; corelib uses bundled harfbuzz, md4, md5, sha3 - '(begin - (with-directory-excursion "src/3rdparty" - (for-each delete-file-recursively - (list "double-conversion" "freetype" "harfbuzz-ng" - "libpng" "libjpeg" "pcre2" "sqlite" "xcb" - "zlib")) - #t))))) + (method url-fetch) + (uri (string-append "https://download.qt.io/official_releases/qt/" + (version-major+minor version) "/" version + "/submodules/" name "-everywhere-src-" + version ".tar.xz")) + (sha256 + (base32 + "12mjsahlma9rw3vz9a6b5h2s6ylg8b34hxc2vnlna5ll429fgfa8")) + ;; Use TZDIR to avoid depending on package "tzdata". + (patches (search-patches "qtbase-use-TZDIR.patch" + "qtbase-moc-ignore-gcc-macro.patch")) + (snippet + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils)) + ;; corelib uses bundled harfbuzz, md4, md5, sha3 + (with-directory-excursion "src/3rdparty" + (for-each delete-file-recursively + (list "double-conversion" "freetype" "harfbuzz-ng" + "libpng" "libjpeg" "pcre2" "sqlite" "xcb" + "zlib"))) + + (let ((coreutils #+(canonical-package coreutils))) + (substitute* "configure" + (("/bin/pwd") + (string-append coreutils "/bin/pwd"))) + (substitute* "src/corelib/global/global.pri" + (("/bin/ls") + (string-append coreutils "/bin/ls")))) + #t))))) (build-system gnu-build-system) (propagated-inputs `(("mesa" ,mesa) --8<---------------cut here---------------end--------------->8--- I encountered the following issue, which seems similar to one encountered by Ricardo in 2016 [0]: --8<---------------cut here---------------start------------->8--- ice-9/eval.scm:293:34: error: canonical-package: unbound variable hint: Did you forget a `use-modules' form? --8<---------------cut here---------------end--------------->8--- The origin can be correctly built at the REPL, so the problem indeed seems to be a dependency cycle. Attempting a suggested fix by Ludovic in that same conversation [0], namely, making the snippet field of the record a thunked one: --8<---------------cut here---------------start------------->8--- modified guix/packages.scm @@ -250,7 +250,8 @@ as base32. Otherwise, it must be a bytevector." (patches origin-patches ; list of file names (default '()) (delayed)) - (snippet origin-snippet (default #f)) ; sexp or #f + (snippet origin-snippet + (default #f) (thunked)) ; sexp or #f (patch-flags origin-patch-flags ; list of strings (default '("-p1"))) --8<---------------cut here---------------end--------------->8--- It now seems a new cycle is introduced because trying to build anything hangs using the CPU with slowly increasing memory usage: ./pre-inst-env guix build hello How can we make Gexp-based snippets such as the one shown above work without introducing problematic cycles? Thanks, Maxim [0] http://logs.guix.gnu.org/guix/2016-09-30.log#163047