guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Guile-Git & delayed ‘dynamic-link’ calls


From: Mathieu Othacehe
Subject: Re: Guile-Git & delayed ‘dynamic-link’ calls
Date: Sun, 24 Nov 2019 12:52:46 +0100
User-agent: mu4e 1.2.0; emacs 26.3

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
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]