forked from openbmc/dbus-sensors
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
meson: Attempt to build a basic zbus Rust program with meson
``` $ meson setup build --wipe --reconfigure \ -Dconcurrent-queue-2-rs:feature-default=true \ -Dfutures-io-0.3-rs:feature-default=true \ -Dfutures-lite-2-rs:feature-default=true ``` Error: ``` Executing subproject zbus-5.1.1-rs:async-io-2-rs:rustix-0.38-rs method cargo rustix-0.38-rs| Generated Meson AST: /root/openbmc/dbus-sensors/build/subprojects/rustix-0.38.37/meson.build rustix-0.38-rs| Project name: rustix rustix-0.38-rs| Project version: 0.38.37 rustix-0.38-rs| Rust compiler for the host machine: rustc -C linker=cc (rustc 1.83.0) rustix-0.38-rs| Rust linker for the host machine: rustc -C linker=cc ld.bfd 2.43.1-2 subprojects/rustix-0.38.37/meson.build:105:-1: ERROR: Unknown variable "linux_raw_sys_options". ``` Change-Id: I3283f7b5d23546fef48fcbeb6dc1736606fb7939 Signed-off-by: Peter Delevoryas <[email protected]>
1 parent
d7be555
commit bffbb42
Showing
4 changed files
with
61 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
use std::{error::Error, future::pending}; | ||
use zbus::{connection, interface}; | ||
|
||
struct Greeter { | ||
count: u64 | ||
} | ||
|
||
#[interface(name = "org.zbus.MyGreeter1")] | ||
impl Greeter { | ||
// Can be `async` as well. | ||
fn say_hello(&mut self, name: &str) -> String { | ||
self.count += 1; | ||
format!("Hello {}! I have been called {} times.", name, self.count) | ||
} | ||
} | ||
|
||
// Although we use `tokio` here, you can use any async runtime of choice. | ||
#[tokio::main] | ||
async fn main() -> Result<(), Box<dyn Error>> { | ||
let greeter = Greeter { count: 0 }; | ||
let _conn = connection::Builder::session()? | ||
.name("org.zbus.MyGreeter")? | ||
.serve_at("/org/zbus/MyGreeter", greeter)? | ||
.build() | ||
.await?; | ||
|
||
// Do other things or go to wait forever | ||
pending::<()>().await; | ||
|
||
Ok(()) | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[wrap-file] | ||
method = cargo | ||
directory = zbus-5.1.1 | ||
source_url = https://crates.io/api/v1/crates/zbus/5.1.1/download | ||
source_filename = zbus-5.1.1.tar.gz | ||
source_hash = 1162094dc63b1629fcc44150bcceeaa80798cd28bcbe7fa987b65a034c258608 | ||
|
||
[provide] | ||
dependency_names = zbus-5.1.1-rs |