From: ludo@gnu.org (Ludovic Courtès)
To: Alex Kost <alezost@gmail.com>
Cc: guix-devel@gnu.org
Subject: Re: [PATCH 2/4] emacs: Add 'guix-devel-download-package-source'.
Date: Wed, 07 Oct 2015 14:23:21 +0200 [thread overview]
Message-ID: <87mvvu6f5y.fsf@gnu.org> (raw)
In-Reply-To: <87a8rwf2vl.fsf@gmail.com> (Alex Kost's message of "Tue, 06 Oct 2015 18:11:42 +0300")
Alex Kost <alezost@gmail.com> skribis:
> Ludovic Courtès (2015-10-05 18:55 +0300) wrote:
>
>> Alex Kost <alezost@gmail.com> skribis:
>>
>>> Ludovic Courtès (2015-10-04 19:57 +0300) wrote:
>>>
> [...]
>>>> In that case, I would suggest something based on the URL at point rather
>>>> than the origin at point.
>>>
>>> It's neither URL at point, nor origin at point: it's like "C-c . b" but
>>> to download the source of the current package definition instead of
>>> building it.
>>>
>>> Also I don't understand how it can be based on the URL at point as
>>> instead of the full URL, we have something like this:
>>>
>>> (uri (string-append "http://.../foo-" version ".tar.xz"))
>>>
>>> So currently to use "guix download", at first you need to manually
>>> construct the full URL. I find this inconvenient, that's why I want to
>>> have a command to download a source of the current package and to
>>> display its hash.
>>
>> Yes, that make sense.
>>
>> The problem I had in mind was that, when writing a new package
>> definition from scratch, you don’t know the SHA256 yet, but ‘sha256’ is
>> a required field of ‘origin’. So one would have to write a fake
>> ‘sha256’ value just for the sake of being able to use that feature,
>> which seems odd to me.
>>
>> See what I mean? How would you handle such a case?
>
> I don't see a problem here, since a fake sha256 may be any string,
Not really, since ‘base32’ is a macro that checks its argument at
expansion time. So in practice one cannot C-M-x a package with a random
base32 string.
> for example "" (an empty string). Also I believe people begin to
> write a new package from some template, so you have a working skeleton
> of future package with all required fields from the very beginning.
> Then after filling an origin 'uri', you could "C-c . s" to download
> the source and get its hash.
Hmm. I’m skeptical. :-)
What about, instead, providing an interactive function that would prompt
for a URL, run ‘guix download’ on that, and emit an ‘origin’ template at
point with all the info?
> Oh, now I see what you mean. Well, I don't know, I think if a user has
> a habbit to check a signature, he will check it anyway; and if not, then
> not. Besides, at first a packager needs to find an URL of the source
> tarball, so he will meet a signature anyway, if it exists. So it's up
> to him if he checks it or not.
(Him or her.)
I think we really want to give packagers a strong incentive to check
signatures. Tools should make it easy to do that.
>>>>> At first I also thought about building a package source and then to
>>>>> calculate the hash of the store file, but this way will lead to the
>>>>> wrong hashes for "snippet"-ed origins. Or do I miss anything?
>>>>
>>>> Well, I think bindings for ‘package-source-derivation’ would also be
>>>> useful, but IIUC this is not what you had in mind.
>>>
>>> If you mean to make a command to build the current package source, it
>>> can be done, although I don't see how it can be useful.
>>
>> It’s occasionally useful, similar to ‘guix build -S’ or the “Show”
>> button in package info buffers, except that it would operate directly on
>> the package at point.
>>
>> WDYT?
>
> Indeed, I agree. So if you don't mind the “download” command, then
> since there will be 2 commands for working with the source of the
> current package, what about the following key bindings for them:
>
> "C-c . s d" - to download the source (to know its hash)
> "C-c . s b" - to build it
Sounds good!
Thanks,
Ludo’.
next prev parent reply other threads:[~2015-10-07 12:23 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-02 13:04 emacs: devel: Add lint/download commands Alex Kost
2015-10-02 13:04 ` [PATCH 1/4] emacs: Add 'guix-devel-with-definition' Alex Kost
2015-10-03 20:31 ` Ludovic Courtès
2015-10-02 13:04 ` [PATCH 2/4] emacs: Add 'guix-devel-download-package-source' Alex Kost
2015-10-03 20:35 ` Ludovic Courtès
2015-10-04 13:39 ` Alex Kost
2015-10-04 16:57 ` Ludovic Courtès
2015-10-04 18:28 ` Alex Kost
2015-10-05 15:55 ` Ludovic Courtès
2015-10-06 15:11 ` Alex Kost
2015-10-07 2:07 ` Checking signatures on source tarballs Mark H Weaver
2015-10-07 3:18 ` Christopher Allan Webber
2015-10-07 8:29 ` Andreas Enge
2015-10-07 12:06 ` Ludovic Courtès
2015-10-07 14:09 ` Mark H Weaver
2015-10-07 18:05 ` Leo Famulari
2015-10-07 20:59 ` Ludovic Courtès
2015-10-08 11:44 ` Ludovic Courtès
2015-10-12 8:37 ` Brandon Invergo
2015-10-12 9:18 ` [bug-gsrc] " Brandon Invergo
2015-10-12 16:38 ` Ludovic Courtès
2015-10-12 21:26 ` Brandon Invergo
2015-10-12 21:34 ` Ludovic Courtès
2015-10-12 22:06 ` Brandon Invergo
2015-10-13 9:47 ` Ludovic Courtès
2015-10-12 16:39 ` Ludovic Courtès
2016-02-22 4:20 ` Christopher Allan Webber
2015-10-10 7:22 ` Alex Vong
2015-10-10 17:03 ` Mark H Weaver
2015-10-11 17:44 ` Ludovic Courtès
2015-10-14 5:33 ` Rastus Vernon
2015-10-15 13:33 ` Mark H Weaver
2015-10-07 17:45 ` Alex Kost
2015-10-07 12:23 ` Ludovic Courtès [this message]
2015-10-07 17:25 ` [PATCH 2/4] emacs: Add 'guix-devel-download-package-source' Alex Kost
2015-10-07 19:15 ` Ian Denhardt
2015-10-09 12:14 ` Alex Kost
2015-10-07 22:10 ` Ludovic Courtès
2015-10-08 11:27 ` Alex Kost
2015-10-08 11:46 ` Ludovic Courtès
2015-10-09 12:08 ` Alex Kost
2015-10-09 12:17 ` Ludovic Courtès
2015-10-09 14:00 ` [PATCH] emacs: Add 'guix-devel-build-package-source' Alex Kost
2015-10-11 18:33 ` Ludovic Courtès
2015-10-08 14:43 ` [PATCH 2/4] emacs: Add 'guix-devel-download-package-source' Christopher Allan Webber
2015-10-08 15:03 ` Ludovic Courtès
2015-10-02 13:04 ` [PATCH 3/4] lint: Export 'run-checkers' Alex Kost
2015-10-03 20:36 ` Ludovic Courtès
2015-10-02 13:04 ` [PATCH 4/4] emacs: Add 'guix-devel-lint-package' Alex Kost
2015-10-03 20:44 ` Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87mvvu6f5y.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=alezost@gmail.com \
--cc=guix-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).