Morganamilo / paru

Feature packed AUR helper
GNU General Public License v3.0
6.2k stars 239 forks source link

Compile error "mismatched types" #1171

Open claudio-ebel opened 6 months ago

claudio-ebel commented 6 months ago

Affected Version

git log -n 1

$ git log -n 1
commit 7008763e43b8f950394acf736abd5dc0179d3ff1 (HEAD -> master, origin/master, origin/HEAD)
Author: morganamilo <morganamilo@archlinux.org>
Date:   Tue Mar 26 04:23:15 2024 +0000

    Fix dep

Description

makepkg fails due to compilation errors

[...]
error[E0308]: mismatched types                                                                                                                                            
   --> /home/user/.cargo/git/checkouts/alpm.rs-a0070a235cf20bfa/306342e/alpm/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/user/.cargo/git/checkouts/alpm.rs-a0070a235cf20bfa/306342e/alpm/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                                                
   --> /build/rust/src/rustc-1.77.1-src/library/core/src/option.rs:578: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...                      
==> FEHLER: Ein Fehler geschah in build().                                      
    Breche ab...                                                                
$

Hints

Used latest version of the AUR repo (paru-2.0.3) for makepkg.

flearc commented 6 months ago

If you built it on aarch64, try https://github.com/Morganamilo/paru/issues/1154#issuecomment-2002357898