Compilation fails with libalpm v16.0.1
Environment
- OS: Arch Linux
- libalpm version: 16.0.1 (from pacman 7.0.0+)
- paru version attempted: 1.11.0 (stable) and latest git
- Rust/Cargo: Latest from official repositories
Problem Description
Paru fails to compile on systems with the latest pacman update that includes libalpm v16.0.1. Both the stable release and the git version fail to build.
Steps to Reproduce
Attempt 1: Install via cargo
cargo install paru
Error output:
error: failed to run custom build command for `alpm v2.2.3`
thread 'main' panicked at build.rs:25:13:
this version of alpm.rs does not support libalpm v16.0.1 only v13.x.x is supported
Attempt 2: Build from AUR
git clone https://aur.archlinux.org/paru.git
cd paru
makepkg -si
Error output:
error[E0425]: cannot find function `alpm_option_set_disable_sandbox_filesystem` in this scope
--> alpm-4.0.4/src/handle.rs:181:18
|
| unsafe { alpm_option_set_disable_sandbox_filesystem(self.as_ptr()...
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a function with a similar name exists: `alpm_option_set_disable_sandbox`
error[E0425]: cannot find function `alpm_option_set_disable_sandbox_syscalls` in this scope
--> alpm-4.0.4/src/handle.rs:182:18
|
| unsafe { alpm_option_set_disable_sandbox_syscalls(self.as_ptr()...
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a function with a similar name exists: `alpm_option_set_disable_sandbox`
error[E0061]: this function takes 3 arguments but 4 arguments were supplied
--> alpm-4.0.4/src/sandbox.rs:14:22
|
| { alpm_sandbox_setup_child(self.as_ptr(), user.as_ptr(), path.as_ptr(), false) };
| ^^^^^^^^^^^^^^^^^^^^^^^^ ----- unexpected argument #4 of type `bool`
Attempt 3: Build from paru-git
git clone https://aur.archlinux.org/paru-git.git
cd paru-git
makepkg -si
Result: Same compilation errors as Attempt 2.
Attempt 4: Previously installed binary
If paru was already installed before the pacman update:
paru --version
Error output:
paru: error while loading shared libraries: libalpm.so.15: cannot open shared object file: No such file or directory
Root Cause
The Rust bindings for libalpm (alpm and alpm-sys crates) are not yet compatible with libalpm v16.0.1. The API has changed:
- Functions like
alpm_option_set_disable_sandbox_filesystemandalpm_option_set_disable_sandbox_syscallsno longer exist - Function signatures have changed (e.g.,
alpm_sandbox_setup_childnow takes 3 arguments instead of 4)
Expected Behavior
Paru should compile and run successfully on Arch Linux systems with the latest pacman/libalpm version.
Workaround
Currently using yay as an alternative AUR helper until paru is updated to support libalpm v16.
Additional Context
This affects all Arch Linux users who have updated to pacman 7.0.0+ (released recently). The alpm-rs crate needs to be updated to support the new libalpm API before paru can be compiled successfully.
Related
This is likely related to upstream changes in the alpm crate. Consider updating dependencies or pinning to a compatible version of alpm-rs that supports libalpm v16.
+1
error[E0061]: this function takes 3 arguments but 4 arguments were supplied
--> /home/drew/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/alpm-4.0.4/src/sandbox.rs:14:22
|
14 | ... { alpm_sandbox_setup_child(self.as_ptr(), user.as_ptr(), path.as_ptr(), false) };
| ^^^^^^^^^^^^^^^^^^^^^^^^ ----- unexpected argument #4 of type `bool`
|
note: function defined here
--> /home/drew/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/alpm-sys-4.0.4/src/ffi.rs:2817:12
|
2817 | pub fn alpm_sandbox_setup_child(
| ^^^^^^^^^^^^^^^^^^^^^^^^
help: remove the extra argument
|
14 - unsafe { alpm_sandbox_setup_child(self.as_ptr(), user.as_ptr(), path.as_ptr(), false) };
14 + unsafe { alpm_sandbox_setup_child(self.as_ptr(), user.as_ptr(), path.as_ptr()) };
|
Some errors have detailed explanations: E0061, E0425.
For more information about an error, try `rustc --explain E0061`.
error: could not compile `alpm` (lib) due to 3 previous errors
warning: build failed, waiting for other jobs to finish...
==> ERROR: A failure occurred in build().
Aborting...
error: failed to build 'paru-2.1.0-2':
error: packages failed to build: paru-2.1.0-2
+1
The package from endeavouros/paru throw this error:
paru: error while loading shared libraries: libalpm.so.15: cannot open shared object file: No such file or directory
+1
+1
+1
+1
+1
This is a duplicate of #1454.
You can find a PKGBUILD which patches Cargo.toml to use the latest alpm crates over there.
+1111111111111111111111111111111111111110
+1
+1
If you have nothing to add, please 👍 the original post rather than adding a +1 comment.
+1
Please read #1454 for fix
Available paru https://github.com/Yfengqiu/Software-package-repository
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
Love how the workaround is "use yay instead." smh.
+1
If you have nothing to add, please 👍 the original post rather than adding a +1 comment.
Also, please go back to whoever told you to come here and post '+1' comments and ask them to stop recommending it. All this does is fill people's inboxes with useless notifications.
If you have nothing to add, please 👍 the original post rather than adding a +1 comment.
Also, please go back to whoever told you to come here and post '+1' comments and ask them to stop recommending it. All this does is fill people's inboxes with useless notifications.
Appreciate the recommendation. No one sent us, there's no conspiracy, personally I'm just a GitHub noob who doesn't know the etiquette.