From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:5f26::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id sDCZOmZthWUEGgAAkFu2QA (envelope-from ) for ; Fri, 22 Dec 2023 12:05:11 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id cPjVNGZthWV0EAAAqHPOHw (envelope-from ) for ; Fri, 22 Dec 2023 12:05:10 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=6xq.net header.s=MBO0001 header.b=z4RjWsdr; 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=6xq.net (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1703243110; 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: content-transfer-encoding:content-transfer-encoding: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=VQ3Lsqg3kZlm2qvS8Tp3qUAbBKrGpe8quQbqo7dtifY=; b=l2FTa13dDRbwZcwu702yi32RIQpEJpiJ9O8OMcUO93b6867BE6jIGl8eE04jmsB9A47kqB 61Vz86UpTrbrNe278gASw1Rxye3ezTWqe3ZDDiFQebSsWznOb/s2lXMrN/USiaHAziSWVN 8gBm6Dbrt6l9Powe/UltHAz2KAqh6pVQtdpU8f1+Pct+HUfkdlTS3ov4uVYZlv3OM+VC/5 gcpbYtEJ5ZIMJu/D1tfNBjUa8kfo3V4xufRTXrm0J+rwBZQQsqZ68BMNCj2WUKMJL6XXtt Ef+kBZ+yUPkDtlAVLJZOctk9EagqSwBwY/0pe/FCzYXn3q0nmPNgknn6+zJimw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1703243110; a=rsa-sha256; cv=none; b=nSbSCrMN81vhdAhdHZshLUtSmlCAVTypdeDxlWfwcCZiHLs0dDKLe797x7ryPdr4HjfrKF r3vu1Gr9Pn52Kwlg7vQLTrC9xhD3zAAeF4t/0Pv9vSAg9n+xK4ay5XIzMwGgSX+du9uqmt PQTh22F9ICT7mrGonnlBq1oQoEijhHOIR2VYJpNvxs7z7VLnoJNNiko3CLOlPHd9Zy2xxs F1aCNsTsixj82kthIbUX5xdzCp1guPev33TZMHYGGLfKenxQf8v9EPyCbzXiR4m2VhZTRl Wv+ay2Km9xTcVGUUsbVPfP3D1lwrGcBn3jqYZ93inLD6cjRTAE62EgncnfuVlQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=6xq.net header.s=MBO0001 header.b=z4RjWsdr; 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=6xq.net (policy=none) 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 0418E54BC8 for ; Fri, 22 Dec 2023 12:05:10 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rGdKu-0004vv-7w; Fri, 22 Dec 2023 06:05:00 -0500 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 1rGdKs-0004vn-0w for guix-patches@gnu.org; Fri, 22 Dec 2023 06:04:58 -0500 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 1rGdKr-0006UM-Ne for guix-patches@gnu.org; Fri, 22 Dec 2023 06:04:57 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rGdKv-0000OE-Vw for guix-patches@gnu.org; Fri, 22 Dec 2023 06:05:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#67921] [PATCH haskell-team 2/3] gnu: ghc: Use version 9.4.8 as the default Resent-From: Lars-Dominik Braun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 22 Dec 2023 11:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67921 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Saku Laesvuori Cc: 67921@debbugs.gnu.org Received: via spool by 67921-submit@debbugs.gnu.org id=B67921.17032430471397 (code B ref 67921); Fri, 22 Dec 2023 11:05:01 +0000 Received: (at 67921) by debbugs.gnu.org; 22 Dec 2023 11:04:07 +0000 Received: from localhost ([127.0.0.1]:46113 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rGdK2-0000MR-Gm for submit@debbugs.gnu.org; Fri, 22 Dec 2023 06:04:06 -0500 Received: from mout-p-101.mailbox.org ([2001:67c:2050:0:465::101]:54470) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rGdK0-0000Lu-Dd for 67921@debbugs.gnu.org; Fri, 22 Dec 2023 06:04:05 -0500 Received: from smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4SxPYg5Pdnz9snR; Fri, 22 Dec 2023 12:03:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6xq.net; s=MBO0001; t=1703243031; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VQ3Lsqg3kZlm2qvS8Tp3qUAbBKrGpe8quQbqo7dtifY=; b=z4RjWsdrKIRSB89/gKaAz8lq3uGOo2NrFkUMMT11/rDyKEBOQ6CBXV6dF4Ze3oLbeuyzWY Bz4MHW2idgqzL7n9P0hEaPccxyo3BfwoqaGiNifPOAAfs640Nx63BhMM/pzjxU/L/e+pNe Lj7o0Srsjwa6VyJDIcKCmO40zqyFZGpf+FmD2CyhJYthhbR3QeHoVaTwLzjkMKWEQG4y+S BadfGwKhsl7lvuSNRQDFR+z0behk4xTzpPGmU6q9sqaMJEQnODIrxIZZwKlLt1SFL8D8mB RmhN+VrcwMIlnuAEoJBSgq6lD2crxkjrF9pJ/bu1H7IzcoVjCUCh9+fI1V03Bw== Date: Fri, 22 Dec 2023 12:03:49 +0100 From: Lars-Dominik Braun Message-ID: References: <5cdfcf3aadfbe42655b941764d5a700b6d4bca88.1703056111.git.saku@laesvuori.fi> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="U4w8i89Nmx6nxVXh" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -5.16 X-Spam-Score: -5.16 X-Migadu-Queue-Id: 0418E54BC8 X-Migadu-Scanner: mx11.migadu.com X-TUID: AVhsmDV+jTRJ --U4w8i89Nmx6nxVXh Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit Hi Saku, > Because I wrote that patch when there wasn't yet a Stackage release for > ghc 9.6. But if a stackage release for it has now been released I'll try > updating it to 9.6. oh, I see. I believe 9.6 drops the Makefile-based build-system, making it a slightly more involved upgrade. > Regarding the big upgrade, I have been wondering how could the cabal > revisions be updated automatically. I’ve been using the script attached, which basically overwrites the entire package, except for synopsis and description. > Is there some reason why the revision is not part of the package > version? I don’t know. > Moving it there would probably be much easier than modifying > guix refresh (but then again, if those modifications should be done > anyway it doesn't really reduce the amount of work) The thing is that we still need the cabal file hash somewhere and it needs to be updated. My idea was to create a new HACKAGE-URI procedure, which accepts package name, version, revision and cabal file hash and add some black magic to combine the new cabal file with the tarball from hackage. Code exists for this, but I’ve never been able to finalize it. Lars --U4w8i89Nmx6nxVXh Content-Type: application/vnd.lotus-screencam Content-Disposition: attachment; filename="haskell-update.scm" Content-Transfer-Encoding: quoted-printable (use-modules (guix import stackage)=0A (guix import hackage)=0A= (guix packages)=0A (guix utils)=0A (gu= ix read-print)=0A (guix build-system haskell)=0A (g= uix diagnostics)=0A (gnu packages)=0A (ice-9 match)= =0A (srfi srfi-1)=0A (srfi srfi-9 gnu))=0A=0A(defin= e (package-sexp->properties package)=0A (match package=0A ((and expr ('= package fields ...))=0A (match expr=0A ((path *** ('properties ('= list sym ...)))=0A sym)=0A (_ '())))=0A (x=0A (pk 'nop= e))))=0A=0A(define (replace-package-sexp-field package field after replacem= ent)=0A "Replace PACKAGE=E2=80=99s FIELD with REPLACEMENT."=0A (match pac= kage=0A ((and expr ('package fields ...))=0A `(package=0A ,@(= fold (lambda (arg accum)=0A (match arg=0A = ((name args)=0A (if (eq? name field)=0A = (append (list `((,field ,@replacement))) accum)=0A = (append (list name args) accum)))=0A ((? com= ment? comment) comment)=0A (_ (error "nope"))))=0A = '() fields)))=0A (x=0A (pk 'nope))))=0A=0A(define (package= -field-location* package field)=0A "Return the source code location of the= definition of FIELD for PACKAGE, or=0A#f if it could not be determined."= =0A (match (package-location package)=0A (($ file line colum= n)=0A (match (search-path %load-path file)=0A ((? string? file-fo= und)=0A (catch 'system-error=0A (lambda ()=0A ;;= In general we want to keep relative file names for modules.=0A = (call-with-input-file file-found=0A (lambda (port)=0A = (go-to-location port line column)=0A (match (read por= t)=0A (('package inits ...)=0A (let ((fi= eld (assoc field inits)))=0A (match field=0A = ((_ value)=0A (let ((loc (and=3D> (sourc= e-properties field)=0A source-prop= erties->location)))=0A (and loc=0A = ;; Preserve the original file name, which may be a=0A = ;; relative file name.=0A = (set-field loc (location-file) file))))=0A (_=0A= #f))))=0A (_=0A = #f)))))=0A (lambda _=0A #f)))=0A (#f=0A ;;= FILE could not be found in %LOAD-PATH.=0A #f)))=0A (_ #f)))=0A= =0A(define (add-upstream-name package)=0A (let* ((location (package-field-= location* package 'build-system))=0A (column (location-column locat= ion))=0A (upstream-name (guix-package->hackage-name package))=0A = (properties (package-properties package))=0A (existing-upstre= am-name (assoc-ref properties 'upstream-name))=0A (properties-exist= ? (not (null? properties))))=0A (cond=0A ((not location) (format #t= "No location for build-system, bailing on ~a~%" upstream-name))=0A (e= xisting-upstream-name (format #t "Upstream name ~a exists for ~a~%" existin= g-upstream-name upstream-name))=0A (properties-exist? (format #t "Prop= erties exist for ~a, bailing. ~a~%" upstream-name properties))=0A (ups= tream-name=0A (begin=0A (format #t "Adding upstream name ~a= to ~a at ~a~%" upstream-name (package-name package) location)=0A = (edit-expression=0A (location->source-properties location)=0A = (lambda (str)=0A (let ((properties `(properties (quote (= (upstream-name . ,upstream-name))))))=0A (string-append str "= \n" (make-string column #\space) (object->string* properties column))))))))= ))=0A=0A(define (package-source-uri-location package)=0A "Return the sourc= e code location of the definition of FIELD for PACKAGE, or=0A#f if it could= not be determined."=0A (match (package-location package)=0A (($ file line column)=0A (match (search-path %load-path file)=0A = ((? string? file-found)=0A (catch 'system-error=0A (lambda= ()=0A ;; In general we want to keep relative file names for mod= ules.=0A (call-with-input-file file-found=0A (lambd= a (port)=0A (go-to-location port line column)=0A = (match (read port)=0A ((path *** ('source source))=0A = (match source=0A ((path *** ('uri u= ri))=0A (let ((loc (and=3D> (source-properties uri)= =0A source-properties->location)))= =0A (and loc=0A ;; P= reserve the original file name, which may be a=0A = ;; relative file name.=0A (set-field loc= (location-file) file))))))=0A (m=0A (be= gin=0A (format #t "Nothing found at ~a~%" m)=0A = #f))))))=0A (lambda _=0A #f)))=0A (#f= =0A ;; FILE could not be found in %LOAD-PATH.=0A #f)))=0A = (_ #f)))=0A=0A(define (add-hackage-uri package)=0A (let* ((location (packa= ge-source-uri-location package))=0A (column (and=3D> location locat= ion-column))=0A (upstream-name (assq-ref (package-properties packag= e) 'upstream-name))=0A (uri `(hackage-uri ,upstream-name version)))= =0A (cond=0A ((not location) (format #t "Not adding uri ~a to ~a, n= o location" uri (package-name package)))=0A ((not upstream-name) (form= at #t "Not adding uri ~a to ~a, not hackage" uri (package-name package)))= =0A (else=0A (format #t "Adding uri ~a to ~a at ~a~%" uri (pack= age-name package) location)=0A (edit-expression=0A (location= ->source-properties location)=0A (lambda (str) (object->string* uri= column)))))))=0A=0A(define (package-sexp->version package)=0A (match pack= age=0A ((and expr ('package fields ...))=0A (match expr=0A ((p= ath *** ('version version))=0A version)))=0A (x=0A (pk 'nope= ))))=0A=0A(define (package-sexp->arguments package)=0A (match package=0A = ((and expr ('package fields ...))=0A (match expr=0A ((path *** = ('arguments arguments))=0A arguments)=0A (_ #f)))=0A (x=0A= (pk 'nope))))=0A=0A(define (replace-package-sexp-field package field r= eplacement)=0A "Replace PACKAGE=E2=80=99s FIELD with REPLACEMENT."=0A (ma= tch package=0A ((and expr ('package fields ...))=0A `(package ,@(map= (lambda (x) (if (eq? (car x) field) `(,(car x) (,@replacement)) x)) fields= )))=0A (x=0A (error (format #f "cannot replace sexp field ~a in ~a" = field package)))))=0A=0A(define (update-package package)=0A (let* ((locati= on (package-location package))=0A (column (and=3D> location locatio= n-column))=0A (upstream-name (assq-ref (package-properties package)= 'upstream-name))=0A (old-version (package-version package))=0A = (old-arguments (package-arguments package)))=0A (cond=0A ((not= location) (format #t "Not updating ~a, because it has no location~%" (pack= age-name package)))=0A ((not upstream-name) (format #t "Not updating ~= a, because it has no upstream name~%" (package-name package)))=0A (els= e=0A (let* ((new-package (with-exception-handler=0A = (lambda (e) #f)=0A (lambda ()= (stackage->guix-package upstream-name))=0A = #:unwind? #t))=0A (new-version (package-sexp->version new-pac= kage))=0A (new-arguments (package-sexp->arguments new-package= )))=0A (cond=0A ((not new-package)=0A (form= at #t "Not updating ~a, cannot import package.~%" (package-name package)))= =0A ; XXX: also compare arguments=0A ((and (equal? old= -version new-version) (eq? old-arguments new-arguments))=0A (fo= rmat #t "Not updating ~a, same version.~%" (package-name package)))=0A = (else=0A (begin=0A (format #t "Updating pack= age ~a to ~a at ~a~%" (package-name package) new-version location)=0A = (edit-expression=0A (location->source-properties loca= tion)=0A (lambda (str) (object->string* (replace-package-sexp= -field=0A (replace-package-sexp-field new-pac= kage 'synopsis (package-synopsis package))=0A = 'description (package-description package))=0A = column)))))))))))=0A=0A(match (program-arguments)=0A ((p= rogname name)=0A (update-package (specification->package name))))=0A=0A --U4w8i89Nmx6nxVXh--