summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--posts/install-rust-analyzer-on-openbsd-current.md15
1 files changed, 15 insertions, 0 deletions
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
+
Generated by cgit. See skreutz.com for my tech blog and contact information.