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

Rust: couldn't create a temp dir: Operation not permitted #2043

Open
4 tasks done
lambdasierra opened this issue Nov 12, 2023 · 1 comment
Open
4 tasks done

Rust: couldn't create a temp dir: Operation not permitted #2043

lambdasierra opened this issue Nov 12, 2023 · 1 comment

Comments

@lambdasierra
Copy link

lambdasierra commented Nov 12, 2023

Checklist

Bug description

When running Flycheck on a Rust source file, an error message like the following is displayed in the minibuffer:

couldn't create a temp dir: Operation not permitted (os error 1) at path "/dev/rmetaG2wOVY"

In Rust versions 1.64.0 and later, rustc -o /dev/null fails when it tries to create temporary files in the /dev directory; see rust-lang/rust#111157

Flycheck uses -o /dev/null to avoid creating binaries when checking, reported in #1497 and fixed in #1501.

Steps to reproduce

  • Install Rust 1.64.0 or later

  • Create a file named main.rs with the following contents:

fn main() {
    println!("Hello, world!");
}
  • Launch Emacs with emacs -Q

  • Evaluate the following in the *scratch* buffer:

(require 'package)

(add-to-list 'package-archives
             '("MELPA Stable" . "https://stable.melpa.org/packages/") t)

(package-refresh-contents)

(package-install 'rust-mode)

(package-install 'flycheck)

(global-flycheck-mode)
  • Open the file main.rs in Emacs

  • The minibuffer shows an error message like the following.

couldn't create a temp dir: Operation not permitted (os error 1) at path "/dev/rmetaG2wOVY"

System configuration

Syntax checkers for buffer main.rs in rust-mode:

First checker to run:

  rust
    - may enable: yes
    - predicate:  t
    - executable: Found at /opt/homebrew/bin/rustc

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

  rust-cargo (disabled)
    - may enable:  Automatically disabled!
    - predicate:   t
    - executable:  Found at /opt/homebrew/bin/cargo
    - Cargo.toml:  Missing
    - Crate type:  lib
    - Binary name: Not required

  rust-clippy (disabled)
    - may enable: Automatically disabled!
    - predicate:  t
    - executable: Found at /opt/homebrew/bin/cargo
    - Clippy:     Cannot find the `cargo clippy' command
    - Cargo.toml: Missing

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

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

Flycheck version: 32
Emacs version:    29.1
System:           aarch64-apple-darwin21.6.0
Window system:    ns

Emacs configuration:

  • Plain Emacs / Custom configuration

Additional notes

This doesn't happen every time Flycheck runs. For example, creating a new file and running flycheck-buffer does not trigger it. I can consistently reproduce it by opening a Rust source file that already exists.

@bbatsov
Copy link
Contributor

bbatsov commented Feb 11, 2024

@flycheck/rust Can someone take a look?

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

2 participants