[RFC v2 04/26] subprojects: Add thiserror crate
Zhao Liu <[email protected]> Wed, 8 Jul 2026 16:10:30 +0800
| Newsgroups | org.nongnu.qemu-rust,org.nongnu.qemu-devel |
|---|---|
| Message-ID | <[email protected]> |
Use thiserror v1.0.65 for QEMU. Signed-off-by: Zhao Liu <[email protected]> --- scripts/archive-source.sh | 1 + scripts/make-release | 2 +- subprojects/.gitignore | 1 + .../packagefiles/thiserror-1-rs/meson.build | 23 +++++++++++++++++++ subprojects/thiserror-1-rs.wrap | 10 ++++++++ 5 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 subprojects/packagefiles/thiserror-1-rs/meson.build create mode 100644 subprojects/thiserror-1-rs.wrap diff --git a/scripts/archive-source.sh b/scripts/archive-source.sh index b7f678872036..2f3987fc0fea 100755 --- a/scripts/archive-source.sh +++ b/scripts/archive-source.sh @@ -47,6 +47,7 @@ subprojects=( proc-macro2-1-rs quote-1-rs syn-2-rs + thiserror-1-rs thiserror-impl-1-rs unicode-ident-1-rs ) diff --git a/scripts/make-release b/scripts/make-release index 0f33522f39ba..a5488e226298 100755 --- a/scripts/make-release +++ b/scripts/make-release @@ -44,7 +44,7 @@ SUBPROJECTS="libvfio-user keycodemapdb berkeley-softfloat-3 bilge-impl-0.2-rs either-1-rs foreign-0.3-rs itertools-0.11-rs libc-0.2-rs probe-0.5-rs proc-macro2-1-rs proc-macro-error-1-rs proc-macro-error-attr-1-rs quote-1-rs - syn-2-rs thiserror-impl-1-rs unicode-ident-1-rs" + syn-2-rs thiserror-1-rs thiserror-impl-1-rs unicode-ident-1-rs" src="$1" version="$2" diff --git a/subprojects/.gitignore b/subprojects/.gitignore index 816bc67111c9..d7cf421bff07 100644 --- a/subprojects/.gitignore +++ b/subprojects/.gitignore @@ -22,6 +22,7 @@ /proc-macro* /quote-* /syn-* +/thiserror-* /thiserror-impl-* /unicode-ident-* diff --git a/subprojects/packagefiles/thiserror-1-rs/meson.build b/subprojects/packagefiles/thiserror-1-rs/meson.build new file mode 100644 index 000000000000..bfaf2f8d3eb8 --- /dev/null +++ b/subprojects/packagefiles/thiserror-1-rs/meson.build @@ -0,0 +1,23 @@ +project('thiserror-1-rs', 'rust', + meson_version: '>=1.5.0', + version: '1.0.65', + license: 'MIT OR Apache-2.0', + default_options: []) + +subproject('thiserror-impl-1-rs', required: true) +thiserror_impl_rs = dependency('thiserror-impl-1-rs') + +_thiserror_rs = static_library( + 'thiserror', + files('src/lib.rs'), + gnu_symbol_visibility: 'hidden', + override_options: ['rust_std=2021', 'build.rust_std=2021'], + rust_abi: 'rust', + dependencies: [thiserror_impl_rs], +) + +thiserror_dep = declare_dependency( + link_with: _thiserror_rs, +) + +meson.override_dependency('thiserror-1-rs', thiserror_dep) diff --git a/subprojects/thiserror-1-rs.wrap b/subprojects/thiserror-1-rs.wrap new file mode 100644 index 000000000000..0f9303bebf97 --- /dev/null +++ b/subprojects/thiserror-1-rs.wrap @@ -0,0 +1,10 @@ +[wrap-file] +directory = thiserror-1.0.65 +source_url = https://crates.io/api/v1/crates/thiserror/1.0.65/download +source_filename = thiserror-1.0.65.tar.gz +source_hash = 5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5 +#method = cargo +patch_directory = thiserror-1-rs + +# bump this version number on every change to meson.build or the patches: +# v2 -- 2.34.1