qemu-rust
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH 01/11] rust: qemu_api: do not disable lints outside bindg


From: Paolo Bonzini
Subject: Re: [RFC PATCH 01/11] rust: qemu_api: do not disable lints outside bindgen-generated code
Date: Tue, 12 Nov 2024 19:47:43 +0100
User-agent: Mozilla Thunderbird

On 11/12/24 11:10, Junjie Mao wrote:
diff --git a/meson.build b/meson.build
index 1239f5c48c..8cea09ffe1 100644
--- a/meson.build
+++ b/meson.build
@@ -4,6 +4,7 @@ project('qemu', ['c'], meson_version: '>=1.5.0',
          version: files('VERSION'))

  meson.add_devenv({ 'MESON_BUILD_ROOT' : meson.project_build_root() })
+meson.add_devenv({ 'CARGO_TARGET_DIR' : meson.project_build_root() / 'cargo' })

I think I'd rather avoid using CARGO_TARGET_DIR, in case someone forgets he/she is in the devenv.

  add_test_setup('quick', exclude_suites: ['slow', 'thorough'], is_default: 
true)
  add_test_setup('slow', exclude_suites: ['thorough'], env: ['G_TEST_SLOW=1', 
'SPEED=slow'])
@@ -4083,7 +4084,7 @@ if have_rust
    bindings_rs = rust.bindgen(
      input: 'rust/wrapper.h',
      dependencies: common_ss.all_dependencies(),
-    output: 'bindings.rs.inc',
+    output: 'bindings.inc.rs',

Needs a comment, but I guess it's okay.

-    println!("cargo:rustc-env=BINDINGS_RS_INC={}", file);
+    let out_dir = env::var("OUT_DIR").unwrap();
+    let dest_path = format!("{}/bindings.inc.rs", out_dir);
+    copy(&file, Path::new(&dest_path))?;

A symbolic link seems to work too.  Thanks for the tip!

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]