Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aura doesn't build on arm #939

Open
AlexAegis opened this issue Sep 18, 2024 · 4 comments
Open

aura doesn't build on arm #939

AlexAegis opened this issue Sep 18, 2024 · 4 comments

Comments

@AlexAegis
Copy link

Running cargo install aura-pm on AARM64 results in the following error.

error[E0308]: mismatched types
   --> /home/alex/.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/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/alex/.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/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/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/core/src/option.rs:582: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: failed to compile `aura-pm v4.0.7`, intermediate artifacts can be found at `/tmp/cargo-installKVzieV`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

This is known in alpm.rs and paru too, and I've seen this (archlinux/alpm.rs#35 (comment)) comment recommending enabling a feature, that would introduce some extra crates but at least it would build on arm, I'm not sure what the tradeoffs are if any but I tried it, cloned this repo, added this feature to both crates here and the build was indeed successful on arch.

 [dependencies]
-alpm = "3.0"
+alpm = { version = "3.0", features = [ "generate" ] }
@fosskers
Copy link
Owner

Thanks for bringing this to my attention.

@fosskers
Copy link
Owner

This apparently creates a new dependency on clang, which is somewhat heavy (200+ mb).

@AlexAegis
Copy link
Author

And if it's only enabled for that one target? To not impose this on x86 users.

@fosskers
Copy link
Owner

It would complicate the PKGBUILD but I believe it's possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants