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

Error building the server: \r\n line endings and bad interpreter #7

Closed
Phundrak opened this issue Apr 15, 2021 · 4 comments
Closed

Comments

@Phundrak
Copy link

As reported in this PR which will hopefully bring this fork to Spacemacs, I noticed while building the server the following errors:

  • Emacs reports
    /home/phundrak/.emacs.d/elpa/28.0/develop/pdf-tools-20210411.1603/build/server/autobuild -i /home/phundrak/.emacs.d/elpa/28.0/develop/pdf-tools-20210411.1603/
    /usr/bin/sh: /home/phundrak/.emacs.d/elpa/28.0/develop/pdf-tools-20210411.1603/build/server/autobuild: /bin/sh^M: bad interpreter: No such file or directory
    
  • While running directly autobuild from the shell gives the following error:
    Failed to execute process './autobuild'. Reason:
    The file uses windows line endings (\r\n). Run dos2unix or similar to fix it.
    

I see two issues here:

  1. The incorrect line endings
  2. The use of /bin/sh.

Regarding the second issue, I think it would be safer to directly refer the shell to bash and not sh, since the latter can be symlinked to various shells depending on the OS, and not necessarily POSIX-compliant ones. bash on the other hand is present on most UNIX and POSIX systems, including macOS.

I will try to submit a PR soon to fix at least the first issue.

@lebensterben
Copy link

  • You should never use bash. Some system have dash instead of bash.
  • You should never use /bin/sh and always /usr/bin/env sh. /bin is never the standard path according to Linux Filesystem Specification.

@Phundrak
Copy link
Author

Phundrak commented Apr 15, 2021 via email

@vedang
Copy link
Owner

vedang commented Apr 16, 2021

I don't think the line-ending problem is a pdf-tools problem. I'd appreciate it if users of spacemacs could investigate this on their end.

Re: changing the shebang line, I will create a separate issue to track this, I see it as a low hanging fruit and would love to accept a PR for it.

@vedang
Copy link
Owner

vedang commented Apr 16, 2021

I've confirmed that all files in pdf-tools have the correct line endings, and have created an issue to track the #! change. Closing this ticket.

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

No branches or pull requests

3 participants