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 WPVvH3y4gWXlogAAkFu2QA (envelope-from ) for ; Tue, 19 Dec 2023 16:36:28 +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 MI1gGXy4gWXrUQAAqHPOHw (envelope-from ) for ; Tue, 19 Dec 2023 16:36:28 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="GfJF/Erw"; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1703000188; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=yjwAOmFmlWYrD4IX3fu0mV65arX27+vThvCGkpVClr0=; b=U8BhseLONYkp9x7mWf7kuA4/gLGdeFx1HMRNRozlMxY5GwKdGJrRO1fUDhxvNw4Nno71Sb HYPREPtQh6lFDk7T/QkBW5bqlFpBXEyRtXaUzs+ZPk52owcBJQwNeT9DJDYE8CpqF6boKD pipjhzT80BogpwKYsnouDSddPcxv65bxPQGsvZcfC93l9hmVoY5DabrldN95AWikp5vWub ga1bxAS4oNqJlAEyrNvtfC8o1ThzGqidI1rIBq/ory3b/aEfvtRMYebTkBtz2heWEhQRh2 GkxZ8q1Dg9CVhIcluoAsvGEQKVGtZPZY4WIu7XFT+jU+tIugBXTyxJUvZUP8tw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1703000188; a=rsa-sha256; cv=none; b=sgOllyCTLlI8IXH7yXXhvJr864Bp/ZNB6Zyd8uICUuLOc7aznWunCDljUR9yVUeYu3LXSX K0q+xs+VOLoV/l2mVnSvEe9w1W5FSULRDzvYtnQKUtWptScoMASI095J1K+KKNye2FojTh uzYXwp2FlzvrNkOYOsoJHonFGjgYvgGfYyDrHq1ESiBaD6tCJcbBRzkQUdu8FBWT90LHvL nSg28F2RE5oUxym/MWTtKGK3qhIGTBiyA33QfV+LVyiH6LC9Eh3YLThX/L1KlcZvoUVK7i T9HXKqtymACiGYUoNoeqjQRYaVlkwuN8i84ERKc6MQRmQ/Nz3eK6zVD8sVYYcA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="GfJF/Erw"; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com 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 3A3C146F08 for ; Tue, 19 Dec 2023 16:36:28 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rFc8P-0004vy-1Z; Tue, 19 Dec 2023 10:35:53 -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 1rFc8N-0004vZ-Kz for help-guix@gnu.org; Tue, 19 Dec 2023 10:35:51 -0500 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rFc8K-0005RM-Od for help-guix@gnu.org; Tue, 19 Dec 2023 10:35:51 -0500 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-33677e66243so5048f8f.1 for ; Tue, 19 Dec 2023 07:35:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703000146; x=1703604946; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=yjwAOmFmlWYrD4IX3fu0mV65arX27+vThvCGkpVClr0=; b=GfJF/ErwSpq/20T8cs7AZVFZnqgs7w/9d/5AOT5kVRWWcjLOknh/ESivPvZmacqMgZ z8vBjtIiJxjSjwqt4R+quz7dF+r7TZcUNgHhJkje3sG/0t0ZqjbQXR/Qh3S/yehjpt+f yhVSvrzSi/fig1h0/Y9nBa8Tj+BZACqylz3j+dBUei5HPzPRan6yCUpnymfRTV1Vbp4Y 1OsQuv/lUIYD7XCUW/rHgxrQr3MmRB4gAmlTVTG6znWfuh/YEzRZtzUsQEY5SGxYLl65 shaHn3Sk5x29k8FP6FfCgNC4SfRAxkPoBC3Pjlm3Z2wmk5P8A1FYCfN/2s+iUiKHlJXx cf7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703000146; x=1703604946; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:to:from:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=yjwAOmFmlWYrD4IX3fu0mV65arX27+vThvCGkpVClr0=; b=La0L7jgw4Kalxe96/8MgEL+myJhdD4Nc9QFp4eGqM3jdIU6WMCRnoU7eP/psN1iuna Y/ykuwhfzE+VOi6mjYA7OySthufRM44ydW53Jk3FVuB4LFLAn5tuqtw1SIzcfdIElZ2U 3HvwkntMauYeXk1pGkv3lCAK/2nH+z0tG87HlRI99f2eCTdPB/yGgleGmbryLpF9FKeL UQv7WpPs96oA9qswecKs9PWobR2ppHfaCIqnfsMWRAF2qnkKwYnqsdXGrY2HxOjBPkqs 3+beZaUT5/YhaThub15OSYdi1S98X1FU9ZyV6Sod8KiogT7QgrqaUf+U6MBMqHGNzH0O WpNQ== X-Gm-Message-State: AOJu0YzMOB9b31Vw6t3s+SYgOSnK/pNNFo7tMWeu4nux1zNewoD1ryyU eZizG2YE5953yKCLsOLo3ZAdUnRQGYM= X-Google-Smtp-Source: AGHT+IGjrEs+leGeVQL2axjez3doos47ayj1uf+McrFpsMeby2wc3TSOFRXO6keY8y/IarR7I7lD1Q== X-Received: by 2002:a5d:6050:0:b0:336:7406:1004 with SMTP id j16-20020a5d6050000000b0033674061004mr1169391wrt.2.1703000145851; Tue, 19 Dec 2023 07:35:45 -0800 (PST) Received: from pfiuh07 ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id o8-20020a5d6708000000b00336765e9babsm759384wru.83.2023.12.19.07.35.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 07:35:45 -0800 (PST) From: Simon Tournier To: Kristoffer =?utf-8?Q?Str=C3=B6m?= , help-guix Subject: Re: Emacs C source In-Reply-To: <87le9tge6r.fsf@rymdkoloni.se> References: <87r0jnv7j1.fsf@rymdkoloni.se> <87le9tge6r.fsf@rymdkoloni.se> Date: Tue, 19 Dec 2023 16:35:43 +0100 Message-ID: <87jzpa2oj4.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=zimon.toutoune@gmail.com; helo=mail-wr1-x42a.google.com 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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: help-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -8.03 X-Spam-Score: -8.03 X-Migadu-Queue-Id: 3A3C146F08 X-Migadu-Scanner: mx11.migadu.com X-TUID: MZOFLao9knhy Hi, On Sun, 17 Dec 2023 at 14:18, Kristoffer Str=C3=B6m wrote: > That's nice to know! However i would greatly prefer if there was some > way to make it be available as part of a manifest, Well, I am not aware of such out-of-box feature. > i'm building multiple > environments using guix shell containers, and doing this as an extra > step in each one is not very pleasant. Hum, I am missing context but I do not see what would be the workflow. > something along the lines of `guix shell -D emacs` but for sources Somehow Guix will manipulate read-only items in the store; thus the source is not directly useful. Something like that ugly, --8<---------------cut here---------------start------------->8--- (use-modules (guix scripts build)) (specifications->manifest (map (lambda (spec) (begin (guix-build "--source" spec) spec)) (list "emacs" "coreutils" ))) --8<---------------cut here---------------end--------------->8--- allows to fetch the corresponding source of each package. However, the source (tarball) are not part of the =E2=80=99manifest=E2=80=99 and thus no= t visible inside the container. It is possible to do it using some plumbing Guix procedures, I guess. :-) Aside, I initially wrote a Guix script (see below) for mainly demoing and now, I am using more or more. :-) I think something in this area is missing. I would like such workflow guix emacs custom/path/to/emacs cd custom/path/to/emacs guix shell -C -D emacs =E2=80=A6 hack =E2=80=A6 And the script just shows how to download the source of a package. (Please note that =E2=80=9Cguix build --source=E2=80=9D returns the sou= rce after the applying snippets, and the tiny script manipulated the URL of source, i.e., before the applications of snippets.) Cheers, simon --8<---------------cut here---------------start------------->8--- $ cat examples/scripts/show-me-fetch.scm=20 #!/usr/bin/env -S guix repl -q -- ;; -*- mode: scheme -*- !# ;;; Copyright =C2=A9 2023 Simon Tournier ;;; ;;; ;;; This script show URL of packages. ;;; (use-modules (ice-9 match) ((gnu packages) #:select (specification->package)) (guix packages) ((web uri) #:select (string->uri uri->string)) ((guix build download) #:select (maybe-expand-mirrors)) ((guix download) #:select (%mirrors)) (guix git-download)) (let ((pkgs (match (command-line) ((prog-name pkgs ...) (map specification->package pkgs)) (_ (begin (format #t "Error. Try: ./show-me-url.scm hello") (exit 1)))))) (for-each (lambda (pkg) (match (package-source pkg) ;; See 'origin->json' from file build-package-metadata.scm in reposi= tory ;; maintenance.git for an exhaustive case handling. ((? origin? o) (match (origin-uri o) ((? string? s) ;; Pick only the first (car) of the potenial long list (let ((url (car (map uri->string (maybe-expand-mirrors (string->uri s) %mirr= ors))))) (format #t "wget ~a~%" url))) ((? git-reference? g) (let* ((url (git-reference-url g)) (revision (git-reference-commit g)) (tmpdir (string-append "/tmp/" (package-name pkg))) (git (string-append "git -C " tmpdir))) (format #t "mkdir -p ~a ~%" tmpdir) (format #t "&& ~a init --initial-branch=3Dmain ~%" git) (format #t "&& ~a remote add origin ~a ~%" git url) (format #t "&& ~a fetch --depth 1 origin ~a ~%" git revision) (format #t "&& ~a checkout FETCH_HEAD ~%" git))) ;; All the other cases (_ #f))))) pkgs) (exit 0)) --8<---------------cut here---------------end--------------->8---