From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 01 18:01:33 2022 Received: (at submit) by debbugs.gnu.org; 1 Oct 2022 22:01:33 +0000 Received: from localhost ([127.0.0.1]:45800 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oekY7-0003c7-Qh for submit@debbugs.gnu.org; Sat, 01 Oct 2022 18:01:33 -0400 Received: from lists.gnu.org ([209.51.188.17]:43874) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oekY5-0003bx-An for submit@debbugs.gnu.org; Sat, 01 Oct 2022 18:01:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44224) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oekY4-0002nh-U9 for guix-patches@gnu.org; Sat, 01 Oct 2022 18:01:28 -0400 Received: from out0.migadu.com ([94.23.1.103]:48946) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oekY0-0000ZA-JZ for guix-patches@gnu.org; Sat, 01 Oct 2022 18:01:28 -0400 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codesections.com; s=key1; t=1664661681; 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; bh=ySt7yoFDTiuvK20i6ADWnEu0qm68BOpWySC7MZkYgzo=; b=nsk2zjFjbPZkD6TsD5jeNbcMcCsPRxemVNmqM9jMEhB+JCpO+WVEYlg7TkYiTIqYZN5JjL 7AI9bE0cBiyg0Id7ziPl7NIv+gmj5RzHyoUQifEegjK/VIvq268aMiUx3UGXlztIILUDFQ r8S/wYZI+G+un4S8ME6rT5Fa3hJtd6ex6pbf1nX8INkEqmX9rJcIxCSprqSKBYLHaAZqAn 9HWFKoZogpGDvflkZy3zt7NH7KdvHw2dC1Pxhnb+LNAsUSaOyBdr4J3e1xHVobSYFRBdkQ oaKAX7DvXVjfajL7VGpap02qkRUx3MZNeDQqlW5RY5dJdFRXBCt72r/Vl454jw== Date: Sat, 01 Oct 2022 22:01:20 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: "Daniel Sockwell" Message-ID: <7a3e89c7546867c54d76824ac8f47cb1@codesections.com> Subject: [PATCH] rakdo-build-system To: guix-patches@gnu.org X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=94.23.1.103; envelope-from=daniel@codesections.com; helo=out0.migadu.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit Cc: brown121407@posteo.ro, Maxime Devos , paul@apatience.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) I previously submitted patch #46352, which was an attempt to update=0Athe= Raku ecosystem and received very helpful feedback from Maxime=0ADevos. = While revising my patch based on that feedback, I realized=0Athat the iss= ue preventing updates to the Raku ecosystem were larger=0Athan I had real= ized.=0A=0AIn fact, I discovered that I wasn't the first person to try to= solve=0Athem: patch #55179 by Paul A. Patience was another attempt in Ap= ril.=0AAnd Paul _also_ wasn't the first attempt; his patch mentioned that= =0Ahe didn't know about patch #46352 by Alexandru-Sergiu Marton from =0AF= ebruary 2021.=0A=0AGiven that two previous patches had attempted to updat= e the Raku=0Aecosystem without success and that my patch was running into= some=0Aof the same issues that had been a problem for Paul, I decided to= =0Atake a step back and figure out what was posing such a problem.=0A=0AI= realized that the problem was that the rakudo-build-system didn't=0Ahave= a complete solution for handling Raku precompilation. To fix=0Athis, I = ended up rewiting the rakudo-build-system to add that support;=0Adoing so= seems to have resolved the issue.=0A=0AThis patch is part 1 of three, an= d contains only the changes to the=0Abuild system. The second patch will= have the changes to the core Raku=0Apackages that the rest of the ecosys= tem depend on (Rakudo, NQP, Zef,=0Aetc). Finally, the third will adapt t= he remaining ecosystem packages=0Ato the new version of the build system.= =0A=0AI hope that this 4th patch series will result in Guix being able to= =0Apackage an up-to-date version of Rakudo!=0A=0ABest regards,=0ADaniel = =0A=0A=0AFrom f03ba44cdab7c3a200cd8f71624848490fdd1099 Mon Sep 17 00:00:0= 0 2001=0AMessage-Id: =0AFrom: Daniel Sockwell =0ADate: Sat, 1 Oct 2022 17:24:20 -0400=0ASubject: [PATCH] build-sy= stem/rakudo: rewrite to support precomp=0A=0ASignificantly rewrite the Ra= kudo build system to support precompiling=0ARaku programs and to work wit= h modern versions of Rakudo. This has=0Apreviously been a significant bl= ocker to updating Raku programs, see=0A,=0A, and=0A.=0A=0A* guix/build/rakudo-build-system.scm: significant change= s=0A* guix/build-system/rakudo.scm: minor corresponding changes=0A---=0A = guix/build-system/rakudo.scm | 31 +--=0A guix/build/rakudo-build-s= ystem.scm | 392 +++++++++++++++++++++--------=0A 2 files changed, 309 ins= ertions(+), 114 deletions(-)=0A=0Adiff --git a/guix/build-system/rakudo.s= cm b/guix/build-system/rakudo.scm=0Aindex 05a4d9c2ad..b9c9d3c612 100644= =0A--- a/guix/build-system/rakudo.scm=0A+++ b/guix/build-system/rakudo.sc= m=0A@@ -54,7 +54,7 @@ (define (default-rakudo)=0A (define (default-prove6= )=0A "Return the default perl6-tap-harness package for tests."=0A (le= t ((module (resolve-interface '(gnu packages perl6))))=0A- (module-ref= module 'perl6-tap-harness)))=0A+ (module-ref module 'perl6-prove6)))= =0A =0A (define (default-zef)=0A "Return the default perl6-zef package.= "=0A@@ -62,19 +62,20 @@ (define (default-zef)=0A (module-ref module '= perl6-zef)))=0A =0A (define* (lower name=0A- #:key source = inputs native-inputs outputs=0A+ #:key source inputs nativ= e-inputs=0A+ outputs=0A system target=0A = (rakudo (default-rakudo))=0A (prove6 (defa= ult-prove6))=0A (zef (default-zef))=0A- (w= ith-prove6? #t)=0A- (with-zef? #t)=0A+ (tes= ts? #t)=0A+ (test-runner "zef")=0A #:allow= -other-keys=0A #:rest arguments)=0A "Return a bag for N= AME."=0A (define private-keywords=0A '(#:target #:rakudo #:prove6 #= :zef #:inputs #:native-inputs))=0A-=0A+ =0A (and (not target) = ;XXX: no cross-compilation=0A (bag=0A = (name name)=0A@@ -87,12 +88,14 @@ (define private-keywords=0A = ;; Keep the standard inputs of 'gnu-build-system'.=0A = ,@(standard-packages)))=0A (build-inputs `(= ("rakudo" ,rakudo)=0A- ,@(if with-prove6?=0A- = `(("perl6-tap-harness" ,prove6)=0A- = ,@(if with-zef?=0A- = `(("perl6-zef" ,zef))=0A- '(= )))=0A- '())=0A+ ,@= (cond ((not tests?)=0A+ '())=0A+ = ((and tests? (eq? test-runner "zef"))=0A+ = `(("test-runner-zef" ,zef))) =0A+ = ((and tests? (eq? test-runner "prove6"))=0A+ = `(("test-runner-prove6" ,prove6)))=0A+ = (else '()))=0A+ =0A = ,@native-inputs))=0A (outputs outputs)=0A = (build rakudo-build)=0A@@ -104,11 +107,10 @@ (define* (rakudo-build= name inputs=0A (search-paths '())=0A = (tests? #t)=0A (phases '%standard-phase= s)=0A- (outputs '("out"))=0A+ = outputs =0A (system (%current-system))=0A = (guile #f)=0A- (with-zef? #t)=0A- = (with-prove6? #t)=0A+ (test-ru= nner "zef")=0A (imported-modules %rakudo-build-sys= tem-modules)=0A (modules '((guix build rakudo-buil= d-system)=0A (guix build utils))))=0A@@= -125,6 +127,7 @@ (define builder=0A #:phases #$p= hases=0A #:system #$system=0A = #:tests? #$tests?=0A+ #:test-runner #$test-ru= nner=0A #:outputs #$(outputs->gexp outputs)=0A = #:inputs #$(input-tuples->gexp inputs)))))=0A =0Adi= ff --git a/guix/build/rakudo-build-system.scm b/guix/build/rakudo-build-s= ystem.scm=0Aindex 5cf1cc55bc..82f08f56c3 100644=0A--- a/guix/build/rakudo= -build-system.scm=0A+++ b/guix/build/rakudo-build-system.scm=0A@@ -22,132= +22,324 @@ (define-module (guix build rakudo-build-system)=0A #:use-mo= dule (guix build utils)=0A #:use-module (ice-9 ftw)=0A #:use-module (= ice-9 match)=0A+ #:use-module (ice-9 regex)=0A+ #:use-module (ice-9 rde= lim)=0A #:use-module (srfi srfi-1)=0A #:use-module (srfi srfi-26)=0A+= #:use-module (srfi srfi-34)=0A+ #:use-module (srfi srfi-35)=0A #:exp= ort (%standard-phases=0A rakudo-build))=0A =0A ;; Commentary:= =0A ;;=0A-;; Builder-side code of the standard Rakudo package build proce= dure.=0A+;; Builder-side code of the Rakudo build procedure for Raku pack= ages.=0A+;;=0A+;;=0A+;; The rakudo-build-system uses the Rakudo compiler = to compile and install Raku=0A+;; programs, and then uses a Raku test run= ner (e.g., Zef) to test those=0A+;; programs. The Rakudo build system is= an extension of the GNU build system=0A+;; that is customized ways to su= pport Raku packages, especially for=0A+;; precompilation. The Rakudo bui= ld system accepts one non-standard argument:=0A+;;=0A+;; #:test-runner -= The Test Anything Protocol program used to run tests.=0A+;; = (ignored if #:tests? #f)=0A+;; Valid values: "zef" - [default] U= se perl6-zef, which is closest to how =0A+;; te= sts are normally run in the Raku ecosystem.=0A+;; "prove6"= - Use perl6-prove6, a Raku TAP test runner=0A+;; "rakudo"= - Run tests directly via Rakudo (no TAP test runner)=0A+;;=0A+;; This bu= ild system configures Raku programs to write a metadata cache to=0A+;; $X= DG_DATA_HOME/raku/repo=0A+;;=0A+;; The above should be all you need to kn= ow to package Raku programs with the=0A+;; Rakudo build system; the rest = of this commentary provides background on the=0A+;; build system and Raku= precompilation generally.=0A+;;=0A+;; Raku's strategy for dependency man= agement is remarkably similar to Guix's:=0A+;; Raku compiles each program= into an immutable output; then, whenever that=0A+;; program's (recursive= ) inputs change, Raku generates a new output and=0A+;; redirects the rele= vant references to that new output. This gives Raku many=0A+;; of the sa= me advantages that Guix enjoys, including allowing simultaneous=0A+;; ins= tallation of multiple package versions.=0A+;;=0A+;; But the similarity be= tween Guix and Raku creates an issue for packaging Raku=0A+;; programs: R= aku expects to be able to manage its equivalent to /gnu/store/ by=0A+;; r= ecompiling Raku programs in their install location. This doesn't work wh= en=0A+;; those programs are installed in Guix's actual, read-only /gnu/st= ore/. Thus,=0A+;; integrating Raku and Guix requires some care.=0A+;;=0A= +;; Specifically, because Raku can't update precomp files in /gnu/store/,= Guix=0A+;; needs replace Raku as the director of Raku's precomp process,= including by=0A+;; guaranteeing that every Raku package is fully precomp= iled at install time.=0A+;; This is different from how Raku normally hand= les precomp (partly lazily, with=0A+;; some precomp delayed until a modul= e is first loaded).=0A+;;=0A+;; Accordingly, the Rakudo build system inst= alls all precomp files to the store.=0A+;; The only non-store data a Raku= package should generate is a metadata index=0A+;; consisting of *.repo-i= d files and *.lock files that gets written to=0A+;; $XDG_DATA_HOME/raku/r= epo. Raku reads this index to avoid the need to check=0A+;; input integr= ity, which is purely a performance optimization =E2=80=93 Raku=0A+;; auto= matically rebuilds the index if it's missing.=0A+;;=0A+;; The Rakudo buil= d system supports using Guix-installed packages in combination=0A+;; with= Zef-installed ones. (Zef is the LPM (language package manager) that=0A+= ;; Raku developers use, i.e., Raku's equivalent to Rust's Cargo or JavaSc= ript's=0A+;; NPM/Yarn/PNPM.) Programs installed via Zef have all their d= ata installed to=0A+;; the same ./raku/repo directory used for Guix-insta= lled packages' metadata.=0A+;; After installation, Zef-installed packages= be used interchangeably with Raku=0A+;; packages installed via Guix =E2= =80=93 though, of course, they lack access to=0A+;; rollbacks, build tran= sformations, and the rest of Guix's superpowers.=0A+;;=0A+;; Including Ra= ku precomp files in the Guix store creates one minor issue: it=0A+;; decr= eases the number of Raku packages that pass "guix build --check". This= =0A+;; shouldn't be the case: In theory, Raku precomp files are bit-for-b= it=0A+;; reproducible but, in practice, a few precomp files show (extreme= ly minor)=0A+;; differences. Until that's fixed, excluding precomp files= from Guix's store=0A+;; would let some Raku packages appear to be fully = reproducible. But doing that=0A+;; wouldn't *actually* help reproducibli= ty: those slightly non-reproducible=0A+;; precomp files would still be ge= nerated and executed outside the store.=0A+;;=0A+;; The Rakudo build syst= em does not yet have an importer, but creating one is=0A+;; conceptually = simple and is planned.=0A+;;=0A ;;=0A ;; Code:=0A =0A-(define* (check #:k= ey tests? inputs with-prove6? #:allow-other-keys)=0A- (if (and tests? (a= ssoc-ref inputs "perl6-tap-harness"))=0A- ;(if (and tests? with-prove6?)= =0A- (invoke "prove6" "-I=3Dlib" "t/")=0A- (format #t "test sui= te not run~%"))=0A- #t)=0A-=0A-(define* (install #:key inputs outputs wi= th-zef? #:allow-other-keys)=0A- "Install a given Perl6 package."=0A- (l= et* ((out (assoc-ref outputs "out"))=0A- (perl6 (string-append = out "/share/perl6")))=0A- (if (assoc-ref inputs "perl6-zef")=0A- ;(= if with-zef?=0A- (begin=0A- (let ((zef (string-append (as= soc-ref inputs "perl6-zef")=0A- "/bin/= zef")))=0A- (setenv "HOME" (getcwd))=0A- (mkdir-p p= erl6)=0A- (invoke zef "install" "--verbose" "."=0A- = ;; Don't install any of the following:=0A- "-= -/depends" "--/build-depends" "--/test-depends"=0A- (s= tring-append "--install-to=3D" perl6))=0A- (delete-file (strin= g-append perl6 "/repo.lock")))=0A- #t)=0A- (begin=0A- = (let ((inst (string-append (assoc-ref inputs "rakudo")=0A- = "/share/perl6/tools/install-dist.p6")))=0A- = (setenv "RAKUDO_RERESOLVE_DEPENDENCIES" "0")=0A- (se= tenv "RAKUDO_MODULE_DEBUG" "1") ; be verbose while building=0A- = (invoke inst (string-append "--to=3D" perl6) "--for=3Dsite"))))))=0A-= =0A-(define* (install-libs #:key outputs #:allow-other-keys)=0A- (let ((= out (assoc-ref outputs "out"))=0A- (lock "lib/.precomp/.lock"))= =0A- (when (file-exists? lock)=0A- (delete-file "lib/.precomp/.lo= ck"))=0A- (copy-recursively "lib" (string-append out "/share/perl6/lib= "))=0A- #t))=0A =0A-(define* (install-bins #:key outputs #:allow-other= -keys)=0A- (let ((out (assoc-ref outputs "out")))=0A- (when (file-ex= ists? "bin")=0A- (for-each (lambda (file)=0A- (inst= all-file file (string-append out "/bin"))=0A- (chmod (st= ring-append out "/" file) #o555))=0A- (find-files "bin" ".= *")))=0A- (when (file-exists? "sbin")=0A- (for-each (lambda (file= )=0A- (install-file file (string-append out "/sbin"))=0A= - (chmod (string-append out "/" file) #o555))=0A- = (find-files "sbin" ".*")))=0A- #t))=0A+(define (raku-input? i= nput)=0A+ "Test if an input appears to be a Rakudo program based on its = name."=0A+ (or (string-prefix? "raku-" (car input))=0A+ (string-pr= efix? "perl6-" (car input))))=0A+=0A+(define (with-vendor-path dir)=0A+ = "Append the /share/perl6/vendor path to a directory path"=0A+ (string-ap= pend dir "/share/perl6/vendor"))=0A+=0A+(define (inputs->raku-vendor-path= s inputs)=0A+ "Map a list of Guix inputs into a list of Raku vendor path= s."=0A+ (let* ((raku-inputs (filter raku-input? inputs))=0A+ (ra= ku-input-paths (map cdr raku-inputs)))=0A+ (map with-vendor-path raku-= input-paths)))=0A+=0A+(define (dir->inst dir-path)=0A+ "Produce a CompUn= it::Repository::Installation path from a directory path.=0A+Raku provides= several types of Repositories, most relevantly 'FileSystem' repos=0A+and= 'Installation' repos. Guix should use Installation repos, which support= =0A+installation of multiple versions. To specify an Installation repo, = the path=0A+should be prefixed with 'inst#'"=0A+ (string-append "inst#" = dir-path))=0A+=0A+(define (copy-raku-dependencies inputs out-dir)=0A+ "R= ecursively copy files from each Raku dependency to the out directory. Thi= s=0A+lets Rakudo find the precomp files without recursively checking the = integrity of=0A+each one (which is prohibitively slow). Copying the file= s doesn't increase disk=0A+usage thanks to Guix's deduplication via hard = links."=0A+ (let* ((raku-inputs (filter raku-input? inputs))=0A+ = (raku-input-paths (map (lambda (input)=0A+ = (with-vendor-path (cdr input)))=0A+ = raku-inputs)))=0A+ (mkdir-p out-dir)=0A+ (f= or-each=0A+ (lambda (source-dir)=0A+ (for-each make-fil= e-writable (find-files out-dir))=0A+ (copy-recursively source-d= ir out-dir))=0A+ raku-input-paths)))=0A+=0A+(define (set-reposito= ry-version repository-dir version)=0A+ "Set the repository format versio= n for a Raku repository. Raku repositories=0A+have used incompatible for= mats and an unspecified version defaults to v1; thus,=0A+Raku packages mu= st set the repo version. NOTE: the 'install-dist.raku' script=0A+cleans = up the version marker, so you may need to set the version again.=0A+Forge= tting to set the version currently triggers a cryptic error that includes= =0A+the text `cannot do '.open' on a directory'."=0A+ ;; see https://git= hub.com/Raku/old-issue-tracker/issues/6422=0A+ ;; TODO: Consider upstrea= ming a patch to provide a less cryptic error msg.=0A+ (let ((version-fil= e (open-output-file "version")))=0A+ (format version-file "~a\n" versi= on)=0A+ (close-port version-file)=0A+ (install-file "version" repos= itory-dir)))=0A+=0A+(define* (validate-keyword-arg keyword allowed-values= =0A+ #:key (keyword-name "a keyword argumen= t"))=0A+ "Check that the keyword argument has one of the allowed values.= "=0A+ (unless (member keyword allowed-values)=0A+ (let ((allowed-stri= ngs (map (cut format #f "~s" <>) allowed-values)))=0A+ (raise=0A+ = (condition=0A+ (&message (message=0A+ (format #f "In= valid value for ~a: '~s'"=0A+ keyword-name keywor= d)))=0A+ (&message (message=0A+ (format #f "Valid va= lues: '~a'."=0A+=20=20=20=20=20=20=20=20=20 (string-join a= llowed-strings "', '")))))))))=0A+=0A+(define (extract-provided-modules m= eta6)=0A+ "Extract the list of provided modules from a packages META6.js= on file."=0A+ ;; Could alternatively use (json->scm), at the cost of a b= uild dependency=0A+ (let* ((q-mark "\"")=0A+ (non-quote "[^\"]+"= )=0A+ (json-key (string-append q-mark "(" non-quote ")" q-mark ))= =0A+ (json-value (string-append q-mark non-quote q-mark))=0A+ = (json-key-value (make-regexp (string-append non-quote json-key=0A+ = non-quote json-value))= )=0A+ (json-provides-field "[,{]\\s*\"provides\"")=0A+ (p= rovides-value-regexp=0A+ (make-regexp=0A+ (string-appe= nd json-provides-field=0A+ "\\s*:\\s*"=0A+ = "\\{([^}]+)\\}")))=0A+ (provides-value (regex= p-exec provides-value-regexp meta6)))=0A+ (map (cut match:substring <>= 1)=0A+ (list-matches json-key-value=0A+ (m= atch:substring provides-value 1)))))=0A+=0A+;;; Phases=0A+=0A+(define* (s= etup-rakudo-env #:key inputs outputs #:allow-other-keys)=0A+ "Set variou= s RAKUDO* environment variables."=0A+ (let* ((out (assoc-ref outputs "ou= t"))=0A+ (dest (with-vendor-path out))=0A+ (rakudo-dir (a= ssoc-ref inputs "rakudo"))=0A+ (rakudo-home (string-append rakudo= -dir "/share/perl6"))=0A+ (raku-vendor-paths (inputs->raku-vendor= -paths inputs))=0A+ (raku-installations (map dir->inst raku-vendo= r-paths)))=0A+ =0A+ (setenv "HOME" (getcwd))=0A+ (setenv "RAKUDO= _HOME" rakudo-home)=0A+ (setenv "RAKUDO_RESOLVE_DEPENDENCIES" "0")=0A+= (setenv "RAKUDO_LOG_PRECOMP" "1")=0A+ (setenv "RAKUDO_MODULE_DEBU= G" "1")=0A+ (setenv "RAKULIB"=0A+ (string-append (dir->inst= dest) "," "home,"=0A+ (string-join raku-instal= lations ",")))))=0A+=0A+=0A+(define* (check #:key tests? test-runner inpu= ts #:allow-other-keys)=0A+ "Run the tests in ./t with the supplied #:tes= t-runner (default: zef) unless=0A+#:tests? is #f."=0A+ (validate-keyword= -arg test-runner '("zef" "prove6" "rakudo")=0A+ #:= keyword-name "test-runner")=0A+ (when tests?=0A+ (cond=0A+ ((eq? = test-runner "zef")=0A+ (let* ((zef-dir (assoc-ref inputs "test-runne= r-zef"))=0A+ (zef (string-append zef-dir "/bin/zef")))=0A+ = (invoke zef "test" ".")))=0A+ ((eq? test-runner "prove6")=0A+ = (let* ((prove6-dir (assoc-ref inputs "test-runner-prove6"))=0A+ = (prove6 (string-append prove6-dir "/bin/prove6")))=0A+ (invo= ke prove6 "-Ilib" "t/")))=0A+ ((eq? test-runner "rakudo")=0A+ (l= et* ((rakudo-dir (assoc-ref inputs "rakudo"))=0A+ (rakudo (st= ring-append rakudo-dir "/bin/rakudo")))=0A+ (for-each (cut invoke = rakudo "-Ilib" <>)=0A+ (find-files "t/")))))))=0A+=0A+(d= efine* (install #:key inputs outputs #:allow-other-keys)=0A+ "Install th= e code of a given Raku package."=0A+ (let* ((out (assoc-ref outputs "out= "))=0A+ (vendor-dir (with-vendor-path out))=0A+ (rakudo-d= ir (assoc-ref inputs "rakudo"))=0A+ (install-dist-script (string-= append rakudo-dir=0A+ "/share/perl6/tools/i= nstall-dist.raku")))=0A+=0A+ (copy-raku-dependencies inputs vendor-dir= )=0A+ (set-repository-version vendor-dir 2)=0A+=0A+ (invoke install= -dist-script=0A+ "--from=3D."=0A+ (string-append "-= -to=3D" vendor-dir)=0A+ "--for=3Dvendor"=0A+ "--bui= ld"=0A+ "--precompile")))=0A =0A (define* (install-resources #= :key outputs #:allow-other-keys)=0A- (let ((out (assoc-ref outputs "out= ")))=0A- (when (file-exists? "resources")=0A- (copy-recursively "= resources"=0A- (string-append out "/share/perl6/re= sources")))=0A- #t))=0A-=0A-(define* (wrap #:key inputs outputs #:allow-= other-keys)=0A- (define (list-of-files dir)=0A- (map (cut string-appe= nd dir "/" <>)=0A- (or (scandir dir (lambda (f)=0A- = (let ((s (stat (string-append dir "/" f))))=0A- = (and (eq? 'regular (stat:type s))=0A- = (not (wrapped-program? f))))))=0A- '())))=0A= -=0A- (define bindirs=0A- (append-map (match-lambda=0A- = ((_ . dir)=0A- (list (string-append dir "/bin")=0A- = (string-append dir "/sbin"))))=0A- o= utputs))=0A-=0A- ;; Do not require bash to be present in the package inp= uts=0A- ;; even when there is nothing to wrap.=0A- ;; Also, calculate (= sh) only once to prevent some I/O.=0A- (define %sh (delay (search-input-= file inputs "bin/bash")))=0A- (define (sh) (force %sh))=0A-=0A- (let* (= (out (assoc-ref outputs "out"))=0A- (var `("PERL6LIB" "," prefix= =0A- ,(cons (string-append out "/share/perl6/lib,"=0A- = out "/share/perl6/site/lib,"=0A- = out "/share/perl6/vendor/lib")=0A- = (search-path-as-string->list=0A- (o= r (getenv "PERL6LIB") "") #\,)))))=0A- (for-each (lambda (dir)=0A- = (let ((files (list-of-files dir)))=0A- (for-= each (cut wrap-program <> #:sh (sh) var)=0A- f= iles)))=0A- bindirs)=0A- #t))=0A+ "Install the resources= supplied by a Raku package. Resources are typically=0A+items such as co= nfiguration or data files; for details, see=0A+https://docs.raku.org/lang= uage/variables#%?RESOURCES"=0A+ (when (file-exists? "resources")=0A+ = (let* ((out (assoc-ref outputs "out"))=0A+ (resources-dir (str= ing-append out "/share/perl6/resources")))=0A+ (copy-recursively "re= sources" resources-dir))))=0A+=0A+(define* (install-bins #:key outputs #:= allow-other-keys)=0A+ "Install any binary programs supplied by a Raku pa= ckage."=0A+=0A+ (define (install-file-list file-list target-dir)=0A+ = (for-each (cut install-file <> target-dir) file-list))=0A+=0A+ (let* ((b= inary-dirs (filter file-exists? '("bin" "sbin")))=0A+ (out (asso= c-ref outputs "out")))=0A+ (when binary-dirs=0A+ (for-each (lambda= (binary-dir)=0A+ (install-file-list (find-files binary-d= ir)=0A+ (string-append out "/" binary-= dir)))=0A+ binary-dirs))))=0A+=0A+(define* (wrap-raku-progr= ams #:key inputs outputs #:allow-other-keys)=0A+ "Wrap executable Raku p= rograms to ensure they always uses the correct inputs =0A+(including the = correct Rakudo version) even if other versions are installed."=0A+=0A+ (= define (with-rakulib program rakulib)=0A+ (wrap-program program #:sh (= search-input-file inputs "bin/sh")=0A+ `("RAKULIB" "," p= refix ,rakulib)))=0A+=0A+ (let ((out (assoc-ref outputs "out")))=0A+ = (define bin-dirs=0A+ (filter directory-exists?=0A+ (lis= t (string-append out "/bin")=0A+ (string-append out "/= sbin"))))=0A+ (unless (eq? bin-dirs '())=0A+ (let* ((bin-files (f= old append '() (map find-files bin-dirs)))=0A+ (wrappable-bin= -files (filter (negate wrapped-program?) bin-files))=0A+ (rak= u-vendor-paths (inputs->raku-vendor-paths inputs))=0A+ (raku-= installations (map dir->inst raku-vendor-paths))=0A+ (current= -installation (dir->inst (with-vendor-path out)))=0A+ (xdg-da= ta-home-inst "inst#${XDG_DATA_HOME:-$HOME/.local/share}")=0A+ = (guix-pkg-index-file (string-append xdg-data-home-inst=0A+ = "/raku/repo")))=0A+ (for-each = (cut with-rakulib=0A+ <>=0A+ = (append (list current-installation)=0A+ rak= u-installations=0A+ (list guix-pkg-index-fi= le)))=0A+ wrappable-bin-files)))))=0A+=0A+(define* (prec= ompile #:key inputs outputs #:allow-other-keys)=0A+ "Fully precompile al= l Raku code."=0A+ (let ((provides (extract-provided-modules (read-string= (open-input-file "META6.json")))))=0A+ (let* ((out (assoc-ref outputs= "out"))=0A+ (rakudo-dir (assoc-ref inputs "rakudo"))=0A+ = (rakudo (string-append rakudo-dir "/bin/.rakudo-real")))=0A+= (setenv "RAKULIB" (dir->inst (with-vendor-path out)))=0A+ = (for-each (lambda (module)=0A+ (invoke rakudo=0A= + "-c" ; compile w/o running=0A+ = "-e" (string-append "use " module)))=0A+ = provides))))=0A =0A (define %standard-phases=0A- ;; No need for 'bo= otstrap, 'configure or 'build.=0A (modify-phases gnu:%standard-phases= =0A (delete 'bootstrap)=0A (delete 'configure)=0A (delete 'bu= ild)=0A+ (add-after 'unpack 'setup-rakudo-environment setup-rakudo-env= )=0A (replace 'check check)=0A (replace 'install install)=0A- = (add-before 'install 'install-lib-dir install-libs)=0A- (add-after 'in= stall-lib-dir 'install-resources install-resources)=0A+ (add-after 'in= stall 'install-resources install-resources)=0A (add-after 'install-re= sources 'install-binaries install-bins)=0A- ;; needs to be after 'inst= all-binaries and all 'install phases=0A- (add-after 'install 'wrap wra= p)))=0A+ ;; needs to be after 'install-binaries=0A+ (add-after 'ins= tall-binaries 'wrap-raku-programs wrap-raku-programs)=0A+ (add-after '= wrap-raku-programs 'precompile-raku-modules precompile)))=0A =0A (define*= (rakudo-build #:key inputs (phases %standard-phases)=0A = #:allow-other-keys #:rest args)=0A- "Build the given Perl6 packag= e, applying all of PHASES in order."=0A+ "Build the given Raku package, = applying all of PHASES in order."=0A (apply gnu:gnu-build=0A- #= :inputs inputs #:phases phases=0A+ #:inputs inputs=0A+ #:= phases phases=0A args))=0A =0A+=0A ;;; rakudo-build-system.scm e= nds here=0A-- =0A2.37.3 From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 02 00:27:41 2022 Received: (at 58235) by debbugs.gnu.org; 2 Oct 2022 04:27:41 +0000 Received: from localhost ([127.0.0.1]:46072 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oeqZo-0004gI-6l for submit@debbugs.gnu.org; Sun, 02 Oct 2022 00:27:41 -0400 Received: from out0.migadu.com ([94.23.1.103]:56637) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oeqZk-0004g7-18 for 58235@debbugs.gnu.org; Sun, 02 Oct 2022 00:27:39 -0400 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codesections.com; s=key1; t=1664684854; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=t3ridZ7ixk0MCtu8uRWsD48QcwGxlKUrPEZIDCRx50c=; b=hO4023+F4PSyltJcVa6dk5jSGndNyqSbYGlTXpXyz3ATvUq4x+RbzKUeWKZphDAUOL1WGu Xn6fhV7pBlhxuQUMlud6CXnHT0UO8B90FXIpANXdtnCszDDBwMTQK8KjjW7dXSfCGOPlyK eASv+t4zMVTd5GxGKckgzZSyom+veuGpMbPoFNvxGVUfcTkKYiBEI3EZ0UEoHmm9Tr4+1Z S00JoKyuiVKq7yjkCnuqTKJ6+s2UuW/24M1Gcf3BNYSwd7U1XI8QAqIqtzVy0NWpdtlsfb dShs+yewWq26wZW0/CEktTNqCN9AGSXMsRnTnX/3BXHDWMgSpVpCLHlLFx6fow== Date: Sun, 02 Oct 2022 04:27:33 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: "Daniel Sockwell" Message-ID: <4f73f996ad1242eed18abb2324412903@codesections.com> Subject: Re: [bug#58235] [PATCH] rakdo-build-system (2 of 3) To: 58235@debbugs.gnu.org In-Reply-To: <7a3e89c7546867c54d76824ac8f47cb1@codesections.com> References: <7a3e89c7546867c54d76824ac8f47cb1@codesections.com> X-Migadu-Flow: FLOW_OUT X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 58235 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) As previously indicated, this is the second of three patches to update=0A= the Raku ecosystem. This patch contains updates to the core Raku package= s=0Athat are used to build/test the rest of the ecosystem; these updates = align=0Athe core packages with the changes to rakudo-build-system in the = previous=0Apatch.=0A=0AFor clarity, I split changes to different packages= into separate commits.=0AThe final patch in this series will complete th= e update process for the=0ARaku ecosystem.=0A=0ABest,=0ADaniel=0A=0AFrom = 8a76462dfb478f0d7290e1facecf51153257be8f Mon Sep 17 00:00:00 2001=0AMessa= ge-Id: <8a76462dfb478f0d7290e1facecf51153257be8f.1664684430.git.daniel@co= desections.com>=0AFrom: Daniel Sockwell =0ADate:= Sat, 1 Oct 2022 19:10:04 -0400=0ASubject: [PATCH 1/5] gnu: moarvm: Updat= e 2019.03 -> 2022.07=0A=0A* gnu/packages/perl6.scm Update MoarVM to 2022.= 07=0AChange build system from perl-build-system to gnu-build-system=0AUpd= ate synopsis and description=0A---=0A gnu/packages/perl6.scm | 97 +++++++= +++++++++++++++--------------------=0A 1 file changed, 51 insertions(+), = 46 deletions(-)=0A=0Adiff --git a/gnu/packages/perl6.scm b/gnu/packages/p= erl6.scm=0Aindex dab9dd477b..b4e1ac8c27 100644=0A--- a/gnu/packages/perl6= .scm=0A+++ b/gnu/packages/perl6.scm=0A@@ -22,11 +22,14 @@ (define-module = (gnu packages perl6)=0A #:use-module (guix download)=0A #:use-module = (guix git-download)=0A #:use-module (guix packages)=0A+ #:use-module (= guix build-system gnu)=0A #:use-module (guix build-system perl)=0A #:= use-module (guix build-system rakudo)=0A+ #:use-module (gnu packages)=0A= #:use-module (gnu packages bdw-gc)=0A #:use-module (gnu packages lib= event)=0A #:use-module (gnu packages libffi)=0A+ #:use-module (gnu pac= kages perl)=0A #:use-module (gnu packages multiprecision)=0A #:use-mo= dule (gnu packages pkg-config)=0A #:use-module (gnu packages tls))=0A@@= -34,65 +37,67 @@ (define-module (gnu packages perl6)=0A (define-public m= oarvm=0A (package=0A (name "moarvm")=0A- (version "2019.03")=0A+= (version "2022.07")=0A (source=0A- (origin=0A- (metho= d url-fetch)=0A- (uri (string-append "https://moarvm.org/releases/= MoarVM-"=0A- version ".tar.gz"))=0A- (s= ha256=0A- (base32=0A- "017w1zvr6yl0cgjfc1b3ddlc6vjw9q8p7= alw1vvsckw95190xc14"))=0A- (modules '((guix build utils)))=0A- = (snippet=0A- '(begin=0A- ;(delete-file-recursively= "3rdparty/dynasm") ; JIT=0A- (delete-file-recursively "3rdpar= ty/dyncall")=0A- (delete-file-recursively "3rdparty/freebsd")= =0A- (delete-file-recursively "3rdparty/libatomicops")=0A- = (delete-file-recursively "3rdparty/libuv")=0A- (delete= -file-recursively "3rdparty/libtommath")=0A- (delete-file-recu= rsively "3rdparty/msinttypes")=0A- #t))))=0A- (build-system= perl-build-system)=0A+ (origin=0A+ (method url-fetch)=0A+ = (uri (string-append "https://moarvm.org/releases/MoarVM-" version ".tar= .gz"))=0A+ (sha256 (base32 "0ijvdd7jyq990zyxrlv8pqhf53q20qhbjly6cna= gj9pq2r6z0zik"))=0A+ (modules '((guix build utils)))=0A+ (sni= ppet=0A+ '(begin (for-each=0A+ delete-file-recursi= vely=0A+ '(;"3rdparty/dyncall" ; upstream prefers dyncall= to libffi=0A+ ;"3rdparty/dynasm" ; needed for JIT=0A+= ;"3rdparty/freebsd" ; freebsd/memmem.o is used on linu= x=0A+ "3rdparty/libatomicops"=0A+ "3r= dparty/libtommath"=0A+ "3rdparty/libuv"=0A+ = "3rdparty/msinttypes"))))))=0A+ (build-system gnu-build-system)= =0A (arguments=0A- '(#:phases=0A+ `(#:test-target "test"=0A+ = #:phases=0A (modify-phases %standard-phases=0A (rep= lace 'configure=0A (lambda* (#:key inputs outputs #:allow-othe= r-keys)=0A- (let ((out (assoc-ref outputs "out"))=0A- = (pkg-config (assoc-ref inputs "pkg-config")))=0A+ = (let* ((out (assoc-ref outputs "out"))=0A+ = (perl (string-append (assoc-ref inputs "perl") "/bin/perl"))=0A+ = (dest (string-append out "/moar"))=0A+ = (pkg-config (assoc-ref inputs "pkg-config")))=0A (set= env "CFLAGS" "-fcommon")=0A (setenv "LDFLAGS" (string-appe= nd "-Wl,-rpath=3D" out "/lib"))=0A- (invoke "perl" "Configu= re.pl"=0A- "--prefix" out=0A- = "--pkgconfig" (string-append pkg-config "/bin/pkg-config")=0A- = "--has-libtommath"=0A+ (invoke perl "Configure= .pl"=0A+ "--mimalloc"=0A "--= has-libatomic_ops"=0A- "--has-libffi"=0A- = "--has-libuv")))))))=0A+ "--has-libtom= math"=0A+ "--has-libuv"=0A+ ;= "--has-dyncall" ; TODO: package dyncall for guix=0A+ = "--toolchain" "gnu"=0A+ "--os" "linux"=0A+ = "--pkgconfig" (string-append pkg-config "/bin/pkg-config"= )=0A+ "--prefix" out)))))))=0A (home-page "http= s://moarvm.org/")=0A ;; These should be inputs but moar.h can't find = them when building rakudo=0A- (propagated-inputs=0A- (list libatom= ic-ops libffi libtommath-1.0 libuv))=0A- (native-inputs=0A- (list = pkg-config))=0A- (synopsis "VM for NQP And Rakudo Perl 6")=0A+ (pro= pagated-inputs (list libatomic-ops libtommath libuv))=0A+ (native-inpu= ts (list pkg-config perl))=0A+ (synopsis "Virtual machine for the Raku= programming language")=0A (description=0A- "Short for \"Metamode= l On A Runtime\", MoarVM is a modern virtual machine=0A-built for the Rak= udo Perl 6 compiler and the NQP Compiler Toolchain. Highlights=0A-includ= e:=0A+ "MoarVM (\"Metamodel On A Runtime\") is a modern virtual machi= ne built for=0A+the Raku programming language, NQP, and the Rakudo Raku c= ompiler. MoarVM's=0A+features include:=0A =0A @itemize=0A-@item Great Un= icode support, with strings represented at grapheme level=0A-@item Dynami= c analysis of running code to identify hot functions and loops, and=0A-pe= rform a range of optimizations, including type specialization and inlinin= g=0A-@item Support for threads, a range of concurrency control constructs= , and=0A-asynchronous sockets, timers, processes, and more=0A-@item Gener= ational, parallel, garbage collection=0A-@item Support for numerous langu= age features, including first class functions,=0A-exceptions, continuatio= ns, runtime loading of code, big integers and interfacing=0A-with native = libraries.=0A+@item Just-in-time compilation and optimization of running = code hot functions/loops.=0A+Optimizations include type specialization, c= ode inlining/elimination, and on-stack=0A+replacement.=0A+@item Unusually= strong Unicode support due to representing strings as=0A+graphemes and t= he compiled-in data from the Unicode Character Database=0A+@item Support = various Raku language features, such as delimited continuations,=0A+first= -class functions, resumable exceptions, runtime code loading, bounded=0A+= serialization, and native calling/pointer manipulation.=0A+@item The low-= level concurrency primitives required for Raku's concurrency=0A+system.= =0A @end itemize")=0A (license license:artistic2.0)))=0A =0A-- =0A2.3= 7.3=0A=0AFrom e5416f42bd130a1306bf44c1628188a32f0222da Mon Sep 17 00:00:0= 0 2001=0AMessage-Id: =0AIn-Reply-To: <8a76462dfb478f0d7290e1facec= f51153257be8f.1664684430.git.daniel@codesections.com>=0AReferences: <8a76= 462dfb478f0d7290e1facecf51153257be8f.1664684430.git.daniel@codesections.c= om>=0AFrom: Daniel Sockwell =0ADate: Sat, 1 Oct = 2022 19:21:20 -0400=0ASubject: [PATCH 2/5] gnu: nqp-configure: add packag= e=0A=0A* gnu/packages/perl6.scm: add nqp-configure=0AAdd package needed a= s input to NQP and Rakudo=0A---=0A gnu/packages/perl6.scm | 25 ++++++++++= +++++++++++++++=0A 1 file changed, 25 insertions(+)=0A=0Adiff --git a/gnu= /packages/perl6.scm b/gnu/packages/perl6.scm=0Aindex b4e1ac8c27..1c125c02= ae 100644=0A--- a/gnu/packages/perl6.scm=0A+++ b/gnu/packages/perl6.scm= =0A@@ -23,6 +23,7 @@ (define-module (gnu packages perl6)=0A #:use-modul= e (guix git-download)=0A #:use-module (guix packages)=0A #:use-module= (guix build-system gnu)=0A+ #:use-module (guix build-system copy)=0A = #:use-module (guix build-system perl)=0A #:use-module (guix build-syste= m rakudo)=0A #:use-module (gnu packages)=0A@@ -101,6 +102,30 @@ (define= -public moarvm=0A @end itemize")=0A (license license:artistic2.0)))= =0A =0A+(define-public nqp-configure=0A+ (let ((commit "9b98931e0bfb8c4a= ac61590edf5074e63aa8ea4b" )=0A+ (revision "0"))=0A+ (package=0A= + (name "nqp-configure")=0A+ (version (git-version "0.1" revisi= on commit))=0A+ (source=0A+ (origin=0A+ (method git-fe= tch)=0A+ (uri (git-reference (url "https://github.com/Raku/nqp-co= nfigure")=0A+ (commit commit)))=0A+ (= sha256 (base32 "1vc1q11kjb964jal9dhgf5vwp371a3rfw7gj987n33kzli7a10n0"))= =0A+ (file-name (git-file-name name version))))=0A+ (build-s= ystem copy-build-system)=0A+ (arguments=0A+ '(#:install-plan= =0A+ '(("lib" "lib")=0A+ ("bin" "bin"))))=0A+ (syn= opsis "Configuration utility for NQP and Rakudo installations")=0A+ = (description "A utility that simplifies the process of compiling and=0A+i= nstalling NQP (Not Quite Perl) and the Rakudo Raku compiler.")=0A+ (= license license:artistic2.0)=0A+ (home-page "https://github.com/Raku= /nqp-configure" ))))=0A+=0A (define-public nqp=0A (package=0A (name= "nqp")=0A-- =0A2.37.3=0A=0AFrom 1652e35754b06a54ff1d90fc3372f10bfb149898= Mon Sep 17 00:00:00 2001=0AMessage-Id: <1652e35754b06a54ff1d90fc3372f10b= fb149898.1664684430.git.daniel@codesections.com>=0AIn-Reply-To: <8a76462d= fb478f0d7290e1facecf51153257be8f.1664684430.git.daniel@codesections.com>= =0AReferences: <8a76462dfb478f0d7290e1facecf51153257be8f.1664684430.git.d= aniel@codesections.com>=0AFrom: Daniel Sockwell = =0ADate: Sat, 1 Oct 2022 19:26:30 -0400=0ASubject: [PATCH 3/5] gnu: nqp: = Update 2019.03 -> 2022.07=0A=0A* gnu/packages/perl6.scm: Update nqp to 20= 22.07=0AAdd patch to use nqp-configure as input (in place of fetching fro= m GitHub)=0AUpdate synopsis and description=0A---=0A .../nqp.do-not-pull-= files-via-git.patch | 26 +++++++=0A gnu/packages/perl6.scm = | 69 +++++++++----------=0A 2 files changed, 57 insertions= (+), 38 deletions(-)=0A create mode 100644 gnu/packages/patches/nqp.do-no= t-pull-files-via-git.patch=0A=0Adiff --git a/gnu/packages/patches/nqp.do-= not-pull-files-via-git.patch b/gnu/packages/patches/nqp.do-not-pull-files= -via-git.patch=0Anew file mode 100644=0Aindex 0000000000..b99919286f=0A--= - /dev/null=0A+++ b/gnu/packages/patches/nqp.do-not-pull-files-via-git.pa= tch=0A@@ -0,0 +1,26 @@=0A+# Don't fetch nqp-configure from git (Guix supp= lies it as an input)=0A+diff --git a/Configure.pl b/Configure.patched.pl= =0A+index ded227d..1fd59c8 100755=0A+--- a/Configure.pl=0A++++ b/Configur= e.patched.pl=0A+@@ -11,20 +11,6 @@ use File::Spec;=0A+ use File::Path;=0A= + use FindBin;=0A+ =0A+-BEGIN {=0A+- # Download / Update submodules=0A= +- my $set_config =3D !qx{git config nqp.initialized};=0A+- if ( !-= e '3rdparty/nqp-configure/LICENSE' ) {=0A+- my $code =3D system($^= X, 'tools/build/update-submodules.pl', Cwd::cwd(), @ARGV);=0A+- ex= it 1 if $code >> 8 !=3D 0;=0A+- $set_config =3D 1;=0A+- }=0A+- = if ($set_config) {=0A+- system("git config submodule.recurse tr= ue");=0A+- system("git config nqp.initialized 1");=0A+- }=0A+-}= =0A+-=0A+ use lib ( "$FindBin::Bin/tools/lib",=0A+ "$FindBin::Bin/3rd= party/nqp-configure/lib", );=0A+ use NQP::Config qw;=0Adif= f --git a/gnu/packages/perl6.scm b/gnu/packages/perl6.scm=0Aindex 1c125c0= 2ae..af85df0aca 100644=0A--- a/gnu/packages/perl6.scm=0A+++ b/gnu/package= s/perl6.scm=0A@@ -129,19 +129,19 @@ (define-public nqp-configure=0A (defi= ne-public nqp=0A (package=0A (name "nqp")=0A- (version "2019.03"= )=0A+ (version "2022.07")=0A (source=0A- (origin=0A- (= method url-fetch)=0A- (uri (string-append "https://rakudo.perl6.or= g/downloads/nqp/nqp-"=0A- version ".tar.gz"))= =0A- (sha256=0A- (base32=0A- "183zhll13fx416s3hkg= 4bkvib77kyr857h0nydgrl643fpacxp83"))=0A- (modules '((guix build ut= ils)))=0A+ (origin=0A+ (method url-fetch)=0A+ (uri (strin= g-append=0A+ "https://github.com/Raku/nqp/releases/download/2= 022.07/nqp-"=0A+ version ".tar.gz"))=0A+ (sha256 (base3= 2 "0s124fl2kjahbhr52n92pw9gv1flr099kmlg04358ak7dl81q22q"))=0A+ (pat= ches (search-patches "nqp.do-not-pull-files-via-git.patch"))=0A+ (m= odules '((guix build utils)))=0A (snippet=0A '(begin=0A-= (delete-file-recursively "3rdparty") #t))))=0A+ (d= elete-file-recursively "3rdparty")))))=0A (build-system perl-build-sy= stem)=0A (arguments=0A '(#:phases=0A@@ -152,43 +152,36 @@ (defin= e-public nqp=0A "tools/build/gen-js-cross-run= ner.pl"=0A "tools/build/gen-js-runner.pl"=0A = "tools/build/install-js-runner.pl"=0A- = "tools/build/install-moar-runner.pl"=0A- = "tools/build/gen-moar-runner.pl"=0A = "t/nqp/111-spawnprocasync.t"=0A "t/nqp= /113-run-command.t")=0A- (("/bin/sh") (which "sh")))=0A- = #t))=0A- (add-after 'unpack 'patch-source-date=0A- = (lambda _=0A- (substitute* "tools/build/gen-version.pl"= =0A- (("gmtime") "gmtime(0)"))=0A- #t))=0A- = (add-after 'unpack 'remove-failing-test=0A- ;; One subtest= fails for unknown reasons=0A- (lambda _=0A- (delet= e-file "t/nqp/019-file-ops.t")=0A- #t))=0A+ (("= /bin/sh") (which "sh")))))=0A (replace 'configure=0A = (lambda* (#:key inputs outputs #:allow-other-keys)=0A- (let (= (out (assoc-ref outputs "out"))=0A- (moar (assoc-ref i= nputs "moarvm")))=0A+ (let ((out (assoc-ref outputs "o= ut"))=0A+ (moar (assoc-ref inputs "moarvm"))=0A+ = (nqp-config (assoc-ref inputs "nqp-configure")))=0A+ = (setenv "PERL5LIB" (string-append=0A+ = nqp-config "/lib:" (or (getenv "PERL5LIB")=0A+ = "")))=0A+ ; MoarV= M has some M_AST files that NQP expects to share=0A+ (copy-= recursively (string-append moar "/share/nqp/lib")=0A+ = (string-append out "/share/nqp/lib"))=0A+ (mk= dir-p (string-append out "/share/nqp/lib/short"))=0A (inv= oke "perl" "Configure.pl"=0A "--backends=3Dmoar"= =0A "--with-moar" (string-append moar "/bin/moar")= =0A "--prefix" out)))))))=0A- (inputs=0A- (= list moarvm))=0A- (home-page "https://github.com/perl6/nqp")=0A- (s= ynopsis "Not Quite Perl")=0A- (description "This is \"Not Quite Perl\"= -- a lightweight Perl 6-like=0A-environment for virtual machines. The k= ey feature of NQP is that it's designed=0A-to be a very small environment= (as compared with, say, perl6 or Rakudo) and is=0A-focused on being a hi= gh-level way to create compilers and libraries for virtual=0A-machines li= ke MoarVM, the JVM, and others.=0A+ (inputs (list moarvm))=0A+ (nat= ive-inputs (list nqp-configure))=0A+ (home-page "https://github.com/Ra= ku/nqp")=0A+ (synopsis "Small programming language built for writing c= ompilers and VMs")=0A+ (description "NQP is \"Not Quite Perl\", a ligh= tweight Raku-like=0A+programming language designed for compilers and VM c= reation. NQP is used to=0A+implement the Rakudo compiler for Raku and to= integrate it with VMs such as=0A+MoarVM and the Java Virtual Machine.=0A= =0A-Unlike a full-fledged implementation of Perl 6, NQP strives to have = as small a=0A-runtime footprint as it can, while still providing a Perl 6= object model and=0A-regular expression engine for the virtual machine.")= =0A+NQP attempts to minimize its runtime footprint while providing Raku's= object=0A+model and regular expression engine.")=0A (license license= :artistic2.0)))=0A =0A (define-public rakudo=0A-- =0A2.37.3=0A=0AFrom 9f9= cd47ce2293f7dfdab07f024a246af000ed03a Mon Sep 17 00:00:00 2001=0AMessage-= Id: <9f9cd47ce2293f7dfdab07f024a246af000ed03a.1664684430.git.daniel@codes= ections.com>=0AIn-Reply-To: <8a76462dfb478f0d7290e1facecf51153257be8f.166= 4684430.git.daniel@codesections.com>=0AReferences: <8a76462dfb478f0d7290e= 1facecf51153257be8f.1664684430.git.daniel@codesections.com>=0AFrom: Danie= l Sockwell =0ADate: Sun, 2 Oct 2022 00:01:18 -04= 00=0ASubject: [PATCH 5/5] gnu: perl6-zef: Update 0.6.7 -> 0.14.2=0A=0A* g= nu/packages/perl6.scm: Update perl6-zef to 0.14.2=0AUpdate synopsis and d= escription=0ASet install directory to integrate with Guix-installed Raku = packages=0A---=0A .../perl6-zef.config-interpolation.patch | 42 ++++= ++++++++++++++=0A gnu/packages/perl6.scm | 44 ++++= +++++++--------=0A 2 files changed, 67 insertions(+), 19 deletions(-)=0A = create mode 100644 gnu/packages/patches/perl6-zef.config-interpolation.pa= tch=0A=0Adiff --git a/gnu/packages/patches/perl6-zef.config-interpolation= .patch b/gnu/packages/patches/perl6-zef.config-interpolation.patch=0Anew = file mode 100644=0Aindex 0000000000..357dfd18e6=0A--- /dev/null=0A+++ b/g= nu/packages/patches/perl6-zef.config-interpolation.patch=0A@@ -0,0 +1,42 = @@=0A+From f9e4306cba875999a44286bd8c585ef9e84a7a88 Mon Sep 17 00:00:00 2= 001=0A+From: Daniel Sockwell =0A+Date: Fri, 30 S= ep 2022 17:43:04 -0400=0A+Subject: [PATCH 4/4] Improve support for env va= rs in config.json=0A+=0A+The "StoreDir" and "TempDir" previously allowed = for limited=0A+interpolation (limited to $*HOME and $*TMPDIR). This comm= it adds=0A+interpolation of $*XDG_DATA_HOME, $*XDG_CONFIG_HOME, and=0A+$*= XDG_STATE_HOME with default values from the XDG spec, see=0A+https://spec= ifications.freedesktop.org/basedir-spec/basedir-spec-latest.html=0A+=0A+I= t also extends the interpolation for the same values to "DefaultCUR",=0A+= which also specifies a path.=0A+---=0A+ lib/Zef/Config.rakumod | 11 +++++= ++++--=0A+ 1 file changed, 9 insertions(+), 2 deletions(-)=0A+=0A+diff --= git a/lib/Zef/Config.rakumod b/lib/Zef/Config.rakumod=0A+index f77c6be..4= 362b17 100644=0A+--- a/lib/Zef/Config.rakumod=0A++++ b/lib/Zef/Config.rak= umod=0A+@@ -4,8 +4,15 @@ module Zef::Config {=0A+ our sub parse-file(= $path) {=0A+ my %config =3D %(Zef::from-json( $path.IO.slurp ));= =0A+ =0A+- for %config.grep(*.key.ends-with('Dir')) {=0A+- = %config{$_.key} =3D $_.value.subst(/'{$*HOME}' || '$*HOME'/, $*HOME /= / $*TMPDIR, :g);=0A++ for %config.grep({.key.ends-with('Dir') || .= key eq 'DefaultCUR'}) {=0A++ my $home =3D $*HOME // $*TMPDIR;= =0A++ %config{$_.key} =3D $_.value.subst(/'{$*XDG_DATA_HOME}' = || '$*XDG_DATA_HOME'/,=0A++ %*EN= V // "$home/.local/share", :g);=0A++ %config{$_= .key} =3D $_.value.subst(/'{$*XDG_CONFIG_HOME}' || '$*XDG_CONFIG_HOME'/,= =0A++ %*ENV // = "$home/.config", :g);=0A++ %config{$_.key} =3D $_.value.subst(= /'{$*XDG_STATE_HOME}' || '$*XDG_STATE_HOME'/,=0A++ = %*ENV // "$home/.local/bin", :g);=0A++= %config{$_.key} =3D $_.value.subst(/'{$*HOME}' || '$*HOME'/, = $home, :g);=0A+ %config{$_.key} =3D $_.value.subst(/'{$*TMPDI= R}' || '$*TMPDIR'/, $*TMPDIR, :g);=0A+ }=0A+ =0A+-- =0A+2.37.3=0A= +=0Adiff --git a/gnu/packages/perl6.scm b/gnu/packages/perl6.scm=0Aindex = e571920e53..a47d55a901 100644=0A--- a/gnu/packages/perl6.scm=0A+++ b/gnu/= packages/perl6.scm=0A@@ -803,30 +803,36 @@ (define-public perl6-xml-write= r=0A (define-public perl6-zef=0A (package=0A (name "perl6-zef")=0A-= (version "0.6.7")=0A+ (version "0.14.2")=0A (source=0A- (= origin=0A- (method git-fetch)=0A- (uri (git-reference=0A- = (url "https://github.com/ugexe/zef")=0A- (comm= it (string-append "v" version))))=0A- (file-name (git-file-name na= me version))=0A- (sha256=0A- (base32=0A- "07n7g1x= w2c4g860rs890gx85vyhdq0ysgwbrnzw6q905jph2bkv7"))))=0A+ (origin=0A+ = (method git-fetch)=0A+ (uri (git-reference (url "https://github= .com/ugexe/zef")=0A+ (commit (string-append "v"= version))))=0A+ (file-name (git-file-name name version))=0A+ = (sha256 (base32 "09lgpkz93w5g9bsw44rag763fa8857bvjj9r4wwvnnawykl4lkzr"))= =0A+ ;; patch submitted upstream, https://github.com/ugexe/zef/pull= /470=0A+ (patches (search-patches "perl6-zef.config-interpolation.p= atch"))))=0A (build-system rakudo-build-system)=0A (arguments=0A-= '(#:with-zef? #f=0A+ '(#:test-runner "rakudo" ; to avoid bootstr= apping issues=0A #:phases=0A (modify-phases %standard-phase= s=0A- (replace 'check=0A+ (add-after 'unpack 'set-config-= values=0A (lambda _=0A- (setenv "HOME" "/tmp")=0A-= (invoke "perl6" "-I." "bin/zef" "--debug"=0A- = "--tap-harness" "test" "."))))))=0A+ ;; Upstream recomm= ends editing config.json to set system defaults=0A+ (substitu= te* "resources/config.json"=0A+ (("DefaultCUR.+$")=0A+ = "DefaultCUR\" : [\"$*XDG_DATA_HOME/raku/repo\"],\n")))))))=0A = (home-page "https://github.com/ugexe/zef")=0A- (synopsis "Perl6 Mo= dule Management")=0A- (description "Zef is a Perl 6 package (module) m= anager. It can be used to=0A-download and install Perl 6 modules in your= home directory or as a system-wide=0A-module.")=0A+ (synopsis "Raku L= anguage Package Management")=0A+ (description "Zef is a language packa= ge manager for the Raku programming=0A+language. It can be used to searc= h for, download, install, and manage Raku=0A+modules to your home directo= ry.=0A+=0A+As an end user, you should typically prefer to install executa= ble Raku=0A+packages via Guix when possible. However, Zef provides parti= cular support for=0A+using Raku packages while developing other Raku prog= rams, so developers may=0A+prefer Zef in that situation. Zef and Guix pa= ckages are installed such that=0A+they should work smoothly together.")= =0A (license license:artistic2.0)))=0A-- =0A2.37.3