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

Compiling/Installing error: No such file or directory, treesit #520

Closed
KDr2 opened this issue Feb 27, 2024 · 8 comments
Closed

Compiling/Installing error: No such file or directory, treesit #520

KDr2 opened this issue Feb 27, 2024 · 8 comments

Comments

@KDr2
Copy link

KDr2 commented Feb 27, 2024

  • OS: Linux (Ubuntu 22.04)
  • Emacs Version: 28.2

I got an error while installing rust-mode:

$HOME/.emacs.d/elpa/rust-mode-20240225.526/rust-mode-treesitter.el at Tue Feb 27 21:04:29 2024
rust-mode-treesitter.el:9:1:Error: Cannot open load file: No such file or directory, treesit

it's caused by this line: https://github.com/rust-lang/rust-mode/blob/master/rust-mode-treesitter.el#L9.

The problem doesn't exist in Emacs 29.1.

Does anyone know how to fix this? Thank you.

@psibi
Copy link
Member

psibi commented Feb 27, 2024

How does your rust-mode configuration look like ?

@psibi
Copy link
Member

psibi commented Feb 27, 2024

Although the error is surprising since that code should not get evaluated for older emacs:

(require 'rust-mode-treesitter)

@KDr2
Copy link
Author

KDr2 commented Feb 27, 2024

I started emacs with emacs -q and ran the code below manually:

(require 'package)
(add-to-list 'package-archives
             '("melpa" . "https://melpa.org/packages/") t)
(package-initialize)
(package-refresh-contents)
(package-install 'rust-mode)

Then the error occurred.

@KDr2
Copy link
Author

KDr2 commented Feb 27, 2024

The complete log is like this:

Leaving directory ‘$HOME/.emacs.d/elpa/rust-mode-20240225.526’
^L
Compiling file $HOME/.emacs.d/elpa/rust-mode-20240225.526/rust-cargo.el at Tue Feb 27 21:04:29 2024
Entering directory ‘$HOME/.emacs.d/elpa/rust-mode-20240225.526/’
^L
Compiling file $HOME/.emacs.d/elpa/rust-mode-20240225.526/rust-common.el at Tue Feb 27 21:04:29 2024
^L
Compiling file $HOME/.emacs.d/elpa/rust-mode-20240225.526/rust-compile.el at Tue Feb 27 21:04:29 2024
^L
Compiling file $HOME/.emacs.d/elpa/rust-mode-20240225.526/rust-mode-treesitter.el at Tue Feb 27 21:04:29 2024
rust-mode-treesitter.el:9:1:Error: Cannot open load file: No such file or directory, treesit
^L
Compiling file $HOME/.emacs.d/elpa/rust-mode-20240225.526/rust-mode.el at Tue Feb 27 21:04:29 2024
^L
Compiling file $HOME/.emacs.d/elpa/rust-mode-20240225.526/rust-playpen.el at Tue Feb 27 21:04:29 2024
^L
Compiling file $HOME/.emacs.d/elpa/rust-mode-20240225.526/rust-prog-mode.el at Tue Feb 27 21:04:29 2024
^L
Compiling file $HOME/.emacs.d/elpa/rust-mode-20240225.526/rust-rustfmt.el at Tue Feb 27 21:04:29 2024
^L
Compiling file $HOME/.emacs.d/elpa/rust-mode-20240225.526/rust-utils.el at Tue Feb 27 21:04:29 2024

Seems it was compiling but not loading?

@psibi
Copy link
Member

psibi commented Feb 28, 2024

@KDr2 Thanks, that's helpful. Can you test drive this PR to see if it fixes for you: #521 ?

@KDr2
Copy link
Author

KDr2 commented Feb 28, 2024

@psibi It works! Thank you for the quick response. ❤️

@KDr2
Copy link
Author

KDr2 commented Feb 28, 2024

But I am still curious why the CI didn't find this.

@psibi
Copy link
Member

psibi commented Feb 28, 2024

But I am still curious why the CI didn't find this.

Not sure. Probably the ERT mechanism that we use for testing is not good enough ? I would be happy to accept PR's that improve this.

Closing this issue since it has been fixed by #521

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

2 participants