bastion-rs / bastion

Highly-available Distributed Fault-tolerant Runtime
https://www.bastion-rs.com
Apache License 2.0
2.78k stars 101 forks source link

Android compatibility #342

Open Fritiofhedstrom opened 1 year ago

Fritiofhedstrom commented 1 year ago

I'd like to use Bastion for my android project, but stumbled upon a problem. When compiling with --target aarch64-linux-android then this code in src/placement.rs generates the stub only.

#[cfg(target_os = "linux")]
#[inline]
fn get_core_ids_helper() -> Option<Vec<CoreId>> {
    linux::get_core_ids()
}

What i would like is this: #[cfg(any(target_os = "linux", target_os="android"))] Not sure how many other places that are affected by this. There is a way to manually set the --cfg target_os in rustc, but it feels more cumbersome and not the correct way.

Is your feature request related to a problem? Please describe. Please describe the problem you are trying to solve.

Describe the solution you'd like Please describe the desired behavior.

Describe alternatives you've considered Please describe alternative solutions or features you have considered.

DAOCUONG commented 1 year ago

i. have same problem with ios

o0Ignition0o commented 1 year ago

Hmm I'd be happy to take a PR that adds ios support as well, i suppose the linux functions shall work, but it would need to be tested

DAOCUONG commented 1 year ago

Lets me test with ios and confirm

DAOCUONG commented 1 year ago

crash thread 'bastion-driver-dynamic' panicked at 'called Option::unwrap() on a None value', /Users/dao/.cargo/registry/src/github.com-1ecc6299db9ec823/bastion-executor-0.4.2/src/load_balancer.rs:36:58 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace thread 'bastion-driver-dynamic' panicked at 'Lazy instance has previously been poisoned', /Users/dao/.cargo/registry/src/github.com-1ecc6299db9ec823/once_cell-1.15.0/src/lib.rs:1261:25 thread 'bastion-driver-dynamic' panicked at 'Lazy instance has previously been poisoned', /Users/dao/.cargo/registry/src/github.com-1ecc6299db9ec823/once_cell-1.15.0/src/lib.rs:1261:25 thread 'bastion-driver-static' panicked at 'Lazy instance has previously been poisoned', /Users/dao/.cargo/registry/src/github.com-1ecc6299db9ec823/once_cell-1.15.0/src/lib.rs:1261:25 thread 'bastion-driver-dynamic' panicked at 'Lazy instance has previously been poisoned', /Users/dao/.cargo/registry/src/github.com-1ecc6299db9ec823/once_cell-1.15.0/src/lib.rs:1261:25 thread 'bastion-driver-dynamic' panicked at 'Lazy instance has previously been poisoned', /Users/dao/.cargo/registry/src/github.com-1ecc6299db9ec823/once_cell-1.15.0/src/lib.rs:1261:25 thread 'bastion-driver-static' panicked at 'Lazy instance has previously been poisoned', /Users/dao/DAO MANH CUONG .cargo/registry/src/github.com-1ecc6299db9ec823/once_cell-1.15.0/src/lib.rs:1261:25 thread 'bastion-driver-dynamic' panicked at 'Lazy instance has previously been poisoned', /Users/dao/.cargo/registry/src/github.com-1ecc6299db9ec823/once_cell-1.15.0/src/lib.rs:1261:25 thread 'bastion-blocking-driver-standalone' panicked at 'Lazy instance has previously been poisoned', /Users/dao/.cargo/registry/src/github.com-1ecc6299db9ec823/once_cell-1.15.0/src/lib.rs:1261:25 thread 'bastion-blocking-driver-standalone' panicked at 'Lazy instance has previously been poisoned', /Users/dao/.cargo/registry/src/github.com-1ecc6299db9ec823/once_cell-1.15.0/src/lib.rs:1261:25