paru icon indicating copy to clipboard operation
paru copied to clipboard

Installing on arch arm aarch64 fails

Open ssuukk opened this issue 9 months ago • 4 comments

Affected Version

current git state 23.3.2025

Description

Building paru fails.

Output

 makepkg -si
==> Making package: paru 2.0.4-1 (Sun 23 Mar 2025 05:52:24 PM CET)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found paru-2.0.4.tar.gz
==> Validating source files with sha256sums...
    paru-2.0.4.tar.gz ... Passed
==> Extracting sources...
  -> Extracting paru-2.0.4.tar.gz with bsdtar
==> Starting prepare()...
warning: Patch `alpm v3.0.4 (https://github.com/archlinux/alpm.rs?rev=306342#306342ef)` was not used in the crate graph.
Patch `aur-depends v3.0.0 (https://github.com/Morganamilo/aur-depends?rev=30c2c1#30c2c150)` was not used in the crate graph.
Check that the patched package version and available features are compatible
with the dependency requirements. If the patch has a different version from
what is locked in the Cargo.lock file, run `cargo update` to use the new
version. This may also occur with an optional dependency that is not enabled.
==> Removing existing $pkgdir/ directory...
==> Starting build()...
warning: Patch `alpm v3.0.4 (https://github.com/archlinux/alpm.rs?rev=306342#306342ef)` was not used in the crate graph.
Patch `aur-depends v3.0.0 (https://github.com/Morganamilo/aur-depends?rev=30c2c1#30c2c150)` was not used in the crate graph.
Check that the patched package version and available features are compatible
with the dependency requirements. If the patch has a different version from
what is locked in the Cargo.lock file, run `cargo update` to use the new
version. This may also occur with an optional dependency that is not enabled.
   Compiling alpm v4.0.1
   Compiling raur v7.0.0
   Compiling selectors v0.25.0
   Compiling html5ever v0.27.0
error[E0308]: mismatched types
   --> /home/qus/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/alpm-4.0.1/src/cb.rs:244:60
    |
244 |         unsafe { alpm_option_set_logcb(self.as_ptr(), Some(cb), &*ctx as *const _ as *mut _) };
    |                                                       ---- ^^ expected fn pointer, found fn item
    |                                                       |
    |                                                       arguments to this enum variant are incorrect
    |
    = note: expected fn pointer `unsafe extern "C" fn(_, _, _, *mut __va_list_tag)`
                  found fn item `extern "C" fn(_, _, _, [__va_list_tag; 1]) {logcb::<LogCbImpl<T, F>>}`
help: the type constructed contains `extern "C" fn(*mut c_void, u32, *const u8, [__va_list_tag; 1]) {logcb::<LogCbImpl<T, F>>}` due to the type of the argument passed
   --> /home/qus/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/alpm-4.0.1/src/cb.rs:244:55
    |
244 |         unsafe { alpm_option_set_logcb(self.as_ptr(), Some(cb), &*ctx as *const _ as *mut _) };
    |                                                       ^^^^^--^
    |                                                            |
    |                                                            this argument influences the type of `Some`
note: tuple variant defined here
   --> /rustc/4eb161250e340c8f48f66e2b929ef4a5bed7c181/library/core/src/option.rs:580:5

For more information about this error, try `rustc --explain E0308`.
error: could not compile `alpm` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
==> ERROR: A failure occurred in build().
    Aborting...

qus  …/paru   master ?  ♥ 17:52  uname -a
Linux LAPTOP-2EDOEG2H 5.15.167.4-microsoft-standard-WSL2 #1 SMP Tue Nov 5 00:19:58 UTC 2024 aarch64 GNU/Linux

ssuukk avatar Mar 23 '25 16:03 ssuukk

try building paru-git instead

kwankiu avatar Mar 24 '25 16:03 kwankiu

That helped, thanks!

ssuukk avatar Mar 25 '25 07:03 ssuukk

The main issue here is that paru should be built with --features generate if the architecture isn't x86_64, since there's a good chance that the version of pacman built for those architectures isn't the same as the libalpm version paru is built with by default.

See these comments on the AUR package: https://aur.archlinux.org/packages/paru#comment-994933

Would be greatly appreciate if the AUR package were updated!

clarfonthey avatar Mar 27 '25 14:03 clarfonthey

Dear all,

I was able to build paru on my RPi4 running ARMv7 with the below changes to the PKGBUILD file. Before I have seen the same error message. (Inspired by: https://github.com/Morganamilo/paru/issues/1154 )

diff --git a/PKGBUILD b/PKGBUILD
index f503694..d540ffb 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -9,6 +9,9 @@ backup=("etc/paru.conf")
 arch=('i686' 'pentium4' 'x86_64' 'arm' 'armv7h' 'armv6h' 'aarch64')
 license=('GPL-3.0-or-later')
 makedepends=('cargo')
+makedepends_armv7h=(
+  'clang'
+)
 depends=('git' 'pacman' 'libalpm.so>=14')
 optdepends=('bat: colored pkgbuild printing' 'devtools: build in chroot and downloading pkgbuilds')
 sha256sums=('b9c67f1390caacc949c2eb2a254e8cf37778f382c3c6b8d057fa6feb6eaeb0f9')
@@ -29,6 +32,10 @@ build () {
     export CARGO_PROFILE_RELEASE_LTO=off
   fi
 
+  if [[ $CARCH = armv7h ]]; then
+    _features+="generate,"
+  fi
+
   cargo build --frozen --features "${_features:-}" --release --target-dir target
   ./scripts/mkmo locale/
 }

Until here the first packages installed through paru are installing and working fine.

heuzen avatar Apr 19 '25 17:04 heuzen