Compile error on arch linux arm

Archlinux Arm, aarch64 build, rpi 3

Using this AUR package AUR (en) - geph4-client

Encountering this error at the end of the compiling

   Compiling binder_transport v0.1.0 (/home/xx/.cache/yay/geph4/src/geph4-4.1.8/lib/binder_transport)
   Compiling geph4-binder v0.1.0 (/home/xx/.cache/yay/geph4/src/geph4-4.1.8/geph4-binder)
error[E0308]: mismatched types
   --> geph4-binder/src/bindercore.rs:499:13
    |
499 |             password.as_ptr() as *const i8,
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u8`, found `i8`
    |
    = note: expected raw pointer `*const u8`
               found raw pointer `*const i8`

error[E0308]: mismatched types
   --> geph4-binder/src/bindercore.rs:511:13
    |
511 |             output.as_mut_ptr() as *mut i8,
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u8`, found `i8`
    |
    = note: expected raw pointer `*mut u8`
               found raw pointer `*mut i8`

error[E0308]: mismatched types
   --> geph4-binder/src/bindercore.rs:512:13
    |
512 |             password.as_ptr() as *const i8,
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u8`, found `i8`
    |
    = note: expected raw pointer `*const u8`
               found raw pointer `*const i8`

error[E0308]: mismatched types
   --> geph4-binder/src/bindercore.rs:519:40
    |
519 |     let cstr = unsafe { CStr::from_ptr(output.as_ptr() as *const i8) };
    |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u8`, found `i8`
    |
    = note: expected raw pointer `*const u8`
               found raw pointer `*const i8`

error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0308`.
error: could not compile `geph4-binder`

To learn more, run the command again with --verbose.
==> ERROR: A failure occurred in build().
    Aborting...
error making: geph4 (geph4-client)

How to fix this problem?

Don't compile the whole thing, just compile geph4-client with --manifest-path=geph4-client/Cargo.toml

2 个赞

Thanks @匿名用户 @nullchinchilla ! Your responses point to the same thing and I'll try it.

However, what's the reason behind this?

For anyone who may compile geph directly on low-power devices, make sure you have enough ram or swap space.

On archlinuxarm @ rpi3, 1gb ram is not enough, another zram of 512MB is required.

More questions:

  1. Will there be pre-compiled binaries for every kind of devices like v2ray does?
  2. Is there any description for the usage of components other than Geph-client?
1 个赞

This is sweet. However,

  1. No linux-aarch64 build as far as I see. geph4-client-linux-armv7 build is okay to run on my rpi3.
  2. Will you provide manuals on other components like geph-binder and geph-exit?

Can you try geph4-client-android-aarch64 and see if it works?

Not working.

Maybe you can use GitHub Actions to create a custom CI workflow to cross-compiling it yourself.

cross build --release --locked --target aarch64-unknown-linux-gnu --manifest-path=geph4-client/Cargo.toml

Like this:

1 个赞

Thanks, it works.