FS#76568 - [rust-analyzer] Cannot create expander for libserde_derive: UnsupportedABI

Attached to Project: Community Packages
Opened by Akatsuki Rui (akiirui) - Monday, 14 November 2022, 17:35 GMT
Last edited by Daniel M. Capella (polyzen) - Tuesday, 15 November 2022, 21:09 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Daniel M. Capella (polyzen)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

Cannot create expander for libserde_derive: UnsupportedABI

This issue is casued by https://github.com/archlinux/svntogit-packages/commit/381888bfbe5b50c030a2904680b9c03cb39706f6

The package rust has a patch to change path `libexec` to `lib` for Arch Linux, but it breaks some features of rust-analyzer .

Additional info:
* package version(s)

- rust: 1.65.0-1
- rust-analzyer 20221114-1

* link to upstream bug report, if any

- https://github.com/rust-lang/rust-analyzer/issues/13589

Steps to reproduce:

1. install rust and rust-analyzer
2. cargo new bug
3. cd bug
4. cargo add serde --features derive
5. use code to open this project (with extension: rust-analzyer)
6. edit main.rs and see problems outputs

```
use serde::Deserialize;

#[derive(Deserialize)]
enum Name {}

fn main() {
println!("Hello, world!");
}
```

Here have a patch, follow changes of the package rust.

Or waiting for upstream fix this issue, or revert changes of the package rust.
This task depends upon

Closed by  Daniel M. Capella (polyzen)
Tuesday, 15 November 2022, 21:09 GMT
Reason for closing:  Fixed
Additional comments about closing:  20221114-3 https://github.com/archlinux/svntogit-co mmunity/commit/e60584b2baa36a297d4f6ebd4 2bafcecf90462ae
Comment by Jan Alexander Steffens (heftig) - Monday, 14 November 2022, 23:34 GMT
Beware, I think applying this patch will fix use with the `rust` package but will break with `rustup` toolchains. Have you tested this?
Comment by Daniel M. Capella (polyzen) - Monday, 14 November 2022, 23:39 GMT
I have not.
Comment by Jan Alexander Steffens (heftig) - Monday, 14 November 2022, 23:45 GMT
I just did and it does break. I would greatly prefer keeping compatibility with rustup, as 'rust' is primarily used for packaging.

This needs to be fixed by changing the code to check both lib and libexec paths for the proc-macro-srv executable.

BTW, the rust-analyzer package also ships a proc-macro-srv, but this one is in /usr/bin/ and also gets ignored.
Comment by Akatsuki Rui (akiirui) - Tuesday, 15 November 2022, 03:30 GMT
@heftig Yep, it breaks `rustup` toolchains. Sorry, I forget about this.

And I have tested your patch (at https://github.com/rust-lang/rust-analyzer/issues/13589#issuecomment-1314571988)

It's works fine with extra/rust and community/rustup. maybe polyzen can apply this patch for rust-analzyer until upstream fix this.

---

And I think `community/rust-analyzer` can remove `rust-analyzer-proc-macro-srv` from the package, because it is a part of rust (rustup toolchains are also contains it).

Loading...