Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pdf-tools doesn't build epdfinfo binary #33296

Closed
pmiddend opened this issue Jan 1, 2018 · 11 comments
Closed

pdf-tools doesn't build epdfinfo binary #33296

pmiddend opened this issue Jan 1, 2018 · 11 comments

Comments

@pmiddend
Copy link
Contributor

pmiddend commented Jan 1, 2018

Issue description

With my emacs configuration:

  ((emacsPackagesNgGen emacs).emacsWithPackages (epkgs: [
    epkgs.elpaPackages.exwm
    epkgs.melpaPackages.counsel-projectile
    epkgs.melpaPackages.general
    epkgs.melpaPackages.nix-sandbox
    epkgs.melpaStablePackages.counsel
    epkgs.melpaStablePackages.emojify
    epkgs.melpaStablePackages.evil
    epkgs.melpaStablePackages.evil-escape
    epkgs.melpaStablePackages.evil-magit
    epkgs.melpaStablePackages.evil-surround
    epkgs.melpaStablePackages.eyebrowse
    epkgs.melpaStablePackages.flycheck-haskell
    epkgs.melpaStablePackages.haskell-mode
    epkgs.melpaStablePackages.magit
    epkgs.melpaStablePackages.markdown-mode
    epkgs.melpaStablePackages.nix-mode
    epkgs.melpaStablePackages.nixos-options
    epkgs.melpaStablePackages.pdf-tools
    epkgs.melpaStablePackages.projectile
    epkgs.melpaStablePackages.py-autopep8
    epkgs.melpaStablePackages.smart-mode-line
    epkgs.melpaStablePackages.typo
    epkgs.melpaStablePackages.weechat
    epkgs.melpaStablePackages.yaml-mode
    ]))

I get an emacs-pdf-tools directory under /nix/store, but his doesn't contain the necessary epdfinfo binary.

Steps to reproduce

See above.

Technical details

  • system: "x86_64-linux"
  • host os: Linux 4.9.71, NixOS, 18.03pre123588.ade98dc442e (Impala)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 1.11.16
  • channels(root): "nixos-18.03pre123588.ade98dc442e"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs
@mdorman
Copy link
Contributor

mdorman commented Jan 7, 2018

So I use a different strategy; I'm not sure why it works and yours doesn't.

Reducing it to its bare minimum, I would summarize your strategy as:

nix-shell --packages 'emacsWithPackages (p: with p.melpaStablePackages; [pdf-tools])'

If you then do cat $(which emacs), and do a find on the $EMACSLOADPATH, you won't find a epdfinfo binary (you will find its source, though).

However, for my own use, I maintain an overlay for my emacs stuff. If I reduce it down to the simplest thing I can, I end up with the just slightly different:

nix-shell --packages 'emacsPackagesNg.emacsWithPackages (self: (with self; [pdf-tools]))'

and do the equivalent investigation, I've got a epdfinfo binary.

I just flat-out don't know the nix language (or the functions in question) well enough to understand the subtle difference here. All I can tell you is that one works and the other doesn't.

@ttuegel I think you're the original author. Do you perhaps have any insight?

@ttuegel
Copy link
Member

ttuegel commented Jan 7, 2018

I think you're the original author. Do you perhaps have any insight?

I'm really not sure. I would start by comparing the output of nix-build -A emacsPackagesNg.pdf-tools and nix-build -A emacsPackagesNg.melpaStablePackages.pdf-tools.

@oxij
Copy link
Member

oxij commented Jan 7, 2018 via email

@ttuegel
Copy link
Member

ttuegel commented Jan 8, 2018

I don't think this is easily fixable in the generator. I would just override melpaPackages.pdf-tools with a part of the expression from emacs-packages.nix.

Yep, that's what the overrides are for. I don't want the generator to worry much about anything besides fetching packages and identifying dependencies.

@spacefrogg
Copy link
Contributor

I just had a similar issue with cask. Using emacsPackagesNg.cask failed to install cask's bin directory. Investigation with nix-shell ... -A emacsPackagesNg.cask showed that the installPhase, which is defined in pkgs/applications/editors/emacs-modes/cask/default.nix, was actually not used but some other phase definition that looked like a general expression tailored to emacs packages.

I had to use emacsPackages.cask to achieve what I want.

So, I suspect that emacsPackagesNg does something non-obvious.

@adisbladis
Copy link
Member

This issue has been fixed as a part of #65874

@ttuegel ttuegel closed this as completed Aug 5, 2019
@Narice
Copy link
Contributor

Narice commented Jul 5, 2021

Is this issue really resolved as of now?
I am having trouble installing pdf-tools, I keep getting: "pdf-info-epdfinfo-program is not executable".
what should be the value of this variable? I don't have the epdfinfo command in the terminal.

@adisbladis
Copy link
Member

adisbladis commented Jul 5, 2021

You should use withPackages as explained in https://nixos.org/manual/nixpkgs/stable/#sec-emacs-config.

epdfinfo should not be available in your terminal, but properly set up by the wrapper.

@Narice
Copy link
Contributor

Narice commented Jul 5, 2021

so the NixOS way of doing things doesn't work? https://nixos.org/manual/nixos/stable/index.html#module-services-emacs-adding-packages
I think that is the way used by home-manager:
https://github.com/nix-community/home-manager/blob/97d183e2e466808f5d7cd1c838815bedd88f37fe/modules/programs/emacs.nix#L11-L14

I just changed the way I did things and the effect is really different so I'm suspecting the result to be different as well!
In the case that it succeeds, should both the NixOS manual and the home-manager module get updated?
(I'm using the native comp build so it will take a while to build)

@Narice
Copy link
Contributor

Narice commented Jul 6, 2021

It didn't resolve the issue.
I installed it by hand: politza/pdf-tools#647
I'm pretty sure everything is installed, however, the variable in emacs is probably not pointing to the correct location.
Thus it doesn't detect the program.
@adisbladis Is it possible to know where pdf-tool is installed? Is it packaged with emacs or otherwise?

@Narice
Copy link
Contributor

Narice commented Jul 29, 2021

@adisbladis how did you get pdf-tool working, do you have a config you could share?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants