From unknown Wed Aug 20 01:21:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#35644: emacs module support doesn't work Resent-From: Caleb Ristvedt Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 09 May 2019 02:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 35644 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 35644@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.15573682363937 (code B ref -1); Thu, 09 May 2019 02:18:02 +0000 Received: (at submit) by debbugs.gnu.org; 9 May 2019 02:17:16 +0000 Received: from localhost ([127.0.0.1]:34430 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hOYcV-00011Q-MC for submit@debbugs.gnu.org; Wed, 08 May 2019 22:17:15 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57277) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hOYcT-00011D-0B for submit@debbugs.gnu.org; Wed, 08 May 2019 22:17:14 -0400 Received: from lists.gnu.org ([209.51.188.17]:60388) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hOYcL-00032b-BQ for submit@debbugs.gnu.org; Wed, 08 May 2019 22:17:06 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43404) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOYcI-0002Gc-C5 for bug-guix@gnu.org; Wed, 08 May 2019 22:17:05 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40 autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hOYcG-0002zH-DE for bug-guix@gnu.org; Wed, 08 May 2019 22:17:02 -0400 Received: from mail-it1-x134.google.com ([2607:f8b0:4864:20::134]:37597) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hOYcD-0002vY-Qv for bug-guix@gnu.org; Wed, 08 May 2019 22:16:58 -0400 Received: by mail-it1-x134.google.com with SMTP id l7so937623ite.2 for ; Wed, 08 May 2019 19:16:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cune-org.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:user-agent:mime-version; bh=Z6WWmlK5KT557pS4KSY0QfWxKw+uPEbd6bsQ1N36MhM=; b=kmhpkV3D0hC1nFWYpb9oyuiv5rS9MaPNosFMqVCaLW57Nbv+FkAHG8JwUE1YJTHoNC M4HsmWeKe3UO9DP0FlhxzAyk2jzj2V1MxNlE6x/vv2trZkAAs6e03FHm7KlV1BTB5Ozc erKL/yxl1qFZWmWc5NY/kz8YecyAIXfcwZZXlfUFrAy8VmKvNZL93E9TP3XI9o/d58GL r+A3AbPWFjpdYnaHWLCziytSmdqwaHLGJRGfdU3HRCm7gFl+RU1TwgPcPsT3hYqLUTtl XGLsztSp+49JCPF66ACZWJu6RfQQwbG1I4/XsvfnGojf4FJ9bKNbnuLTVqmE+fYc+jhP cgNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:user-agent :mime-version; bh=Z6WWmlK5KT557pS4KSY0QfWxKw+uPEbd6bsQ1N36MhM=; b=JYPDA4QqK79mcsZMnUBuBLXGtkGodZBOJ7Pu8DCsj92nrUtw1x9A9TCeMMfJDQXp5Y /pYIttww1OvoMz8gDWsBX2/A1sFCm17oVnUd6ooeBip9pwXry9QZZFEXkn3A5k5Lv5+/ mJjBLB5aiSFHIOzJqJnHFBkB7U6xyyJiIItoAZm5okTDoinjducz//sMKFsojLw7CcZJ OKl64EJNeCyzHTLbmNsU7sS0zh7sU8prxfpcLGcWZIIbCC21VyBc8y7iJ9yOJGJaIFuw I45dmAAxCfDUMubnc7xsLAF7G9aWQA4VXYvtKfTkBQDubJTPSWK/qXAFie2MZ9IX8q1l lvxw== X-Gm-Message-State: APjAAAUJ622n+S7fdsyBniM2GGgILaXaADCJJ31g+po/xIxHPGna2nTS tU0hFPElRYvYD8ZR6ygy2bHGr3Kfsa7iSQ== X-Google-Smtp-Source: APXvYqysY3ci8FA89N7WUFIA/4w7vaUpUOSa0NTXO86dBrpxted7ogPB58K9N7J/jasrVQTfoH1d+A== X-Received: by 2002:a24:6b92:: with SMTP id v140mr958889itc.161.1557368213516; Wed, 08 May 2019 19:16:53 -0700 (PDT) Received: from GuixPotato ([208.89.170.37]) by smtp.gmail.com with ESMTPSA id b12sm375955ioq.31.2019.05.08.19.16.52 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 May 2019 19:16:52 -0700 (PDT) From: Caleb Ristvedt Date: Wed, 08 May 2019 21:16:48 -0500 Message-ID: <87o94cid7z.fsf@cune.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::134 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: -1.4 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) While attempting to package libegit2 (https://github.com/magit/libegit2), I found that any attempt at loading a dynamic module from emacs would seemingly work (it returns t), but not actually work: no module api functions invoked from C seem to have any effect, including defining functions and printing messages. Here's an example ------------------------------- #include #include #include int plugin_is_GPL_compatible; static emacs_value hello(emacs_env *env, ptrdiff_t nargs, emacs_value args[], void *data) { const char str[] = "Hello Emacs"; return env->make_string(env, str, sizeof(str) - 1); } /* Module init function. */ int emacs_module_init(struct emacs_runtime *ert) { emacs_env *env = ert->get_environment(ert); emacs_value hellofn = env->make_function(env, 0, 0, hello, "return hello string", NULL); // Bind NAME to FUN. // (defalias 'hello-c '(lambda () "Hello Emacs")) emacs_value defalias_sym = env->intern(env, "defalias"); emacs_value hello_sym = env->intern(env, "hello-c"); emacs_value defalias_args[] = { hello_sym, hellofn }; env->funcall(env, defalias_sym, 2, defalias_args); // Provide FEATURE to Emacs. // (provide 'hello-core) emacs_value feature_sym = env->intern(env, "hello-module"); emacs_value provide_sym = env->intern(env, "provide"); emacs_value provide_args[] = { feature_sym }; env->funcall(env, provide_sym, 1, provide_args); char message[] = "TEST MESSAGE!"; emacs_value message_str = env->make_string(env, message, sizeof(message) - 1); emacs_value message_sym = env->intern(env, "message"); emacs_value message_args[] = {message_str}; // spam a bit just to be sure env->funcall(env, message_sym, 1, message_args); env->funcall(env, message_sym, 1, message_args); env->funcall(env, message_sym, 1, message_args); return 0; } ------------------------------- Assuming the above file is named emacs-module-test.c: ------------------------------- $ gcc -fPIC -shared emacs-module-test.c -o hello-module.so $ emacs -Q -L . --batch -l hello-module --eval "(message (hello-c))" => Symbol's function definition is void: hello-c ------------------------------- As far as I can tell, this should work. Our emacs is built with '--with-modules', and 'MODULES' is in system-configuration-features. Any idea what's going wrong? - reepca From unknown Wed Aug 20 01:21:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#35644: emacs module support doesn't work Resent-From: mike@rohleder.de Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 10 Mar 2020 16:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35644 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Caleb Ristvedt Cc: 35644@debbugs.gnu.org Received: via spool by 35644-submit@debbugs.gnu.org id=B35644.158385913918146 (code B ref 35644); Tue, 10 Mar 2020 16:53:02 +0000 Received: (at 35644) by debbugs.gnu.org; 10 Mar 2020 16:52:19 +0000 Received: from localhost ([127.0.0.1]:53193 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jBi79-0004ib-3q for submit@debbugs.gnu.org; Tue, 10 Mar 2020 12:52:19 -0400 Received: from wp224.webpack.hosteurope.de ([80.237.132.231]:35904) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jBi77-0004iS-Ch for 35644@debbugs.gnu.org; Tue, 10 Mar 2020 12:52:18 -0400 Received: from www.rohleder.de ([37.61.204.227]); authenticated by wp224.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1jBi75-0003Cr-3l; Tue, 10 Mar 2020 17:52:15 +0100 Received: from [192.168.1.3] (helo=micha) by www.rohleder.de with smtp (Exim 4.93) (envelope-from ) id 1jBi73-0007rC-Fe; Tue, 10 Mar 2020 17:52:14 +0100 Received: by micha (sSMTP sendmail emulation); Tue, 10 Mar 2020 17:52:12 +0100 From: mike@rohleder.de References: <87o94cid7z.fsf@cune.org> X-PGP-Fingerprint: 755E 2DE5 D0D5 85C5 2E78 2830 7C7A FFBE FEF2 CB25 X-PGP-Key: https://www.rohleder.de/~mike/pgpkey.asc Date: Tue, 10 Mar 2020 17:52:12 +0100 In-Reply-To: <87o94cid7z.fsf@cune.org> (Caleb Ristvedt's message of "Wed, 08 May 2019 21:16:48 -0500") Message-ID: <878sk8qhj7.fsf@rohleder.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-bounce-key: webpack.hosteurope.de;mike@rohleder.de;1583859137;4d215340; X-HE-SMSGID: 1jBi75-0003Cr-3l X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Caleb Ristvedt writes: > > Assuming the above file is named emacs-module-test.c: > > ------------------------------- > $ gcc -fPIC -shared emacs-module-test.c -o hello-module.so > $ emacs -Q -L . --batch -l hello-module --eval "(message (hello-c))" > > =3D> Symbol's function definition is void: hello-c > ------------------------------- > > As far as I can tell, this should work. Our emacs is built with > '--with-modules', and 'MODULES' is in system-configuration-features. Any > idea what's going wrong? I cant reproduce this, it works for me: $ guix environment -C bash --ad-hoc emacs gcc-toolchain [env]$ gcc -fPIC -shared emacs-module-test.c -o hello-module.so [env]$ emacs -Q -L . --batch -l hello-module --eval "(message (hello-c))"= =20=20 TEST MESSAGE! TEST MESSAGE! TEST MESSAGE! Hello Emacs =2D-=20 Der Erfolg ist nicht danach zu beurteilen, was ein Mensch im Leben erreicht hat, sondern nach den Hindernissen, die er auf dem Weg zum Erfolg ueberwunden hat. (Booker T. Washington) --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEdV4t5dDVhcUueCgwfHr/vv7yyyUFAl5nxbwACgkQfHr/vv7y yyWgpwf/dDF2LPXQ8bRvmrxffjNZ1LUc5OE6FbVaDGyu0aP0n7ir4XrPGYvqHDLv 8bXepqjk7jYMZL80LDwVkAGOG4EhdQ6+L5mfpFeR6HZdsC1qUFweGXg3ZfujGUxa IY/Upg5ich3a022XU6KtIGmpSsX1AYPkWpAzs1Lua5RSjWzGVBRfYqotBe4QNZPR B5BXDj+EIEacyxxhwLWqwvWKdlmU693GEkaOwAY6LdOT6l6JKi8tn8GejXOnLxMb qWH9Vh2LkNO+uBvpOg86FsK2WopCokN14T6wDKCevuxr/IuNAUsTY1YufyVFNORw 6h2s90XsP59B1MS7Br6xAfvf2tcD5A== =pe1v -----END PGP SIGNATURE----- --=-=-=-- From unknown Wed Aug 20 01:21:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#35644: emacs module support doesn't work Resent-From: Caleb Ristvedt Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Wed, 11 Mar 2020 05:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35644 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: mike@rohleder.de Cc: 35644@debbugs.gnu.org Received: via spool by 35644-submit@debbugs.gnu.org id=B35644.15839061241172 (code B ref 35644); Wed, 11 Mar 2020 05:56:02 +0000 Received: (at 35644) by debbugs.gnu.org; 11 Mar 2020 05:55:24 +0000 Received: from localhost ([127.0.0.1]:53557 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jBuKx-0000Iq-Ko for submit@debbugs.gnu.org; Wed, 11 Mar 2020 01:55:23 -0400 Received: from mail-pf1-f179.google.com ([209.85.210.179]:39650) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jBuKv-0000Ic-Je for 35644@debbugs.gnu.org; Wed, 11 Mar 2020 01:55:22 -0400 Received: by mail-pf1-f179.google.com with SMTP id w65so672330pfb.6 for <35644@debbugs.gnu.org>; Tue, 10 Mar 2020 22:55:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cune-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YSs/5kYJMkjwSi7S+BMYEU9ILUwrz4Wsz0XEsoOb1RE=; b=INw6bQC0ZPKpZkEq+Td+Zpl9JLSeXbkfoAqvc5sQBXg9W0ERYJClzJg2mgbWkFuQGH HXFwTvXjX1/RmC8+j9Sir07pf+LsHdhpu+RpB4GW8A3NJwz7rReT9l/IvLJUwaK9t4YC pXixl2jFh4T+TukCW+KbIqRRBe7vmNrrXeN3jcolQRoEifi3tWGB4TPh4sPxKudXox9O fMMMhyKhrkvneCaJCf03ZBc/IbzMfNmdaa1+XCCLczM/cy2wj6cjbeC0SBbHFFOYVOAs Gu1UPkRpUqbHtiibrLSm1T42PfzctvJOT0WJIJCz2TkxIhN8IDbDKrYRM3WYV02y8Epj Tjow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=YSs/5kYJMkjwSi7S+BMYEU9ILUwrz4Wsz0XEsoOb1RE=; b=uKu501V1ktDsvDcimcqa45TFwZJfCLeOjzxAk9uJ+mghaPcMEkpH/U1SFRVUj5jA/t I5l/KhIfgveLYoqZocoxrprOryFBWb4gMzQsXf9M8zTL+ocQlf3HLrMMM/Hj3OImIJ25 2O1EFQHywN2BWxmudCHmiYUoUanL5sZZitgZqKxt3ufjp/sKlq41LXN8TlBkcFohtdCA HkironDCGbSHQfwrKoBfgyX3MKnx7Dqc0p384mc0OQZjDOrDcNDYoEkdS3zCk34BTkJG HTkCnM6grFsnbfnIfRJ5E/nB4fOOWFawwV5kFsJCxjD3n7VEG25K4mf+KkxZMt0QNUdg VLew== X-Gm-Message-State: ANhLgQ27mZAi7k+j1zdlhB38DIWoZo22blkRoLNwlFaIXDwEfQuJ7+cl 6ND0wWSYEGXLQvffPxTWXVB8EijWY87qyWQT2saArsu7/Gs= X-Google-Smtp-Source: ADFU+vtWGuMqRyBS7/AskqsPE+5leZY0TRsBM3TQAotOTVimALG3ddnb7fd4hjXe1EAp4xYPwVDJvYR4+z682YmwY4g= X-Received: by 2002:a65:404d:: with SMTP id h13mr1289959pgp.156.1583906115428; Tue, 10 Mar 2020 22:55:15 -0700 (PDT) MIME-Version: 1.0 References: <87o94cid7z.fsf@cune.org> <878sk8qhj7.fsf@rohleder.de> In-Reply-To: <878sk8qhj7.fsf@rohleder.de> From: Caleb Ristvedt Date: Wed, 11 Mar 2020 05:55:04 +0000 Message-ID: Content-Type: multipart/alternative; boundary="0000000000005e37f805a08de150" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --0000000000005e37f805a08de150 Content-Type: text/plain; charset="UTF-8" I can confirm that it now works. I did a bit of looking through the commit history and playing around with 'guix time-machine', and whatever changed to fix it, it wasn't a change that touched gnu/packages/emacs.scm. I know it fell between 7ab5c4e0e8 and 5ce153b110, though. Thanks for bringing this up, I guess we can close this now? - reepca On Tue, Mar 10, 2020 at 4:52 PM wrote: > Caleb Ristvedt writes: > > > > Assuming the above file is named emacs-module-test.c: > > > > ------------------------------- > > $ gcc -fPIC -shared emacs-module-test.c -o hello-module.so > > $ emacs -Q -L . --batch -l hello-module --eval "(message (hello-c))" > > > > => Symbol's function definition is void: hello-c > > ------------------------------- > > > > As far as I can tell, this should work. Our emacs is built with > > '--with-modules', and 'MODULES' is in system-configuration-features. Any > > idea what's going wrong? > > I cant reproduce this, it works for me: > > $ guix environment -C bash --ad-hoc emacs gcc-toolchain > [env]$ gcc -fPIC -shared emacs-module-test.c -o hello-module.so > [env]$ emacs -Q -L . --batch -l hello-module --eval "(message (hello-c))" > TEST MESSAGE! > TEST MESSAGE! > TEST MESSAGE! > Hello Emacs > > > -- > Der Erfolg ist nicht danach zu beurteilen, was ein Mensch im Leben > erreicht hat, sondern nach den Hindernissen, die er auf dem Weg zum > Erfolg ueberwunden hat. > (Booker T. Washington) > --0000000000005e37f805a08de150 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I can confirm that it now works. I did a bit of looking th= rough the commit
history and playing around with 'guix time-machine&= #39;, and whatever changed to fix
it, it wasn't a change that touche= d gnu/packages/emacs.scm. I know it fell
between 7ab5c4e0e8 and 5ce153b1= 10, though.

