From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Wrapping an Emacs dynamic module in a package Date: Mon, 17 Oct 2016 12:02:05 +0300 Message-ID: <831szfz6uq.fsf@gnu.org> References: <83h98bzfo5.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1476695150 15819 195.159.176.226 (17 Oct 2016 09:05:50 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 17 Oct 2016 09:05:50 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Oct 17 11:05:40 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bw3rO-0001uJ-7G for geh-help-gnu-emacs@m.gmane.org; Mon, 17 Oct 2016 11:05:30 +0200 Original-Received: from localhost ([::1]:59943 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bw3rQ-0000KV-C0 for geh-help-gnu-emacs@m.gmane.org; Mon, 17 Oct 2016 05:05:32 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41220) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bw3oA-0006wA-V7 for help-gnu-emacs@gnu.org; Mon, 17 Oct 2016 05:02:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bw3o6-00078s-Lz for help-gnu-emacs@gnu.org; Mon, 17 Oct 2016 05:02:10 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41189) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bw3o6-00078o-IY for help-gnu-emacs@gnu.org; Mon, 17 Oct 2016 05:02:06 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4108 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bw3o4-0007xn-VS for help-gnu-emacs@gnu.org; Mon, 17 Oct 2016 05:02:05 -0400 In-reply-to: (message from Joris Vankerschaver on Mon, 17 Oct 2016 09:34:25 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:111546 Archived-At: > From: Joris Vankerschaver > Date: Mon, 17 Oct 2016 09:34:25 +0100 > Cc: help-gnu-emacs@gnu.org > > 1) I wrote an emacs module _mymod.so, as well as wrappers mymod.el (with > some local setup) and mymod-pkg.el (which only has a call to > define-package). > > 2) I tarred these together to form mymod-0.1.tar > > 3) I installed the resulting package using M-x package-install-file > > In my messages buffer, I see that Emacs tries to generate autoloads for the > .so, and fails with the error indicated in the original email ("_mymod.so:0:0: > error: scan-error: (Containing expression ends prematurely 238020 > 238021))"). > > I'm pretty confident that the emacs module is correctly built (I can load > it, and run the functions in it). Also, if I rename _mymod.so to something > else, e.g. _mymod.blablabla, the rest of the package installs correctly and > can be loaded. So it really seems as if Emacs is choking on trying to > generate autoloads for _mymod.so. > > Maybe backtracking a little bit: > > 1) Should Emacs be able to generate autoloads for an .so? No, I don't think so. I think you should have these autoloads in the Lisp part of your package. So I suggest to review your definition of the package that package.el uses to decide which files to scan for autoloads, and perhaps change it to not imply that _mymod.so should be scanned. Caveat: I have never prepared any package using the package.el infrastructure, so I could be wrong in what I write above. Or it could be a bug in package.el, in which case I suggest to report it, including all the details, using "M-x report-emacs-bug RET". Thanks.