all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: Guile-Git & delayed ‘dynamic-link’ calls
       [not found]           ` <87blw4b7fj.fsf@gnu.org>
@ 2019-11-24 11:52             ` Mathieu Othacehe
  2019-11-25 16:48               ` Mathieu Othacehe
  0 siblings, 1 reply; 3+ messages in thread
From: Mathieu Othacehe @ 2019-11-24 11:52 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Guix Devel


Hey,

I noticed a regression with the patch da54721b1bd221. When using
set-fetch-auth-with-ssh-agent! function, I have the following error:

--8<---------------cut here---------------start------------->8---
ERROR: Wrong type (expecting exact integer): 0
--8<---------------cut here---------------end--------------->8---

Applying the following patch:

--8<---------------cut here---------------start------------->8---
diff --git a/git/fetch.scm b/git/fetch.scm
index da18bbe..a213859 100644
--- a/git/fetch.scm
+++ b/git/fetch.scm
@@ -52,8 +52,8 @@
    fetch-options
    (cred-acquire-cb
     (lambda (cred url username allowed payload)
-      (cred-ssh-key-from-agent cred
-                               (pointer->string username))))))
+      (+ 0 (cred-ssh-key-from-agent cred
+                                    (pointer->string username)))))))
--8<---------------cut here---------------end--------------->8---

the problem is fixed. It seems that the return of
cred-ssh-key-from-agent is not detected as an integer (because of
"catch" function used in libgit2->procedure?). Doing something like:

--8<---------------cut here---------------start------------->8---
diff --git a/git/bindings.scm b/git/bindings.scm
index 88be550..8e15715 100644
--- a/git/bindings.scm
+++ b/git/bindings.scm
@@ -56,16 +56,18 @@
                (list ENOSYS))))))
 
 (define (libgit2->procedure return name params)
+  (define res 0)
   (catch #t
     (lambda ()
       (let ((ptr (dynamic-func name (dynamic-link %libgit2))))
         ;; The #:return-errno? facility was introduced in Guile 2.0.12.
-        (pointer->procedure return ptr params
-                            #:return-errno? #t)))
+        (set! res (pointer->procedure return ptr params
+                                      #:return-errno? #t))))
     (lambda args
       (lambda _
         (throw 'system-error name  "~A" (list (strerror ENOSYS))
-               (list ENOSYS))))))
+               (list ENOSYS)))))
+  res)
--8<---------------cut here---------------end--------------->8---

also fixes the problem.

Does anywone understands what's going on here?

Thanks,

Mathieu
 

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

* Re: Guile-Git & delayed ‘dynamic-link’ calls
  2019-11-24 11:52             ` Guile-Git & delayed ‘dynamic-link’ calls Mathieu Othacehe
@ 2019-11-25 16:48               ` Mathieu Othacehe
  2019-11-26 10:29                 ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Mathieu Othacehe @ 2019-11-25 16:48 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Guix Devel


> Does anywone understands what's going on here?

Found it! It's the #:return-errno passed to pointer->procedure that
makes every call to libgit2->procedure return two values.

The second one (the errno) was silently ignored. I'll propose a patch
soon.

Mathieu

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

* Re: Guile-Git & delayed ‘dynamic-link’ calls
  2019-11-25 16:48               ` Mathieu Othacehe
@ 2019-11-26 10:29                 ` Ludovic Courtès
  0 siblings, 0 replies; 3+ messages in thread
From: Ludovic Courtès @ 2019-11-26 10:29 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: Guix Devel

Mathieu Othacehe <m.othacehe@gmail.com> skribis:

>> Does anywone understands what's going on here?
>
> Found it! It's the #:return-errno passed to pointer->procedure that
> makes every call to libgit2->procedure return two values.
>
> The second one (the errno) was silently ignored. I'll propose a patch
> soon.

Oh, great that you found it!

Ludo’.

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

end of thread, other threads:[~2019-11-26 10:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <87ef4lo3sb.fsf@inria.fr>
     [not found] ` <87v9xw9x8j.fsf@gmail.com>
     [not found]   ` <87a7f8yzj7.fsf@gnu.org>
     [not found]     ` <8736krxb1y.fsf@gmail.com>
     [not found]       ` <87h896eplo.fsf@gnu.org>
     [not found]         ` <87y32iwvyo.fsf@gmail.com>
     [not found]           ` <87blw4b7fj.fsf@gnu.org>
2019-11-24 11:52             ` Guile-Git & delayed ‘dynamic-link’ calls Mathieu Othacehe
2019-11-25 16:48               ` Mathieu Othacehe
2019-11-26 10:29                 ` Ludovic Courtès

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.