Skip to content

Rust can't incrementally compile project over remote file system [Internal Compiler Error] #75411

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

Closed
slightknack opened this issue Aug 11, 2020 · 2 comments
Labels
A-incr-comp Area: Incremental compilation C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@slightknack
Copy link

slightknack commented Aug 11, 2020

After setting up a NAS device (exfat over smb via RPI3), Rust has trouble compiling any project stored on that device. This isn't so much a problem with the Rust compiler as it is with my awkward NAS setup.

Here's an ascii diagram to illustrate:

+----------------+ +-------------+
| local computer | | NAS         |
+----------------+ +-------------+
| compiler <-------- source code |
|  | ^           | |             | 
|  | |           | |             | 
|  | +-------------> /target     |
|  v             | |  |          |
| binary <------------+          |
|  |             | +-------------+  
|  v             |
| run            |
+----------------+

The idea is that the source code is hosted on the NAS (slow but lots of storage), and compiled/run on the local machine (fast but less storage).

The main driver of the error is simple: Rust is unable to 'create [a] session directory lock file' due to os error 45. After some quick digging, it appears that this error primarily occurs when a device is not connected and access is attempted (which is not the case here - the device is connected, albeit over a network).

I primarily believe that this error is occurring due to the limitations of the smb protocol (and not due to the fact that this drive is formated as exfat; if the device is physically connected, Rust code compiles fine). This error also seems to occur in relation to incremental builds, though that may simply be because that is what the compiler checks for first.

I could just disable incremental compilation - while fixing the error, it still does not fix incremental compilation over remote file systems. I'm pretty sure this issue is fairly unique, but if there is already an issue that discusses this particular topic, please just ignore this one.

Thank you in advance for any help 😄.

Code

Anything and everything - the compiler will not start compiling.

Meta

rustc --version --verbose:

rustc 1.45.2 (d3fb005a3 2020-07-31)
binary: rustc
commit-hash: d3fb005a39e62501b8b0b356166e515ae24e2e54
commit-date: 2020-07-31
host: x86_64-apple-darwin
release: 1.45.2
LLVM version: 10.0

Error output

cargo run --verbose

   Compiling error v0.1.0 (/Volumes/drive/repos/error)
     Running `rustc --crate-name error --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -Cembed-bitcode=no -C debuginfo=2 -C metadata=75b64579dca9fefb --out-dir /Volumes/drive/Repos/error/target/debug/deps -C incremental=/Volumes/drive/Repos/error/target/debug/incremental -L dependency=/Volumes/drive/Repos/error/target/debug/deps`
error: incremental compilation: could not create session directory lock file: Operation not supported (os error 45)

thread 'rustc' panicked at 'trying to get session directory from `IncrCompSession`: NotInitialized', src/librustc_session/session.rs:840:48
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.45.2 (d3fb005a3 2020-07-31) running on x86_64-apple-darwin

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type bin

note: some of the compiler flags provided by cargo are hidden

error: aborting due to previous error

error: could not compile `error`.

Caused by:
  process didn't exit successfully: `rustc --crate-name error --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -Cembed-bitcode=no -C debuginfo=2 -C metadata=75b64579dca9fefb --out-dir /Volumes/drive/Repos/Veritable/error/target/debug/deps -C incremental=/Volumes/drive/Repos/Veritable/error/target/debug/incremental -L dependency=/Volumes/drive/Repos/Veritable/error/target/debug/deps` (exit code: 101)
Backtrace

No backtrace, even when RUST_BACKTRACE=1 is set.

@slightknack slightknack added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 11, 2020
@jonas-schievink jonas-schievink added the A-incr-comp Area: Incremental compilation label Aug 11, 2020
@the8472
Copy link
Member

the8472 commented Aug 11, 2020

running it under strace to see which syscall fails might be helpful.

@nagisa
Copy link
Member

nagisa commented Aug 13, 2020

File locking support is required as thus running compilers on most network file systems won't work.

Duplicate of #56976

(picked randomly out of many others on this list)

Feel free to complain if you disagree with the evaluation.

@nagisa nagisa closed this as completed Aug 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-incr-comp Area: Incremental compilation C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants