From: Mathieu Othacehe <m.othacehe@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: Guix Devel <guix-devel@gnu.org>
Subject: Re: Guile-Git & delayed ‘dynamic-link’ calls
Date: Sun, 24 Nov 2019 12:52:46 +0100 [thread overview]
Message-ID: <87ftidsd81.fsf@gmail.com> (raw)
In-Reply-To: <87blw4b7fj.fsf@gnu.org>
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
next parent reply other threads:[~2019-11-24 11:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[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 ` Mathieu Othacehe [this message]
2019-11-25 16:48 ` Guile-Git & delayed ‘dynamic-link’ calls Mathieu Othacehe
2019-11-26 10:29 ` 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ftidsd81.fsf@gmail.com \
--to=m.othacehe@gmail.com \
--cc=guix-devel@gnu.org \
--cc=ludo@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 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.