Thanks for bringing this up, I guess we can close this n= ow?

- reepca

On Tue, Mar 10, 2020 at 4:52 PM <mike@rohleder.de> wrote:
Caleb Ristvedt <caleb.ristvedt@cune.org> wr= ites:
>
> Assuming the above file is named emacs-module-test.c:
>
> -------------------------------
> $ gcc -fPIC -shared emacs-module-test.c -o hello-module.so
> $ emacs -Q -L . --batch -l hello-module --eval "(message (hello-c= ))"
>
> =3D> Symbol's function definition is void: hello-c
> -------------------------------
>
> As far as I can tell, this should work. Our emacs is built with
> '--with-modules', and 'MODULES' is in system-configura= tion-features. Any
> idea what's going wrong?

I cant reproduce this, it works for me:

$ guix environment -C bash --ad-hoc emacs gcc-toolchain
[env]$ gcc -fPIC -shared emacs-module-test.c -o hello-module.so
[env]$ emacs -Q -L . --batch -l hello-module --eval "(message (hello-c= ))"=C2=A0
TEST MESSAGE!
TEST MESSAGE!
TEST MESSAGE!
Hello Emacs


--
Der Erfolg ist nicht danach zu beurteilen, was ein Mensch im Leben
erreicht hat, sondern nach den Hindernissen, die er auf dem Weg zum
Erfolg ueberwunden hat.
(Booker T. Washington)
--0000000000005e37f805a08de150-- From unknown Wed Aug 20 01:21:31 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Caleb Ristvedt Subject: bug#35644: closed (Re: bug#35644: emacs module support doesn't work) Message-ID: References: <87k13e7snq.fsf@devup.no> <87o94cid7z.fsf@cune.org> X-Gnu-PR-Message: they-closed 35644 X-Gnu-PR-Package: guix Reply-To: 35644@debbugs.gnu.org Date: Fri, 20 Mar 2020 19:07:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1584731222-26989-1" This is a multi-part message in MIME format... ------------=_1584731222-26989-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #35644: emacs module support doesn't work which was filed against the guix package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 35644@debbugs.gnu.org. --=20 35644: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D35644 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1584731222-26989-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 35644-done) by debbugs.gnu.org; 20 Mar 2020 19:06:30 +0000 Received: from localhost ([127.0.0.1]:45638 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jFMyT-00070P-Qx for submit@debbugs.gnu.org; Fri, 20 Mar 2020 15:06:30 -0400 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:60773) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jFMyR-00070A-Sw for 35644-done@debbugs.gnu.org; Fri, 20 Mar 2020 15:06:28 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id D1F575D0; Fri, 20 Mar 2020 15:06:21 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Fri, 20 Mar 2020 15:06:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=fm2; bh=M+qCHv2t+0AC4A4TApDm/mIwsX SNa3H8GHCntaGWtI4=; b=kS7BNWCYawBaownz+vkEw+SkOsz92gxfHo26QM1tFE DKgFUnZwO/cOQbjIPldeq9mRjU9YyEuL3BbLHupri4vFdbRCzSDwX6Y+SMUKi0aF rB2KAi3Qs2CfwGzxIimE8eq72p1SSB1/+vroDXw9RPQXXzpuWyk5Mz9bJ/26PHsa DiEo64zqaHdiIm/G0GK0493tIyokn7BhPDH9gLqz9pvPK07RtR0xTFujkoY60myV x7Mw70mwSlHltIf3J95+UuBXNLdvcuQERchnNb9Igtjoakzz3DYh6h56hDr2oaoP c7sMJVa2priM9Tgv66nY6Y6PyAStJlG+TQQ513YvVaaw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=M+qCHv 2t+0AC4A4TApDm/mIwsXSNa3H8GHCntaGWtI4=; b=IWDnK5D5LMJG+Et6xGT0xe 80+Yq0fuaNxmnBjqQb9qU+QeO8Q7tXFbcjvsOwP0/A+z1PRsTDBMnZvWIK0cJJ4i e1FVn8FFWzjPl0GpKvPLkcTpGBeQcFR1OLiZwqbCGBHt5Rv7kwpQZS/1w8OMzSai YY1cNqDmXtakdECMMrFg9yPo6+prcN1xJAebkEczTNuSpz2eY3tlxdNzqMw+CCpE LcQlb4U3X3uPwZ1k5aqyLkQ7YvqJNNG+uOkxoS/D4rja3O17LSQf50lYtlN/mLMr 8RN1597vd2/adqnamtdSs36LdATek8f9GFKGmKCD8SoVMR4GQ25jiFSDgEq/uxTQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrudeguddguddulecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffujghffgffkfggtgesghdtreertdertdenucfhrhhomhepofgrrhhi uhhsuceurghkkhgvuceomhgsrghkkhgvsehfrghsthhmrghilhdrtghomheqnecukfhppe ekgedrvddtvddrieekrdejheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhep mhgrihhlfhhrohhmpehmsggrkhhkvgesfhgrshhtmhgrihhlrdgtohhm X-ME-Proxy: Received: from localhost (ti0006q161-2604.bb.online.no [84.202.68.75]) by mail.messagingengine.com (Postfix) with ESMTPA id 5F20B30624E4; Fri, 20 Mar 2020 15:06:19 -0400 (EDT) From: Marius Bakke To: Caleb Ristvedt , mike@rohleder.de Subject: Re: bug#35644: emacs module support doesn't work In-Reply-To: References: <87o94cid7z.fsf@cune.org> <878sk8qhj7.fsf@rohleder.de> User-Agent: Notmuch/0.29.3 (https://notmuchmail.org) Emacs/26.3 (x86_64-pc-linux-gnu) Date: Fri, 20 Mar 2020 20:06:17 +0100 Message-ID: <87k13e7snq.fsf@devup.no> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 35644-done Cc: 35644-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain Caleb Ristvedt writes: > I can confirm that it now works. I did a bit of looking through the commit > history and playing around with 'guix time-machine', and whatever changed > to fix > it, it wasn't a change that touched gnu/packages/emacs.scm. I know it fell > between 7ab5c4e0e8 and 5ce153b110, though. > > Thanks for bringing this up, I guess we can close this now? Thank you both for the report and investigation. Closing! --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl51FCkACgkQoqBt8qM6 VPp4OggApwJYtj0C4Ln+047kGiOVcMdwFCo+Nl9XyYXQfPHa8r2OhI9aTRi0/Myy FNMqde7l35p0QQElDLQ3WHWa2uMZBItF81SYNfNUlJyA5lzMAxcXwcAIcMWcxYz5 ErL6X4mebPaJS//UHx/+IrfOhGZQ+Egj7VAjU/Ztng6LBcUXxcZm9dMgp50e/Rjg FHj1QziDr961xoq38Fcfgxq/xH6ZVArHL05FisPZJUOXmd88NiTp8TMwG3SGxnEC 7PLl6Y/uh7VYEgklbZzcbxwNwhk4PpmsJAGisPbPB62IpJ7gFWgxWyfe1v/9210j hZO/Q0e/cHX1VCSZaPgogNnL2OP/HA== =0MUz -----END PGP SIGNATURE----- --=-=-=-- ------------=_1584731222-26989-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 9 May 2019 02:17:16 +0000 Received: from localhost ([127.0.0.1]:34430 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hOYcV-00011Q-MC for submit@debbugs.gnu.org; Wed, 08 May 2019 22:17:15 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57277) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hOYcT-00011D-0B for submit@debbugs.gnu.org; Wed, 08 May 2019 22:17:14 -0400 Received: from lists.gnu.org ([209.51.188.17]:60388) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hOYcL-00032b-BQ for submit@debbugs.gnu.org; Wed, 08 May 2019 22:17:06 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43404) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOYcI-0002Gc-C5 for bug-guix@gnu.org; Wed, 08 May 2019 22:17:05 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40 autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hOYcG-0002zH-DE for bug-guix@gnu.org; Wed, 08 May 2019 22:17:02 -0400 Received: from mail-it1-x134.google.com ([2607:f8b0:4864:20::134]:37597) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hOYcD-0002vY-Qv for bug-guix@gnu.org; Wed, 08 May 2019 22:16:58 -0400 Received: by mail-it1-x134.google.com with SMTP id l7so937623ite.2 for ; Wed, 08 May 2019 19:16:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cune-org.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:user-agent:mime-version; bh=Z6WWmlK5KT557pS4KSY0QfWxKw+uPEbd6bsQ1N36MhM=; b=kmhpkV3D0hC1nFWYpb9oyuiv5rS9MaPNosFMqVCaLW57Nbv+FkAHG8JwUE1YJTHoNC M4HsmWeKe3UO9DP0FlhxzAyk2jzj2V1MxNlE6x/vv2trZkAAs6e03FHm7KlV1BTB5Ozc erKL/yxl1qFZWmWc5NY/kz8YecyAIXfcwZZXlfUFrAy8VmKvNZL93E9TP3XI9o/d58GL r+A3AbPWFjpdYnaHWLCziytSmdqwaHLGJRGfdU3HRCm7gFl+RU1TwgPcPsT3hYqLUTtl XGLsztSp+49JCPF66ACZWJu6RfQQwbG1I4/XsvfnGojf4FJ9bKNbnuLTVqmE+fYc+jhP cgNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:user-agent :mime-version; bh=Z6WWmlK5KT557pS4KSY0QfWxKw+uPEbd6bsQ1N36MhM=; b=JYPDA4QqK79mcsZMnUBuBLXGtkGodZBOJ7Pu8DCsj92nrUtw1x9A9TCeMMfJDQXp5Y /pYIttww1OvoMz8gDWsBX2/A1sFCm17oVnUd6ooeBip9pwXry9QZZFEXkn3A5k5Lv5+/ mJjBLB5aiSFHIOzJqJnHFBkB7U6xyyJiIItoAZm5okTDoinjducz//sMKFsojLw7CcZJ OKl64EJNeCyzHTLbmNsU7sS0zh7sU8prxfpcLGcWZIIbCC21VyBc8y7iJ9yOJGJaIFuw I45dmAAxCfDUMubnc7xsLAF7G9aWQA4VXYvtKfTkBQDubJTPSWK/qXAFie2MZ9IX8q1l lvxw== X-Gm-Message-State: APjAAAUJ622n+S7fdsyBniM2GGgILaXaADCJJ31g+po/xIxHPGna2nTS tU0hFPElRYvYD8ZR6ygy2bHGr3Kfsa7iSQ== X-Google-Smtp-Source: APXvYqysY3ci8FA89N7WUFIA/4w7vaUpUOSa0NTXO86dBrpxted7ogPB58K9N7J/jasrVQTfoH1d+A== X-Received: by 2002:a24:6b92:: with SMTP id v140mr958889itc.161.1557368213516; Wed, 08 May 2019 19:16:53 -0700 (PDT) Received: from GuixPotato ([208.89.170.37]) by smtp.gmail.com with ESMTPSA id b12sm375955ioq.31.2019.05.08.19.16.52 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 May 2019 19:16:52 -0700 (PDT) From: Caleb Ristvedt To: bug-guix@gnu.org Subject: emacs module support doesn't work Date: Wed, 08 May 2019 21:16:48 -0500 Message-ID: <87o94cid7z.fsf@cune.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::134 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) While attempting to package libegit2 (https://github.com/magit/libegit2), I found that any attempt at loading a dynamic module from emacs would seemingly work (it returns t), but not actually work: no module api functions invoked from C seem to have any effect, including defining functions and printing messages. Here's an example ------------------------------- #include #include #include int plugin_is_GPL_compatible; static emacs_value hello(emacs_env *env, ptrdiff_t nargs, emacs_value args[], void *data) { const char str[] = "Hello Emacs"; return env->make_string(env, str, sizeof(str) - 1); } /* Module init function. */ int emacs_module_init(struct emacs_runtime *ert) { emacs_env *env = ert->get_environment(ert); emacs_value hellofn = env->make_function(env, 0, 0, hello, "return hello string", NULL); // Bind NAME to FUN. // (defalias 'hello-c '(lambda () "Hello Emacs")) emacs_value defalias_sym = env->intern(env, "defalias"); emacs_value hello_sym = env->intern(env, "hello-c"); emacs_value defalias_args[] = { hello_sym, hellofn }; env->funcall(env, defalias_sym, 2, defalias_args); // Provide FEATURE to Emacs. // (provide 'hello-core) emacs_value feature_sym = env->intern(env, "hello-module"); emacs_value provide_sym = env->intern(env, "provide"); emacs_value provide_args[] = { feature_sym }; env->funcall(env, provide_sym, 1, provide_args); char message[] = "TEST MESSAGE!"; emacs_value message_str = env->make_string(env, message, sizeof(message) - 1); emacs_value message_sym = env->intern(env, "message"); emacs_value message_args[] = {message_str}; // spam a bit just to be sure env->funcall(env, message_sym, 1, message_args); env->funcall(env, message_sym, 1, message_args); env->funcall(env, message_sym, 1, message_args); return 0; } ------------------------------- Assuming the above file is named emacs-module-test.c: ------------------------------- $ gcc -fPIC -shared emacs-module-test.c -o hello-module.so $ emacs -Q -L . --batch -l hello-module --eval "(message (hello-c))" => Symbol's function definition is void: hello-c ------------------------------- As far as I can tell, this should work. Our emacs is built with '--with-modules', and 'MODULES' is in system-configuration-features. Any idea what's going wrong? - reepca ------------=_1584731222-26989-1--