Date: Monday, November 14, 2022 @ 18:18:29
  Author: polyzen
Revision: 1347533

upgpkg: rust-analyzer 20221114-2: Use /usr/lib

Thanks to Akatsuki Rui (akiirui) for the bug report and patch.

Fixes FS#76568
Upstream issue: https://github.com/rust-lang/rust-analyzer/issues/13589

Added:
  rust-analyzer/trunk/rust-analyzer-fix_unsupportedabi.patch
Modified:
  rust-analyzer/trunk/PKGBUILD

----------------------------------------+
 PKGBUILD                               |   10 +++++--
 rust-analyzer-fix_unsupportedabi.patch |   39 +++++++++++++++++++++++++++++++
 2 files changed, 46 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD    2022-11-14 17:21:16 UTC (rev 1347532)
+++ PKGBUILD    2022-11-14 18:18:29 UTC (rev 1347533)
@@ -4,7 +4,7 @@
 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/
@@ -11,12 +11,16 @@
 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() {

Added: rust-analyzer-fix_unsupportedabi.patch
===================================================================
--- rust-analyzer-fix_unsupportedabi.patch                              (rev 0)
+++ rust-analyzer-fix_unsupportedabi.patch      2022-11-14 18:18:29 UTC (rev 
1347533)
@@ -0,0 +1,39 @@
+From 84837229b441cee84391f5f26594f9642b439208 Mon Sep 17 00:00:00 2001
+From: Akatsuki Rui <[email protected]>
+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
+

Reply via email to