From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mathieu Othacehe Subject: Re: Guile-Git & delayed =?utf-8?Q?=E2=80=98dynamic-link=E2=80=99?= calls Date: Sun, 24 Nov 2019 12:52:46 +0100 Message-ID: <87ftidsd81.fsf@gmail.com> References: <87ef4lo3sb.fsf@inria.fr> <87v9xw9x8j.fsf@gmail.com> <87a7f8yzj7.fsf@gnu.org> <8736krxb1y.fsf@gmail.com> <87h896eplo.fsf@gnu.org> <87y32iwvyo.fsf@gmail.com> <87blw4b7fj.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:34481) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iYqRg-0003p5-R7 for guix-devel@gnu.org; Sun, 24 Nov 2019 06:52:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iYqRf-0006Tv-MZ for guix-devel@gnu.org; Sun, 24 Nov 2019 06:52:52 -0500 In-reply-to: <87blw4b7fj.fsf@gnu.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Ludovic =?utf-8?Q?Court=C3=A8s?= 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