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 wGKKFrnZsV6ldgAA0tVLHw (envelope-from ) for ; Tue, 05 May 2020 21:25:13 +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 MLvUNcTZsV6aAgAA1q6Kng (envelope-from ) for ; Tue, 05 May 2020 21:25:24 +0000 Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:470:142::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 70667940D32 for ; Tue, 5 May 2020 21:25:22 +0000 (UTC) Received: from localhost ([::1]:35964 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jW546-0007Yh-UW for larch@yhetil.org; Tue, 05 May 2020 17:25:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56330) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jW53r-0007XK-DW for bug-guix@gnu.org; Tue, 05 May 2020 17:25:07 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:54426) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jW53m-00084N-0v for bug-guix@gnu.org; Tue, 05 May 2020 17:25:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jW53l-0001VO-U0 for bug-guix@gnu.org; Tue, 05 May 2020 17:25:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#41028: Channel/inferior error with core-updates: Unbound variable: call-with-new-thread Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 05 May 2020 21:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41028 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Christopher Baines Received: via spool by 41028-submit@debbugs.gnu.org id=B41028.15887138795728 (code B ref 41028); Tue, 05 May 2020 21:25:01 +0000 Received: (at 41028) by debbugs.gnu.org; 5 May 2020 21:24:39 +0000 Received: from localhost ([127.0.0.1]:37739 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jW53J-0001UA-3o for submit@debbugs.gnu.org; Tue, 05 May 2020 17:24:39 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53204) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jW53H-0001Tr-CE for 41028@debbugs.gnu.org; Tue, 05 May 2020 17:24:31 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:36759) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jW53C-0006n7-3k; Tue, 05 May 2020 17:24:26 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=58774 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jW53A-0000Jb-G4; Tue, 05 May 2020 17:24:25 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <87h7wymj8a.fsf@cbaines.net> Date: Tue, 05 May 2020 23:24:22 +0200 In-Reply-To: <87h7wymj8a.fsf@cbaines.net> (Christopher Baines's message of "Sat, 02 May 2020 16:47:49 +0100") Message-ID: <87r1vyjcs9.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -3.3 (---) X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 41028@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Scanner: scn0 X-Spam-Score: -1.01 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 2001:470:142::17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Scan-Result: default: False [-1.01 / 13.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; GENERIC_REPUTATION(0.00)[-0.49569720341703]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2001:470:142::/48:c]; IP_REPUTATION_HAM(0.00)[asn: 22989(0.12), country: US(-0.00), ip: 2001:470:142::17(-0.50)]; DWL_DNSWL_BLOCKED(0.00)[2001:470:142::17:from]; MX_GOOD(-0.50)[cached: eggs.gnu.org]; RCPT_COUNT_TWO(0.00)[2]; MAILLIST(-0.20)[mailman]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_IN_DNSWL_FAIL(0.00)[2001:470:142::17:server fail]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:22989, ipnet:2001:470:142::/48, country:US]; MID_RHS_MATCH_FROM(0.00)[]; TAGGED_FROM(0.00)[larch=yhetil.org]; ARC_NA(0.00)[]; FROM_NEQ_ENVFROM(0.00)[ludo@gnu.org,bug-guix-bounces@gnu.org]; FROM_HAS_DN(0.00)[]; URIBL_BLOCKED(0.00)[gnu.org:url,cbaines.net:email]; MIME_GOOD(-0.10)[multipart/mixed,text/plain,text/x-patch]; MIME_TRACE(0.00)[0:+,1:+,2:+]; DMARC_NA(0.00)[gnu.org]; HAS_LIST_UNSUB(-0.01)[]; RCVD_COUNT_SEVEN(0.00)[9]; FORGED_SENDER_MAILLIST(0.00)[] X-TUID: jOgJda6AUOzM --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hey! Christopher Baines skribis: > =E2=86=92 guix build -f test.scm=20 > Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.= org/git/guix.git'... > Backtrace: > 4 (primitive-load "/gnu/store/8mv5bpjgxg9c369xnbb5rf1kv9r?") > In ice-9/eval.scm: > 619:8 3 (_ #(#(#(#(#(#(#(#(#(#(#(?) ?) ?) ?) ?) ?) ?) ?) ?) ?) ?)) > 182:19 2 (proc #(#(#(#(#(#(#(#(#(#(# ?) ?) ?) ?) ?) ?) ?) ?) ?) ?)) > 142:16 1 (compile-top-call # ?) > In unknown file: > 0 (%resolve-variable (7 . call-with-new-thread) #) > > ERROR: In procedure %resolve-variable: > Unbound variable: call-with-new-thread > guix build: error: You found a bug: the program '/gnu/store/8mv5bpjgxg9c3= 69xnbb5rf1kv9r6z5hw-compute-guix-derivation' > failed to compute the derivation for Guix (version: "e02c2f85b36ce1c733bd= 908a210ce1182bdd2560"; system: "x86_64-linux"; > host version: "a8cb1e72ef351330d1521833c1b270dcc0da593f"; pull-version: 1= ). A summary of the IRC discussion and experiments: 1. The underlying problem is a missing (ice-9 threads) import in the =E2=80=98compute-guix-derivation=E2=80=99 script, fixed in 05e783871c2c69b402e088863d46f5be7915ac74. 2. The =E2=80=98%quirks=E2=80=99 mechanism in (guix channels) doesn=E2=80= =99t work as is here because what we would need to change is the #:guile parameter passed to =E2=80=98gexp->script=E2=80=99 (the one defined in build-sel= f.scm). Attached a patch to add a quirk but that doesn=E2=80=99t solve the pro= blem. Possible solutions include: a. Changing the value returned by =E2=80=98default-guile=E2=80=99 as used= by =E2=80=98gexp->script=E2=80=99. b. Supporting the definition of quirks that patch the code. Thanks, Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/guix/channels.scm b/guix/channels.scm index 041fae2a9c..cbb0a97546 100644 --- a/guix/channels.scm +++ b/guix/channels.scm @@ -328,16 +328,34 @@ to '%package-module-path'." #f (apply throw args))))) +(define (missing-ice-9-threads-import? source) + "Return true of %SELF-BUILD-FILE is missing an (ice-9 threads) import as +described at ." + (define content + (call-with-input-file (string-append source "/" %self-build-file) + read-string)) + + ;; The faulty code uses 'call-with-new-thread' without importing (ice-9 + ;; threads). However, the 'call-with-new-thread' binding is no longer + ;; available in the default name space on Guile 3.0. + (and (string-contains content "(call-with-new-thread") + (not (string-contains content "(ice-9 threads)")))) + (define (guile-2.2.4) (module-ref (resolve-interface '(gnu packages guile)) 'guile-2.2.4)) +(define (guile-2.2) + (module-ref (resolve-interface '(gnu packages guile)) + 'guile-2.2)) + (define %quirks ;; List of predicate/package pairs. This allows us provide information ;; about specific Guile versions that old Guix revisions might need to use ;; just to be able to build and run the trampoline in %SELF-BUILD-FILE. See ;; - `((,syscalls-reexports-local-variables? . ,guile-2.2.4))) + `((,syscalls-reexports-local-variables? . ,guile-2.2.4) + (,missing-ice-9-threads-import? . ,guile-2.2))) (define* (guile-for-source source #:optional (quirks %quirks)) "Return the Guile package to use when building SOURCE or #f if the default @@ -372,32 +390,32 @@ package modules under SOURCE using CORE, an instance of Guix." (string-append source "/" %self-build-file)) (if (file-exists? script) - (let ((build (save-module-excursion - (lambda () - ;; Disable deprecation warnings; it's OK for SCRIPT to - ;; use deprecated APIs and the user doesn't have to know - ;; about it. - (parameterize ((guix-warning-port - (%make-void-port "w"))) - (primitive-load script))))) - (guile (guile-for-source source))) + (mlet* %store-monad ((guile -> (guile-for-source source)) + (_ (mwhen guile + (set-guile-for-build (pk 'G guile)))) + (build -> (save-module-excursion + (lambda () + ;; Disable deprecation warnings; it's + ;; OK for SCRIPT to use deprecated + ;; APIs and the user doesn't have to + ;; know about it. + (parameterize ((guix-warning-port + (%make-void-port "w"))) + (primitive-load script)))))) ;; BUILD must be a monadic procedure of at least one argument: the ;; source tree. ;; ;; Note: BUILD can return #f if it does not support %PULL-VERSION. In ;; the future we'll fall back to a previous version of the protocol ;; when that happens. - (mbegin %store-monad - (mwhen guile - (set-guile-for-build guile)) - ;; BUILD is usually quite costly. Install a "trivial" build handler - ;; so we don't bounce an outer build-accumulator handler that could - ;; cause us to redo half of the BUILD computation several times just - ;; to realize it gives the same result. - (with-trivial-build-handler - (build source #:verbose? verbose? #:version commit - #:pull-version %pull-version)))) + ;; BUILD is usually quite costly. Install a "trivial" build handler + ;; so we don't bounce an outer build-accumulator handler that could + ;; cause us to redo half of the BUILD computation several times just + ;; to realize it gives the same result. + (with-trivial-build-handler + (build source #:verbose? verbose? #:version commit + #:pull-version %pull-version))) ;; Build a set of modules that extend Guix using the standard method. (standard-module-derivation name source core dependencies))) --=-=-=--