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 in flycheck-rust-setup: (json-end-of-file) #86

Open
LeGuipo opened this issue Apr 1, 2023 · 0 comments
Open

Error in flycheck-rust-setup: (json-end-of-file) #86

LeGuipo opened this issue Apr 1, 2023 · 0 comments

Comments

@LeGuipo
Copy link

LeGuipo commented Apr 1, 2023

Because cargo clippy is not included in my distribution’s outdated packages, I decided to install the rust suite via rustup.
Everything about using rust work fine, including clippy, but now flycheck can’t initialize anymore the rust checkers, throwing the message Error in flycheck-rust-setup: (json-end-of-file) after opening a rust project source file.

  • Here is the output of the flycheck-verify-setup :
Syntax checkers for buffer main.rs in rust-mode:

No checker to run in this buffer.

Checkers that are compatible with this mode, but will not run until properly configured:

  rust-cargo (manually disabled) enable
    - may enable:  yes
    - may run:     t
    - executable:  Found at /opt/cargo/bin/cargo
    - Cargo.toml:  Found
    - Crate type:  lib
    - Binary name: Not required

  rust (manually disabled) enable
    - may enable: yes
    - may run:    t
    - executable: Found at /opt/cargo/bin/rustc

  rust-clippy (automatically disabled) reset
    - may enable: no
    - may run:    t
    - executable: Found at /opt/cargo/bin/cargo
    - Clippy:     Cannot find the `cargo clippy' command
    - Cargo.toml: Found

Flycheck Mode is enabled.  Use C-u C-c ! x to enable disabled
checkers.

--------------------

Flycheck version: 33snapshot (package: 20230306.414)
Emacs version:    27.1
System:           aarch64-unknown-linux-gnu
Window system:    x
  • $PATH = /home/user1/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games:/opt/cargo/bin
  • $RUSTUP_HOME = /opt/rustup
  • $CARGO_HOME = /opt/cargo
  • My init.el part setting up flycheck :
;; FLYCHECK
(add-hook 'after-init-hook #'global-flycheck-mode)
(with-eval-after-load 'rust-mode
  (add-hook 'flycheck-mode-hook #'flycheck-rust-setup)
  (setq-default flycheck-disabled-checkers '(rust-cargo rust))
  (setq-default flycheck-rust-checker 'rust-clippy))

I have no clue how to fix this… It’s like the distribution packages include some additional tweaks to make it work, not rustup.

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

1 participant