unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* use of git-fetch
@ 2015-07-22 16:32 Federico Beffa
  2015-07-22 17:00 ` Thompson, David
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Federico Beffa @ 2015-07-22 16:32 UTC (permalink / raw)
  To: Guix-devel

[-- Attachment #1: Type: text/plain, Size: 576 bytes --]

Hi,

I'm trying to package some emacs libraries that appear not to have a
GNU style installation procedure. Given that MELPA is unusable, I'm
trying to use 'git-fetch'.

The package 'emacs-dash' (see attachment) works as expected. However,
the package 'emacs-s' also downloads 'dash' and not 's'. I cloned with
git the two repositories with the given URLs and they definitely are
different.

Am I doing something wrong?

Thanks,
Fede

P.S. The hash of 'emacs-s' is wrong. It is a copy of the one for
'emacs-dash' and I will change it once I manage to download the right
repo.

[-- Attachment #2: git-fetch-dash-s.scm --]
[-- Type: text/x-scheme, Size: 1462 bytes --]

(define-public emacs-dash
  (package
    (name "emacs-dash")
    (version "eadb2651bb")
    (source (origin
              (method git-fetch)
              (uri (git-reference
                    (commit version)
                    (url "https://github.com/magnars/dash.el.git")))
              (sha256
               (base32
                "06mc7kh3fzdh2mqkyynjnp0xpv30yfaiik8bqv8z5b6hldji3cky"))))
    (build-system emacs-build-system)
    (arguments
     `(#:phases
       (modify-phases %standard-phases
         (add-before 'install 'check
                     (lambda _
                       (zero? (system* "./run-tests.sh")))))))
    (home-page "https://github.com/magnars/dash.el")
    (synopsis "Modern list library for Emacs")
    (description "An Emacs library providing a modern list API.")
    (license license:gpl3+)))

(define-public emacs-s
  (package
    (name "emacs-s")
    (version "e59915ec6f")
    (source (origin
              (method git-fetch)
              (uri (git-reference
                    (commit version)
                    (url "https://github.com/magnars/s.el.git")))
              (sha256
               (base32
                "06mc7kh3fzdh2mqkyynjnp0xpv30yfaiik8bqv8z5b6hldji3cky"))))
    (build-system emacs-build-system)
    (home-page "https://github.com/magnars/s.el")
    (synopsis "Emacs string manipulation library.")
    (description "An Emacs library for manipulating strings.")
    (license license:gpl3+)))

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: use of git-fetch
  2015-07-22 16:32 use of git-fetch Federico Beffa
@ 2015-07-22 17:00 ` Thompson, David
  2015-07-23  6:20   ` Federico Beffa
  2015-07-22 21:10 ` Ludovic Courtès
  2015-07-24 17:46 ` Alex Kost
  2 siblings, 1 reply; 9+ messages in thread
From: Thompson, David @ 2015-07-22 17:00 UTC (permalink / raw)
  To: Federico Beffa; +Cc: Guix-devel

On Wed, Jul 22, 2015 at 12:32 PM, Federico Beffa <beffa@ieee.org> wrote:
> Hi,
>
> I'm trying to package some emacs libraries that appear not to have a
> GNU style installation procedure. Given that MELPA is unusable, I'm
> trying to use 'git-fetch'.
>
> The package 'emacs-dash' (see attachment) works as expected. However,
> the package 'emacs-s' also downloads 'dash' and not 's'. I cloned with
> git the two repositories with the given URLs and they definitely are
> different.
>
> Am I doing something wrong?

Are you deleting the '.git' directory before computing the hash of the
directory?  That is a necessary step.

Consider this a call for someone to extend 'guix download' to work
with Git repositories so people don't have to do this tedious process.
Any takers?

- Dave

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: use of git-fetch
  2015-07-22 16:32 use of git-fetch Federico Beffa
  2015-07-22 17:00 ` Thompson, David
@ 2015-07-22 21:10 ` Ludovic Courtès
  2015-07-23  6:29   ` Federico Beffa
  2015-07-24 17:46 ` Alex Kost
  2 siblings, 1 reply; 9+ messages in thread
From: Ludovic Courtès @ 2015-07-22 21:10 UTC (permalink / raw)
  To: Federico Beffa; +Cc: Guix-devel

Federico Beffa <beffa@ieee.org> skribis:

>               (sha256
>                (base32
>                 "06mc7kh3fzdh2mqkyynjnp0xpv30yfaiik8bqv8z5b6hldji3cky"))))

[...]

>               (sha256
>                (base32
>                 "06mc7kh3fzdh2mqkyynjnp0xpv30yfaiik8bqv8z5b6hldji3cky"))))

Both recipes are telling that they use the same source.  So the daemon
cleverly saves one download since it already has the thing with that
hash on disk.  See?  :-)

