Skip to content
This repository has been archived by the owner on May 20, 2023. It is now read-only.

Commit

Permalink
upgpkg: rust-analyzer 20221114-2: Use /usr/lib
Browse files Browse the repository at this point in the history
Thanks to Akatsuki Rui (akiirui) for the bug report and patch.

Fixes FS#76568
Upstream issue: rust-lang/rust-analyzer#13589

git-svn-id: file:///srv/repos/svn-community/svn@1347533 9fca08f4-af9d-4005-b8df-a31f2cc04f65
  • Loading branch information
polyzen authored and svntogit committed Nov 14, 2022
1 parent 45ddb84 commit 53ae631
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 3 deletions.
10 changes: 7 additions & 3 deletions trunk/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,23 @@
pkgname=rust-analyzer
_pkgver=2022-11-14
pkgver=${_pkgver//-}
pkgrel=1
pkgrel=2
pkgdesc='Rust compiler front-end for IDEs'
arch=('x86_64')
url=https://rust-analyzer.github.io/
license=('Apache' 'MIT')
depends=('gcc-libs' 'rust-src')
makedepends=('git')
source=("git+https://github.com/rust-lang/$pkgname.git#tag=$_pkgver")
b2sums=('SKIP')
source=("git+https://github.com/rust-lang/$pkgname.git#tag=$_pkgver"
'rust-analyzer-fix_unsupportedabi.patch')
b2sums=('SKIP'
'cda286154536f73b7f069d352b7010819d722e14448f2581ea1c4911c7dba667daebf95f2d98f680c85667502cc6de1fb2d11194a74ff7325e91897a25273018')

prepare() {
cd $pkgname
cargo fetch --locked --target "$CARCH-unknown-linux-gnu"

patch --forward --strip=1 --input=../rust-analyzer-fix_unsupportedabi.patch
}

build() {
Expand Down
39 changes: 39 additions & 0 deletions trunk/rust-analyzer-fix_unsupportedabi.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
From 84837229b441cee84391f5f26594f9642b439208 Mon Sep 17 00:00:00 2001
From: Akatsuki Rui <3736910+akiirui@users.noreply.github.com>
Date: Tue, 15 Nov 2022 01:18:25 +0800
Subject: [PATCH] fix: UnsupportedABI on Arch Linux

---
crates/rust-analyzer/src/cli/load_cargo.rs | 2 +-
crates/rust-analyzer/src/reload.rs | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/crates/rust-analyzer/src/cli/load_cargo.rs b/crates/rust-analyzer/src/cli/load_cargo.rs
index 5dba545b8..befaeb9e7 100644
--- a/crates/rust-analyzer/src/cli/load_cargo.rs
+++ b/crates/rust-analyzer/src/cli/load_cargo.rs
@@ -69,7 +69,7 @@ pub fn load_workspace(
if let Some(sysroot) = sysroot.as_ref() {
let standalone_server_name =
format!("rust-analyzer-proc-macro-srv{}", std::env::consts::EXE_SUFFIX);
- let server_path = sysroot.root().join("libexec").join(&standalone_server_name);
+ let server_path = sysroot.root().join("lib").join(&standalone_server_name);
if std::fs::metadata(&server_path).is_ok() {
path = server_path;
args = vec![];
diff --git a/crates/rust-analyzer/src/reload.rs b/crates/rust-analyzer/src/reload.rs
index aa0510a4e..097684295 100644
--- a/crates/rust-analyzer/src/reload.rs
+++ b/crates/rust-analyzer/src/reload.rs
@@ -329,7 +329,7 @@ impl GlobalState {
if let Some(sysroot) = sysroot.as_ref() {
let server_path = sysroot
.root()
- .join("libexec")
+ .join("lib")
.join(&standalone_server_name);
if std::fs::metadata(&server_path).is_ok() {
tracing::debug!(
--
2.38.1

0 comments on commit 53ae631

Please sign in to comment.