From 9acbe4ba4c335ae5520cacd5f286fd2c044ce8f9 Mon Sep 17 00:00:00 2001 From: Stefan Kreutz Date: Fri, 8 Apr 2022 12:31:12 +0200 Subject: Update rust-analyzer post Point to https://crates.io/crates/ra_ap_rust-analyzer --- posts/install-rust-analyzer-on-openbsd-current.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'posts') diff --git a/posts/install-rust-analyzer-on-openbsd-current.md b/posts/install-rust-analyzer-on-openbsd-current.md index a97f711..32eab56 100644 --- a/posts/install-rust-analyzer-on-openbsd-current.md +++ b/posts/install-rust-analyzer-on-openbsd-current.md @@ -2,6 +2,7 @@ title: "Install rust-analyzer on OpenBSD -current" description: "How to install the language server for Rust from source without rustup." published: 2022-01-04 +updated: 2022-04-08 --- The Rust Programming Language is anything but small. @@ -20,6 +21,7 @@ You might also want to install `rust-clippy` and `rust-rustfmt` while you're at $ doas pkg_add rust rust-clippy rust-rustfmt Second, compile and install the rust-analyzer binary from source. +See errata below if the the command fails. $ cargo install \ --git https://github.com/rust-analyzer/rust-analyzer.git \ @@ -51,3 +53,16 @@ Lastly, tell rust-analyzer where to find the source code. With this, your favorite editor should be able to talk to rust-analyzer and help you find your way. Of course, you better add the above exports to your `~/.profile`. I've also added the above commands to my local update script to keep rustc, rust-analyzer, and the sources in sync. + +## Errata + +Sometimes Cargo fails install from a Git URL due to an incompatible version of libgit2. +If so, you can install the latest weekly release of rust-analyzer from [crates.io](https://crates.io/crates/ra_ap_rust-analyzer) as follows: + + $ cargo install \ + --force \ + --bin rust-analyzer \ + --target-dir "$HOME/.cache/rust-analyzer" \ + --locked \ + ra_ap_rust-analyzer + -- cgit v1.2.3