HTH,
Ludo’.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: use of git-fetch
  2015-07-22 17:00 ` Thompson, David
@ 2015-07-23  6:20   ` Federico Beffa
  0 siblings, 0 replies; 9+ messages in thread
From: Federico Beffa @ 2015-07-23  6:20 UTC (permalink / raw)
  To: Thompson, David; +Cc: Guix-devel

On Wed, Jul 22, 2015 at 7:00 PM, Thompson, David
<dthompson2@worcester.edu> wrote:
> On Wed, Jul 22, 2015 at 12:32 PM, Federico Beffa <beffa@ieee.org> wrote:
>> Hi,
>>
>> I'm trying to package some emacs libraries that appear not to have a
>> GNU style installation procedure. Given that MELPA is unusable, I'm
>> trying to use 'git-fetch'.
>>
>> The package 'emacs-dash' (see attachment) works as expected. However,
>> the package 'emacs-s' also downloads 'dash' and not 's'. I cloned with
>> git the two repositories with the given URLs and they definitely are
>> different.
>>
>> Am I doing something wrong?
>
> Are you deleting the '.git' directory before computing the hash of the
> directory?  That is a necessary step.

Thanks for the suggestion! Probably I didn't explain well... see the
reply to Ludovic.

>
> Consider this a call for someone to extend 'guix download' to work
> with Git repositories so people don't have to do this tedious process.
> Any takers?
>
> - Dave

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: use of git-fetch
  2015-07-22 21:10 ` Ludovic Courtès
@ 2015-07-23  6:29   ` Federico Beffa
  2015-07-23 22:50     ` Ludovic Courtès
  0 siblings, 1 reply; 9+ messages in thread
From: Federico Beffa @ 2015-07-23  6:29 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Guix-devel

On Wed, Jul 22, 2015 at 11:10 PM, Ludovic Courtès <ludo@gnu.org> wrote:
> Federico Beffa <beffa@ieee.org> skribis:
>
>>               (sha256
>>                (base32
>>                 "06mc7kh3fzdh2mqkyynjnp0xpv30yfaiik8bqv8z5b6hldji3cky"))))
>
> [...]
>
>>               (sha256
>>                (base32
>>                 "06mc7kh3fzdh2mqkyynjnp0xpv30yfaiik8bqv8z5b6hldji3cky"))))
>
> Both recipes are telling that they use the same source.  So the daemon
> cleverly saves one download since it already has the thing with that
> hash on disk.  See?  :-)

Thanks for the reply!

I thought about this and, before posting, I also tried with an hash
where the first character was changed from '0' to '6'. It gave the
same result, even after deleting any existing 'emacs-dash' and
'emacs-s' derivation in the store. In my understanding that shouldn't
happen. Is that correct?

By changing the hash to a totally different one (a string of '6's) it
downloads the right repo. As expected, it complains about the hash and
gives me the right one which I can copy into the package recipe.
(That's The Lazy work-flow :-).)

Regards,
Fede

>
> HTH,
> Ludo’.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: use of git-fetch
  2015-07-23  6:29   ` Federico Beffa
@ 2015-07-23 22:50     ` Ludovic Courtès
  2015-07-24 14:32       ` Federico Beffa
  0 siblings, 1 reply; 9+ messages in thread
From: Ludovic Courtès @ 2015-07-23 22:50 UTC (permalink / raw)
  To: Federico Beffa; +Cc: Guix-devel

Federico Beffa <beffa@ieee.org> skribis:

> On Wed, Jul 22, 2015 at 11:10 PM, Ludovic Courtès <ludo@gnu.org> wrote:
>> Federico Beffa <beffa@ieee.org> skribis:
>>
>>>               (sha256
>>>                (base32
>>>                 "06mc7kh3fzdh2mqkyynjnp0xpv30yfaiik8bqv8z5b6hldji3cky"))))
>>
>> [...]
>>
>>>               (sha256
>>>                (base32
>>>                 "06mc7kh3fzdh2mqkyynjnp0xpv30yfaiik8bqv8z5b6hldji3cky"))))
>>
>> Both recipes are telling that they use the same source.  So the daemon
>> cleverly saves one download since it already has the thing with that
>> hash on disk.  See?  :-)
>
> Thanks for the reply!
>
> I thought about this and, before posting, I also tried with an hash
> where the first character was changed from '0' to '6'. It gave the
> same result, even after deleting any existing 'emacs-dash' and
> 'emacs-s' derivation in the store. In my understanding that shouldn't
> happen. Is that correct?

Right, but we’d have to check the exact sequence of actions that you
took.

> By changing the hash to a totally different one (a string of '6's) it
> downloads the right repo. As expected, it complains about the hash and
> gives me the right one which I can copy into the package recipe.
> (That's The Lazy work-flow :-).)

Heh.  :-)

