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

LLVM missing error when running VSCode-extension #829

Open
styrix560 opened this issue Dec 7, 2023 · 5 comments
Open

LLVM missing error when running VSCode-extension #829

styrix560 opened this issue Dec 7, 2023 · 5 comments
Assignees
Labels
os-windows Operating System: Windows P: Compiler: CLI Package: Candy's command-line interface P: Compiler: Inkwell Backend Package: Inkwell Compiler Backend producing native code via LLVM T: Fix Type: Bug Fixes

Comments

@styrix560
Copy link
Collaborator

styrix560 commented Dec 7, 2023

I regularly get an error, that LLVM is missing when trying to run the VSCode extension. After it crashes 3 times in 5 minutes, the extension cannot be restarted due to the following compile error:

error: No suitable version of LLVM was found system-wide or pointed
              to by LLVM_SYS_150_PREFIX.
       
              Consider using `llvmenv` to compile an appropriate copy of LLVM, and
              refer to the llvm-sys documentation for more information.
       
              llvm-sys: https://crates.io/crates/llvm-sys
              llvmenv: https://crates.io/crates/llvmenv
   --> [user_dir]\.cargo\registry\src\index.crates.io-6f17d22bba15001f\llvm-sys-150.1.2\src\lib.rs:489:1
    |
489 | / std::compile_error!(concat!(
490 | |     "No suitable version of LLVM was found system-wide or pointed
491 | |        to by LLVM_SYS_",
492 | |     env!("CARGO_PKG_VERSION_MAJOR"),
...   |
499 | |        llvmenv: https://crates.io/crates/llvmenv"
500 | | ));
    | |__^

Meanwhile clearing the cargo-cache (with the cargo-cache extension and cargo-cache -a) enables the extension to run again until the next crash happens.

My cargo version is cargo 1.76.0-nightly (623b78849 2023-12-02) and my OS is Windows 10.

The error also occurs on my second windows-machine.

@styrix560 styrix560 added the T: Fix Type: Bug Fixes label Dec 7, 2023
@ctiedt ctiedt added P: Compiler: CLI Package: Candy's command-line interface P: Compiler: Inkwell Backend Package: Inkwell Compiler Backend producing native code via LLVM os-windows Operating System: Windows labels Dec 7, 2023
@ctiedt ctiedt self-assigned this Dec 7, 2023
@ctiedt
Copy link
Collaborator

ctiedt commented Dec 7, 2023

I don't have a Windows machine to test this on right now, but the inkwell backend is not supported on Windows yet. I'll see if I can reproduce the issue the next time I'm on a Windows machine. My guess is that for some reason the inkwell feature is active (it should be deactivated by default because of the limited platform support), so the language server fails to compile leading the extension to throw errors.

@styrix560
Copy link
Collaborator Author

Well that's the odd thing. It does compile the first time (or at least it doesn't throw an error), but after that the compile error is thrown. Maybe I could manually disable the inkwell feature? Alternatively, I also have WSL installed if that helps.

@skyz1
Copy link
Collaborator

skyz1 commented Dec 29, 2023

I was facing the same issue when the inkwell backend was introduced. To solve it I compiled LLVM myself and set the environment variable.

@styrix560
Copy link
Collaborator Author

Yes, I will probably do that. However, nobody can realistically expect users to perform a full LLVM-installation.

@JonasWanke
Copy link
Member

@ctiedt just started working on a new native backend based on Cranelift, which is written in pure Rust and is smaller than LLVM. (I created #886 to track this.) We're not yet sure about what we're going to do with the Inkwell/LLVM-based backend:

  • keep it (and make it feature-complete) for, e.g., optimized release builds since the code it produces is generally faster than that of Cranelift but compile times are longer
  • delete it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
os-windows Operating System: Windows P: Compiler: CLI Package: Candy's command-line interface P: Compiler: Inkwell Backend Package: Inkwell Compiler Backend producing native code via LLVM T: Fix Type: Bug Fixes
Projects
Status: No status
Development

No branches or pull requests

4 participants