GNU bug report logs - #40099
28.0.50; [feature/native-comp] Different working dir of .eln files is not expected by pdf-tools

Previous Next

Package: emacs;

Reported by: Ihor Radchenko <yantar92 <at> gmail.com>

Date: Tue, 17 Mar 2020 06:35:02 UTC

Severity: normal

Found in version 28.0.50

Done: Andrea Corallo <akrl <at> sdf.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ihor Radchenko <yantar92 <at> gmail.com>
To: Andrea Corallo <akrl <at> sdf.org>
Cc: 40099 <at> debbugs.gnu.org
Subject: bug#40099: 28.0.50; [feature/native-comp] Different working dir of .eln files is not expected by pdf-tools
Date: Wed, 18 Mar 2020 20:37:42 +0800
> Could I have exact instructions to preproduce it?

1. Install pdf-tools and compile .elc
2. Run (native-compile-async "/path/to/pdf-tools/" t)
3. Restart emacs
4. Load pdf-tools and run (pdf-tools-install)

> I'm not into pdf-tools but I think the trouble could be that its "make
> build" does something different in terms of compilation that what
> `native-compile' does.  I suspect it's not a load path problem.

pdf-tools does not even get to the point where it invokes make.
The backtrace is:

Debugger entered--Lisp error: (wrong-type-argument (and (not null) file-directory) nil build-directory)
  (pdf-tools-build-server "/home/yantar92/.emacs.d/straight/build/pdf-tools/eln-x86_64-pc-linux-gnu-85c5ba0bf5e77f42/" nil nil #f(compiled-function (executable) #<bytecode 0x1442895ca862f2c6>))
  (pdf-tools-install)

I checked the source code to get a clue where the directory argument is
coming from. Here is relevant code:

(defconst pdf-tools-directory
  (or (and load-file-name
           (file-name-directory load-file-name))
      default-directory)
  "The directory from where this library was first loaded.")

The value of pdf-tools-directory is
"/home/yantar92/.emacs.d/straight/build/pdf-tools/eln-x86_64-pc-linux-gnu-85c5ba0bf5e77f42/".
It makes sense considering that it takes the value of load-file-name,
which is probably set to where .eln file is located. However, pdf-tools
does not expect the location of the loaded file to be different from the
package dir.

Hope it helps.

Best regards,
Ihor


Andrea Corallo <akrl <at> sdf.org> writes:

> Ihor Radchenko <yantar92 <at> gmail.com> writes:
>
>> After native-compiling pdf-tools, the loaded files failed to find some
>> files required for the package to work. 
>>
>> Specifically, pdf-tools tried to rebuild the epdfinfo, which is usually
>> done by running make on "build" directory in the same folder with
>> pdf-tools.el and failed because pdf-tools.eln is located in different
>> directory. The working directory for pdf-tools.eln seems to be
>> ./eln-x86_64-pc-linux-gnu-85c5ba0bf5e77f42/ and does not contain
>> "build".
>>
>> I guess that it would make sense to set working directory to be same
>> when loading .el, .elc, and .eln.
>>
>> Best,
>> Ihor
>
> I'm not into pdf-tools but I think the trouble could be that its "make
> build" does something different in terms of compilation that what
> `native-compile' does.  I suspect it's not a load path problem.
>
> Here it's hard to say something without more informations.
>
> Could I have exact instructions to preproduce it?
>
> Thanks
>
>   Andrea
>
> -- 
> akrl <at> sdf.org

-- 
Ihor Radchenko,
PhD,
Center for Advancing Materials Performance from the Nanoscale (CAMP-nano)
State Key Laboratory for Mechanical Behavior of Materials, Xi'an Jiaotong University, Xi'an, China
Email: yantar92 <at> gmail.com, ihor_radchenko <at> alumni.sutd.edu.sg




This bug report was last modified 5 years and 43 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.