unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Git fetch method not working right
@ 2014-04-07 22:57 Manolis Ragkousis
  2014-04-08 11:57 ` Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: Manolis Ragkousis @ 2014-04-07 22:57 UTC (permalink / raw)
  To: Ludovic Courtès, Guix-devel

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

While I pass to it a specific commit, it downloads a different
(older?) version. I have prepared a testcase with the libpthread,
which is the one that this happens. It will download the files and
then the building will fail, so just compare the file
sysdeps/mach/hurd/pt-sysdep.h with the same file from the commit
e2ae1c43d168fc6f8b34332cbb0656e5d107cbf3 in master. They are
different.

Build it with "./pre-inst-env guix build libpthread -K"

[-- Attachment #2: libpthread_test_case.patch --]
[-- Type: text/x-patch, Size: 1795 bytes --]

From e67dcb197cdff59450aa05de6dcdc3f63e22f46e Mon Sep 17 00:00:00 2001
From: Manolis Ragkousis <manolis837@gmail.com>
Date: Tue, 8 Apr 2014 01:41:32 +0000
Subject: [PATCH] Testcase

---
 gnu/packages/hurd.scm | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index f1e7dbc..b23ace3 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -128,4 +128,37 @@ communication.")
      "This package provides C headers of the GNU Hurd, used to build the GNU C
 Library and other user programs.")
     (license gpl2+)))
+
+;;This should download the HEAD of the master branch but it's not
+;;Compare the file sysdeps/mach/hurd/pt-sysdep.h with the same file from 
+;;the commit e2ae1c43d168fc6f8b34332cbb0656e5d107cbf3 in master. They are different
+
+(define-public libpthread 
+  (package
+    (name "libpthread")
+    (version "0.3")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "git://git.sv.gnu.org/hurd/libpthread")
+                    (commit "e2ae1c43d168fc6f8b34332cbb0656e5d107cbf3")))
+              (sha256
+               (base32 
+                "0bb8m0pk7b53sww4ahjds77bvqy0alz54g3aylzwncfca52gacqp"))
+              (file-name "libpthread" )))
+    (build-system gnu-build-system)
+    (arguments
+     '(
+       #:phases
+       (alist-replace
+        'unpack
+        (lambda* (#:key inputs source #:allow-other-keys)                                        
+          (mkdir "source")
+          (chdir "source")
+          (copy-recursively source ".")
+           #t)
+        %standard-phases)))
+    (home-page "Testing")
+    (synopsis "Testing")
+    (description "Testing")
+    (license gpl2+)))
-- 
1.9.0


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

* Re: Git fetch method not working right
  2014-04-07 22:57 Git fetch method not working right Manolis Ragkousis
@ 2014-04-08 11:57 ` Ludovic Courtès
  2014-04-08 13:17   ` Manolis Ragkousis
  0 siblings, 1 reply; 4+ messages in thread
From: Ludovic Courtès @ 2014-04-08 11:57 UTC (permalink / raw)
  To: Manolis Ragkousis; +Cc: Guix-devel

Manolis Ragkousis <manolis837@gmail.com> skribis:

> While I pass to it a specific commit, it downloads a different
> (older?) version. I have prepared a testcase with the libpthread,
> which is the one that this happens. It will download the files and
> then the building will fail, so just compare the file
> sysdeps/mach/hurd/pt-sysdep.h with the same file from the commit
> e2ae1c43d168fc6f8b34332cbb0656e5d107cbf3 in master. They are
> different.
>
> Build it with "./pre-inst-env guix build libpthread -K"

The build log I have for ‘guix build -S libpthread’ is:

--8<---------------cut here---------------start------------->8---
Cloning into '/gnu/store/hq89ni9pgbsh989kybdv2fgllsyl8aqs-libpthread'...
Checking connectivity... done
Note: checking out 'e2ae1c43d168fc6f8b34332cbb0656e5d107cbf3'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

HEAD is now at e2ae1c4... Merge branch 'foo'
output path `/gnu/store/hq89ni9pgbsh989kybdv2fgllsyl8aqs-libpthread' should have r:sha256 hash `0bb8m0pk7b53sww4ahjds77bvqy0alz54g3aylzwncfca52gacqp', instead has `0h4k81bkygswcm8s4nwbq9p3gyy3v11syd70vdi5h0sj0jr93y55'
@ build-failed /gnu/store/152jws5fqk7vy0s9j8shnxcmxz9il8cv-libpthread.drv - 1 output path `/gnu/store/hq89ni9pgbsh989kybdv2fgllsyl8aqs-libpthread' should have r:sha256 hash `0bb8m0pk7b53sww4ahjds77bvqy0alz54g3aylzwncfca52gacqp', instead has `0h4k81bkygswcm8s4nwbq9p3gyy3v11syd70vdi5h0sj0jr93y55'
guix build: error: build failed: build of `/gnu/store/152jws5fqk7vy0s9j8shnxcmxz9il8cv-libpthread.drv' failed
--8<---------------cut here---------------end--------------->8---

As you can see, it does check out commit e2ae1c4.  However, the result
doesn’t have the sha256 hash that appears in the recipe, so it fails
(meaning: it cannot possibly go further and start building libpthread.)

What you should be doing is this:

  1. manually do a git checkout of the exact commit that you want;
  2. run ‘rm -rf .git’ in the checkout;
  3. run ‘guix hash -r .’ in the checkout;
  4. put that hash in the recipe.

From there, ‘guix build -S libpthread’ should succeed, and you’ll be
sure it corresponds to the very commit that you have before your eyes.

Can you try that and report back?

Thanks,
Ludo’.

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

* Re: Git fetch method not working right
  2014-04-08 11:57 ` Ludovic Courtès
@ 2014-04-08 13:17   ` Manolis Ragkousis
  2014-04-08 13:23     ` Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: Manolis Ragkousis @ 2014-04-08 13:17 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Guix-devel

Because I didn't change the sha256 hash after changing the commit
hash, it wasn't downloading the new one, but it was reusing the old
one already present from the previous builds. The moment I changed the
sha256 hash to the correct one, it downloaded the correct one and it
worked. All ok now.

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

* Re: Git fetch method not working right
  2014-04-08 13:17   ` Manolis Ragkousis
@ 2014-04-08 13:23     ` Ludovic Courtès
  0 siblings, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2014-04-08 13:23 UTC (permalink / raw)
  To: Manolis Ragkousis; +Cc: Guix-devel

Manolis Ragkousis <manolis837@gmail.com> skribis:

> Because I didn't change the sha256 hash after changing the commit
> hash, it wasn't downloading the new one, but it was reusing the old
> one already present from the previous builds.

Ah right, that’s because /gnu/store is essentially a cache, so it
considered that it already had the directory with that hash, and thus
didn’t re-download it.

> The moment I changed the sha256 hash to the correct one, it downloaded
> the correct one and it worked. All ok now.

Cool!

Ludo’.

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

end of thread, other threads:[~2014-04-08 13:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-07 22:57 Git fetch method not working right Manolis Ragkousis
2014-04-08 11:57 ` Ludovic Courtès
2014-04-08 13:17   ` Manolis Ragkousis
2014-04-08 13:23     ` Ludovic Courtès

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