It’s a good idea to clone by hand though and check the signatures if
there are signed tags or commits (“trust on first clone”), but I’m
afraid this is not commonplace.

Ludo’.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: use of git-fetch
  2015-07-23 22:50     ` Ludovic Courtès
@ 2015-07-24 14:32       ` Federico Beffa
  2015-07-24 20:35         ` Ludovic Courtès
  0 siblings, 1 reply; 9+ messages in thread
From: Federico Beffa @ 2015-07-24 14:32 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Guix-devel

On Fri, Jul 24, 2015 at 12:50 AM, Ludovic Courtès <ludo@gnu.org> wrote:
> Federico Beffa <beffa@ieee.org> skribis:
>
>> On Wed, Jul 22, 2015 at 11:10 PM, Ludovic Courtès <ludo@gnu.org> wrote:
>>> Federico Beffa <beffa@ieee.org> skribis:
>>>
>>>>               (sha256
>>>>                (base32
>>>>                 "06mc7kh3fzdh2mqkyynjnp0xpv30yfaiik8bqv8z5b6hldji3cky"))))
>>>
>>> [...]
>>>
>>>>               (sha256
>>>>                (base32
>>>>                 "06mc7kh3fzdh2mqkyynjnp0xpv30yfaiik8bqv8z5b6hldji3cky"))))
>>>
>>> Both recipes are telling that they use the same source.  So the daemon
>>> cleverly saves one download since it already has the thing with that
>>> hash on disk.  See?  :-)
>>
>> Thanks for the reply!
>>
>> I thought about this and, before posting, I also tried with an hash
>> where the first character was changed from '0' to '6'. It gave the
>> same result, even after deleting any existing 'emacs-dash' and
>> 'emacs-s' derivation in the store. In my understanding that shouldn't
>> happen. Is that correct?
>
> Right, but we’d have to check the exact sequence of actions that you
> took.

Basically I did:

1. write the package for emacs-dash
2. guix build emacs-dash
3. copy emacs-dash and make emacs-s out of it, keeping the hash unchanged
4. guix build emacs-s

Boom: in the generated derivation I find dash.el instead of s.el.

5. change the first char of the hash 0->6

Boom: same.

6. change the full hash to a sequence of 6s.

OK, now I get the expected result.

7. change hash, rebuild and inspect.

Regards,
Fede

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: use of git-fetch
  2015-07-22 16:32 use of git-fetch Federico Beffa
  2015-07-22 17:00 ` Thompson, David
  2015-07-22 21:10 ` Ludovic Courtès
@ 2015-07-24 17:46 ` Alex Kost
  2 siblings, 0 replies; 9+ messages in thread
From: Alex Kost @ 2015-07-24 17:46 UTC (permalink / raw)
  To: Federico Beffa; +Cc: Guix-devel

Federico Beffa (2015-07-22 19:32 +0300) wrote:

> Hi,
>
> I'm trying to package some emacs libraries that appear not to have a
> GNU style installation procedure. Given that MELPA is unusable, I'm
> trying to use 'git-fetch'.

May I ask, why are you trying to use 'git-fetch'?  There are releases
for both "dash" and "s":

https://github.com/magnars/dash.el/releases
https://github.com/magnars/s.el/releases

-- 
Alex

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: use of git-fetch
  2015-07-24 14:32       ` Federico Beffa
@ 2015-07-24 20:35         ` Ludovic Courtès
  0 siblings, 0 replies; 9+ messages in thread
From: Ludovic Courtès @ 2015-07-24 20:35 UTC (permalink / raw)
  To: Federico Beffa; +Cc: Guix-devel

Federico Beffa <beffa@ieee.org> skribis:

> Basically I did:
>
> 1. write the package for emacs-dash
> 2. guix build emacs-dash
> 3. copy emacs-dash and make emacs-s out of it, keeping the hash unchanged
> 4. guix build emacs-s
>
> Boom: in the generated derivation I find dash.el instead of s.el.
>
> 5. change the first char of the hash 0->6
>
> Boom: same.

So you’re saying the two hashes that differed by one digit were
considered the same, essentially.

Could you check if there’s a simple way to reproduce it?

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-07-24 20:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-22 16:32 use of git-fetch Federico Beffa
2015-07-22 17:00 ` Thompson, David
2015-07-23  6:20   ` Federico Beffa
2015-07-22 21:10 ` Ludovic Courtès
2015-07-23  6:29   ` Federico Beffa
2015-07-23 22:50     ` Ludovic Courtès
2015-07-24 14:32       ` Federico Beffa
2015-07-24 20:35         ` Ludovic Courtès
2015-07-24 17:46 ` Alex Kost

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).