From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id UER3CCIJPmYxowAAqHPOHw:P1 (envelope-from ) for ; Fri, 10 May 2024 13:46:42 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id UER3CCIJPmYxowAAqHPOHw (envelope-from ) for ; Fri, 10 May 2024 13:46:42 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1715341601; a=rsa-sha256; cv=none; b=QF2cLJYx7gF8nEB4aan+kBD+SYnodYVSgJ/WOKEUsZbSMR1LVxwXo3XYLT9ZUFce5G4pGL BzToYFS13ZBYN3Ybs+K1ioKPO2aHoHebnFQEqtVt9rBVdwb4N4TPblgF66MVxGT2E/1qgC jhMAY60W3foBC/5cXRv6cXWfwfwqMO2CNX3NpsV/HPMht5Kt9uhEfOFR2oatacHlBmb85q bdhpd6F0qjAS96xnlsd61cYRJNRDJgM2jPXuArtMVNzH6zvTd4nDA0VVq3cmv+VZ7r60g8 ZNBJ0agfuX0TKqCETPBJ//FZTiQmdj8u8UUCZ1kOW4bndlQobNkyBStMPj42Eg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1715341601; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=KdNc3Ayqjime8fVDUxPmn9ULPa/pMM7bN82Os961ioQ=; b=T8ZQ9W84nL0fwszxlSTqlhmJT7OF5AOLTqZX+vOlSMaDL1cNmfpj1R8FFmFet/oW74vfnw xeWWBldn/wa+KbP3Fuar9Jtzgj061iNlCJ+uLIlKsRU3JMXN4k7m9ewKNO27paXrRQhM86 imdQ6k/DzEhR5ptC4SD3PzqgGgKds2unMLttQ4Fk8s4LTz2zxCVvFCB8cmqceThdaRd+0i kIRpFIDk/7Zx0FhEoVfqL5NYPZ/8JQGODeB0Ug1Et89VjViMCHZg8yXTY5mnlluT5lTX0H pIlEhp6l7dTPqw+mSQ+P9mMn8vC+/tz3sDjWMs9KzpvFXBuktnWcNxiARTCPyw== 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 C93B534F77 for ; Fri, 10 May 2024 13:46:41 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s5OhZ-0004Jj-51; Fri, 10 May 2024 07:46:13 -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 1s5OhW-0004An-0k for guix-devel@gnu.org; Fri, 10 May 2024 07:46:10 -0400 Received: from 6.mo576.mail-out.ovh.net ([46.105.50.107]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s5OhT-00087j-0Q for guix-devel@gnu.org; Fri, 10 May 2024 07:46:09 -0400 Received: from director11.ghost.mail-out.ovh.net (unknown [10.109.148.87]) by mo576.mail-out.ovh.net (Postfix) with ESMTP id 4VbRsl1vr0z1Ym2 for ; Fri, 10 May 2024 11:46:03 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-czk5r (unknown [10.110.113.89]) by director11.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 053331FEED; Fri, 10 May 2024 11:46:02 +0000 (UTC) Received: from ngraves.fr ([37.59.142.105]) by ghost-submission-6684bf9d7b-czk5r with ESMTPSA id pqclOfoIPmaHuAoA/Ior/A (envelope-from ); Fri, 10 May 2024 11:46:02 +0000 X-OVh-ClientIp: 81.67.146.208 To: guix-devel@gnu.org, zimoun.toutoune@gmail.com, Ludovic =?utf-8?Q?Court?= =?utf-8?Q?=C3=A8s?= Subject: Re: (almost) deterministic patchsets In-Reply-To: <87ttlxh39x.fsf@ngraves.fr> References: <87le7owkq2.fsf@ngraves.fr> <87ttlxh39x.fsf@ngraves.fr> Date: Fri, 10 May 2024 13:46:02 +0200 Message-ID: <87a5kxga9x.fsf@ngraves.fr> MIME-Version: 1.0 Content-Type: text/plain X-Ovh-Tracer-Id: 647110972988908253 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvledrvdefkedggeefucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufgjfhffkfggtgesthdtredttddttdenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpeeiueegteefleffheeiieetueffheffgefftdeukefhheetfeehleduhfejjedugfenucffohhmrghinhepshhrrdhhthdpghhnuhdrohhrghenucfkphepuddvjedrtddrtddruddpkedurdeijedrudegiedrvddtkedpfeejrdehledrudegvddruddtheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepnhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrpdhnsggprhgtphhtthhopedupdhrtghpthhtohepghhuihigqdguvghvvghlsehgnhhurdhorhhgpdfovfetjfhoshhtpehmohehjeeipdhmohguvgepshhmthhpohhuth Received-SPF: pass client-ip=46.105.50.107; envelope-from=ngraves@ngraves.fr; helo=6.mo576.mail-out.ovh.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Nicolas Graves From: Nicolas Graves via "Development of GNU Guix and the GNU System distribution." Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Queue-Id: C93B534F77 X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -6.88 X-Spam-Score: -6.88 X-TUID: qcAmMc8iyf+I One possible use would be to make `guix download` options, such as `--patchset=70XXX -v3` This could help with patch apply and review. We will have to also take care of not making guix dependent on b4, but maybe that's possible with lazy resolving the b4 package? WDYT? On 2024-02-25 00:05, Nicolas Graves wrote: > This is basically done in > https://git.sr.ht/~ngraves/dotfiles/commit/bd542512dfad2beccb4a6cdb2468f79aa869a55b > > Maybe some things need some polish, but the PoC is definitely here. > Feel free to reuse this in upstream guix if you want. > > On 2024-02-13 14:35, Nicolas Graves wrote: > >> Hi ! >> >> I've written this (gpl3+) that should be able to fetch patchsets for >> both guix and rde. This should be robust enough for guix/rde use IMO. >> >> (define-module (guix mbox-download) >> #:use-module (guix packages) >> #:use-module ((guix self) #:select (make-config.scm)) >> #:use-module (guix modules) >> #:use-module (guix monads) >> #:use-module (gnu packages guile) >> #:use-module (gnu packages tls) >> #:use-module (gnu packages version-control) >> #:use-module (guix store) >> #:use-module (guix gexp) >> #:use-module (guix records) >> #:export (mbox-fetch >> mbox-reference)) >> >> (define-record-type* >> mbox-reference make-mbox-reference >> mbox-reference? >> (type mbox-reference-type) >> (id mbox-reference-id) >> (version mbox-reference-version)) >> >> (define* (mbox-fetch ref hash-algo hash #:optional name >> #:key (system %current-system) guile) >> >> (define uri >> (format >> #f >> (assoc-ref >> '((gnu . "https://debbugs.gnu.org/cgi-bin/bugreport.cgi?bug=~a;mbox=yes") >> (rde . "https://lists.sr.ht/~~abcdw/rde-devel/patches/~a/mbox")) >> (mbox-reference-type ref)) >> (mbox-reference-id ref))) >> >> (define modules >> (cons `((guix config) => ,(make-config.scm)) >> (delete '(guix config) >> (source-module-closure '((guix build download) >> (guix build utils)))))) >> >> (define build >> (with-extensions (list guile-json-4 guile-gnutls) >> (with-imported-modules modules >> #~(begin >> (use-modules (guix build utils) (guix build download)) >> (let ((mbox #$(match-record ref >> (type id version) >> (format #f "~a-~a-~a.mbx" type id version)))) >> (setenv "TMPDIR" (getcwd)) >> (setenv "XDG_DATA_HOME" (getcwd)) >> (invoke #$(file-append b4 "/bin/b4") >> "-d" "-n" "--offline-mode" "--no-stdin" >> "am" "--no-cover" "--no-cache" >> "--use-local-mbox" >> (url-fetch #$uri "mbox" #:verify-certificate? #f) >> "--use-version" >> (number->string #$(mbox-reference-version ref)) >> "--no-add-trailers" >> "--outdir" "." >> "--mbox-name" mbox) >> (install-file mbox #$output)))))) >> >> (mlet %store-monad ((guile (package->derivation (or guile (default-guile)) >> system))) >> (gexp->derivation (or name >> (match-record ref >> (type id version) >> (format #f "~a-~a-~a-mbox" type id version))) >> build >> ;; Use environment variables and a fixed script name so >> ;; there's only one script in store for all the >> ;; downloads. >> #:system system >> #:local-build? #t ;don't offload repo cloning >> #:hash-algo hash-algo >> #:hash hash >> #:recursive? #t >> #:guile-for-build guile))) >> >> >> This can be used in such an example : >> >> (use-modules (guix mbox-download) (guix packages) (guix gexp) >> (guix monads) (guix store) (guix derivations)) >> >> (with-store store >> (run-with-store store >> (mlet* %store-monad >> ((drv (origin->derivation >> (pk 'o (origin >> (method mbox-fetch) >> (uri (mbox-reference >> (type 'rde) >> (id 44893) >> (version 4))) >> (sha256 >> (base32 "1rs09wxvdaxrk2zh6g23s9min76wjm9lw0a5pjklc7cfraasi7s9"))))))) >> (return drv)))) >> >> Is guix interested in this, should I send a patch? What about renaming >> this to patchset-reference instead of mbox-reference? >> >> My end-goal here is to use this to extend channels to channels with >> patches, with something like this : >> >> (define* (instantiate-channel ch) >> (match ch >> ((name url ref patches) >> (primitive-eval >> `(channel >> (name ',name) >> ,@(if (null? patches) >> `((url ,(find-home url))) >> `((url ,(patched-source >> (symbol->string name) >> (git-checkout >> (url (find-home url)) >> (commit ref)) >> (search-patches patches))))) >> ,@(if ((@ (guix git) commit-id?) ref) >> `((commit ,ref)) >> `((branch ,ref))) >> (introduction ,(assoc-ref channels-introductions name))))))) >> >> in the hypothesis where patched-source is exported from (guix transformations). > > -- > Best regards, > Nicolas Graves -- Best regards, Nicolas Graves