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

Commit 67fdfe7

Browse files
author
polyzen
committed
upgpkg: rust-analyzer 20221114-2: Use /usr/lib
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
1 parent 4c38849 commit 67fdfe7

File tree

2 files changed

+46
-3
lines changed

2 files changed

+46
-3
lines changed

rust-analyzer/trunk/PKGBUILD

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,23 @@
44
pkgname=rust-analyzer
55
_pkgver=2022-11-14
66
pkgver=${_pkgver//-}
7-
pkgrel=1
7+
pkgrel=2
88
pkgdesc='Rust compiler front-end for IDEs'
99
arch=('x86_64')
1010
url=https://rust-analyzer.github.io/
1111
license=('Apache' 'MIT')
1212
depends=('gcc-libs' 'rust-src')
1313
makedepends=('git')
14-
source=("git+https://github.com/rust-lang/$pkgname.git#tag=$_pkgver")
15-
b2sums=('SKIP')
14+
source=("git+https://github.com/rust-lang/$pkgname.git#tag=$_pkgver"
15+
'rust-analyzer-fix_unsupportedabi.patch')
16+
b2sums=('SKIP'
17+
'cda286154536f73b7f069d352b7010819d722e14448f2581ea1c4911c7dba667daebf95f2d98f680c85667502cc6de1fb2d11194a74ff7325e91897a25273018')
1618

1719
prepare() {
1820
cd $pkgname
1921
cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
22+
23+
patch --forward --strip=1 --input=../rust-analyzer-fix_unsupportedabi.patch
2024
}
2125

2226
build() {
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
From 84837229b441cee84391f5f26594f9642b439208 Mon Sep 17 00:00:00 2001
2+
From: Akatsuki Rui <[email protected]>
3+
Date: Tue, 15 Nov 2022 01:18:25 +0800
4+
Subject: [PATCH] fix: UnsupportedABI on Arch Linux
5+
6+
---
7+
crates/rust-analyzer/src/cli/load_cargo.rs | 2 +-
8+
crates/rust-analyzer/src/reload.rs | 2 +-
9+
2 files changed, 2 insertions(+), 2 deletions(-)
10+
11+
diff --git a/crates/rust-analyzer/src/cli/load_cargo.rs b/crates/rust-analyzer/src/cli/load_cargo.rs
12+
index 5dba545b8..befaeb9e7 100644
13+
--- a/crates/rust-analyzer/src/cli/load_cargo.rs
14+
+++ b/crates/rust-analyzer/src/cli/load_cargo.rs
15+
@@ -69,7 +69,7 @@ pub fn load_workspace(
16+
if let Some(sysroot) = sysroot.as_ref() {
17+
let standalone_server_name =
18+
format!("rust-analyzer-proc-macro-srv{}", std::env::consts::EXE_SUFFIX);
19+
- let server_path = sysroot.root().join("libexec").join(&standalone_server_name);
20+
+ let server_path = sysroot.root().join("lib").join(&standalone_server_name);
21+
if std::fs::metadata(&server_path).is_ok() {
22+
path = server_path;
23+
args = vec![];
24+
diff --git a/crates/rust-analyzer/src/reload.rs b/crates/rust-analyzer/src/reload.rs
25+
index aa0510a4e..097684295 100644
26+
--- a/crates/rust-analyzer/src/reload.rs
27+
+++ b/crates/rust-analyzer/src/reload.rs
28+
@@ -329,7 +329,7 @@ impl GlobalState {
29+
if let Some(sysroot) = sysroot.as_ref() {
30+
let server_path = sysroot
31+
.root()
32+
- .join("libexec")
33+
+ .join("lib")
34+
.join(&standalone_server_name);
35+
if std::fs::metadata(&server_path).is_ok() {
36+
tracing::debug!(
37+
--
38+
2.38.1
39+

0 commit comments

Comments
 (0)