mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-28 21:03:54 -06:00
subprojects: add the anyhow crate
This is a standard replacement for Box<dyn Error> which is more efficient (it only occcupies one word) and provides a backtrace of the error. This could be plumbed into &error_abort in the future. Reviewed-by: Zhao Liu <zhao1.liu@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
f8a113701d
commit
a95ad49bbf
7 changed files with 46 additions and 3 deletions
|
@ -1,7 +1,9 @@
|
||||||
|
subproject('anyhow-1-rs', required: true)
|
||||||
subproject('bilge-0.2-rs', required: true)
|
subproject('bilge-0.2-rs', required: true)
|
||||||
subproject('bilge-impl-0.2-rs', required: true)
|
subproject('bilge-impl-0.2-rs', required: true)
|
||||||
subproject('libc-0.2-rs', required: true)
|
subproject('libc-0.2-rs', required: true)
|
||||||
|
|
||||||
|
anyhow_rs = dependency('anyhow-1-rs')
|
||||||
bilge_rs = dependency('bilge-0.2-rs')
|
bilge_rs = dependency('bilge-0.2-rs')
|
||||||
bilge_impl_rs = dependency('bilge-impl-0.2-rs')
|
bilge_impl_rs = dependency('bilge-impl-0.2-rs')
|
||||||
libc_rs = dependency('libc-0.2-rs')
|
libc_rs = dependency('libc-0.2-rs')
|
||||||
|
|
|
@ -35,7 +35,7 @@ _qemu_api_rs = static_library(
|
||||||
override_options: ['rust_std=2021', 'build.rust_std=2021'],
|
override_options: ['rust_std=2021', 'build.rust_std=2021'],
|
||||||
rust_abi: 'rust',
|
rust_abi: 'rust',
|
||||||
rust_args: _qemu_api_cfg,
|
rust_args: _qemu_api_cfg,
|
||||||
dependencies: [libc_rs, qemu_api_macros, qemuutil_rs,
|
dependencies: [anyhow_rs, libc_rs, qemu_api_macros, qemuutil_rs,
|
||||||
qom, hwcore, chardev, migration],
|
qom, hwcore, chardev, migration],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ sub_file="${sub_tdir}/submodule.tar"
|
||||||
# in their checkout, because the build environment is completely
|
# in their checkout, because the build environment is completely
|
||||||
# different to the host OS.
|
# different to the host OS.
|
||||||
subprojects="keycodemapdb libvfio-user berkeley-softfloat-3
|
subprojects="keycodemapdb libvfio-user berkeley-softfloat-3
|
||||||
berkeley-testfloat-3 arbitrary-int-1-rs bilge-0.2-rs
|
berkeley-testfloat-3 anyhow-1-rs arbitrary-int-1-rs bilge-0.2-rs
|
||||||
bilge-impl-0.2-rs either-1-rs itertools-0.11-rs libc-0.2-rs proc-macro2-1-rs
|
bilge-impl-0.2-rs either-1-rs itertools-0.11-rs libc-0.2-rs proc-macro2-1-rs
|
||||||
proc-macro-error-1-rs proc-macro-error-attr-1-rs quote-1-rs
|
proc-macro-error-1-rs proc-macro-error-attr-1-rs quote-1-rs
|
||||||
syn-2-rs unicode-ident-1-rs"
|
syn-2-rs unicode-ident-1-rs"
|
||||||
|
|
|
@ -40,7 +40,7 @@ fi
|
||||||
|
|
||||||
# Only include wraps that are invoked with subproject()
|
# Only include wraps that are invoked with subproject()
|
||||||
SUBPROJECTS="libvfio-user keycodemapdb berkeley-softfloat-3
|
SUBPROJECTS="libvfio-user keycodemapdb berkeley-softfloat-3
|
||||||
berkeley-testfloat-3 arbitrary-int-1-rs bilge-0.2-rs
|
berkeley-testfloat-3 anyhow-1-rs arbitrary-int-1-rs bilge-0.2-rs
|
||||||
bilge-impl-0.2-rs either-1-rs itertools-0.11-rs libc-0.2-rs proc-macro2-1-rs
|
bilge-impl-0.2-rs either-1-rs itertools-0.11-rs libc-0.2-rs proc-macro2-1-rs
|
||||||
proc-macro-error-1-rs proc-macro-error-attr-1-rs quote-1-rs
|
proc-macro-error-1-rs proc-macro-error-attr-1-rs quote-1-rs
|
||||||
syn-2-rs unicode-ident-1-rs"
|
syn-2-rs unicode-ident-1-rs"
|
||||||
|
|
1
subprojects/.gitignore
vendored
1
subprojects/.gitignore
vendored
|
@ -6,6 +6,7 @@
|
||||||
/keycodemapdb
|
/keycodemapdb
|
||||||
/libvfio-user
|
/libvfio-user
|
||||||
/slirp
|
/slirp
|
||||||
|
/anyhow-1.0.98
|
||||||
/arbitrary-int-1.2.7
|
/arbitrary-int-1.2.7
|
||||||
/bilge-0.2.0
|
/bilge-0.2.0
|
||||||
/bilge-impl-0.2.0
|
/bilge-impl-0.2.0
|
||||||
|
|
7
subprojects/anyhow-1-rs.wrap
Normal file
7
subprojects/anyhow-1-rs.wrap
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
[wrap-file]
|
||||||
|
directory = anyhow-1.0.98
|
||||||
|
source_url = https://crates.io/api/v1/crates/anyhow/1.0.98/download
|
||||||
|
source_filename = anyhow-1.0.98.tar.gz
|
||||||
|
source_hash = e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487
|
||||||
|
#method = cargo
|
||||||
|
patch_directory = anyhow-1-rs
|
33
subprojects/packagefiles/anyhow-1-rs/meson.build
Normal file
33
subprojects/packagefiles/anyhow-1-rs/meson.build
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
project('anyhow-1-rs', 'rust',
|
||||||
|
meson_version: '>=1.5.0',
|
||||||
|
version: '1.0.98',
|
||||||
|
license: 'MIT OR Apache-2.0',
|
||||||
|
default_options: [])
|
||||||
|
|
||||||
|
rustc = meson.get_compiler('rust')
|
||||||
|
|
||||||
|
rust_args = ['--cap-lints', 'allow']
|
||||||
|
rust_args += ['--cfg', 'feature="std"']
|
||||||
|
if rustc.version().version_compare('<1.65.0')
|
||||||
|
error('rustc version ' + rustc.version() + ' is unsupported. Please upgrade to at least 1.65.0')
|
||||||
|
endif
|
||||||
|
rust_args += [ '--cfg', 'std_backtrace' ] # >= 1.65.0
|
||||||
|
if rustc.version().version_compare('<1.81.0')
|
||||||
|
rust_args += [ '--cfg', 'anyhow_no_core_error' ]
|
||||||
|
endif
|
||||||
|
|
||||||
|
_anyhow_rs = static_library(
|
||||||
|
'anyhow',
|
||||||
|
files('src/lib.rs'),
|
||||||
|
gnu_symbol_visibility: 'hidden',
|
||||||
|
override_options: ['rust_std=2018', 'build.rust_std=2018'],
|
||||||
|
rust_abi: 'rust',
|
||||||
|
rust_args: rust_args,
|
||||||
|
dependencies: [],
|
||||||
|
)
|
||||||
|
|
||||||
|
anyhow_dep = declare_dependency(
|
||||||
|
link_with: _anyhow_rs,
|
||||||
|
)
|
||||||
|
|
||||||
|
meson.override_dependency('anyhow-1-rs', anyhow_dep)
|
Loading…
Add table
Add a link
Reference in a new issue