New upstream development version 1.17.3

Disable Rust bindings.
This commit is contained in:
Richard W.M. Jones 2023-08-04 15:04:04 +01:00
parent 3087f68c51
commit 704cc15c49
3 changed files with 80 additions and 5 deletions

View File

@ -0,0 +1,67 @@
From 473d78fb70c4ee6adb5e3596d699cf7b5a95f028 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Fri, 4 Aug 2023 15:10:52 +0100
Subject: [PATCH] generator: Handle ./configure --disable-rust
If this option is used, then "@RUSTFMT@" is expanded to "" (not "no").
Let's change the Config.rustfmt value to be an option type, while also
fixing this problem.
Fixes: commit b2511d640bc12b0116e6c013a17aefb4e772a058
---
generator/config.ml.in | 2 +-
generator/config.mli | 2 +-
generator/utils.ml | 17 ++++++++++-------
3 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/generator/config.ml.in b/generator/config.ml.in
index 7ac5237c5d..d0e6760e4f 100644
--- a/generator/config.ml.in
+++ b/generator/config.ml.in
@@ -18,4 +18,4 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*)
-let rustfmt = "@RUSTFMT@"
+let rustfmt = match "@RUSTFMT@" with "" | "no" -> None | s -> Some s
diff --git a/generator/config.mli b/generator/config.mli
index 5f1a46a6b1..8fb0c672ed 100644
--- a/generator/config.mli
+++ b/generator/config.mli
@@ -17,4 +17,4 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*)
-val rustfmt : string
+val rustfmt : string option
diff --git a/generator/utils.ml b/generator/utils.ml
index 3302b309ae..8ce4240c31 100644
--- a/generator/utils.ml
+++ b/generator/utils.ml
@@ -432,13 +432,16 @@ let
chan := NoOutput;
(match formatter with
| Some Rustfmt ->
- if Config.rustfmt <> "no" then (
- let cmd = sprintf "%s %s" Config.rustfmt filename_new in
- match system cmd with
- | WEXITED 0 -> ()
- | WEXITED i -> failwithf "rustfmt failed with exit code %d" i
- | WSIGNALED i | WSTOPPED i ->
- failwithf "rustfmt was killed or stopped by signal %d" i
+ (match Config.rustfmt with
+ | Some rustfmt ->
+ (let cmd = sprintf "%s %s" rustfmt filename_new in
+ match system cmd with
+ | WEXITED 0 -> ()
+ | WEXITED i -> failwithf "rustfmt failed with exit code %d" i
+ | WSIGNALED i | WSTOPPED i ->
+ failwithf "rustfmt was killed or stopped by signal %d" i
+ )
+ | None -> ()
);
| None -> ());
(* Is the new file different from the current file? *)
--
2.41.0

View File

@ -8,8 +8,8 @@
%global source_directory 1.17-development
Name: libnbd
Version: 1.17.2
Release: 2%{?dist}
Version: 1.17.3
Release: 1%{?dist}
Summary: NBD client library in userspace
License: LGPL-2.0-or-later AND BSD-3-Clause
@ -25,6 +25,9 @@ Source2: libguestfs.keyring
# Maintainer script which helps with handling patches.
Source3: copy-patches.sh
# Upstream patch to fix ./configure --disable-rust
Patch: 0001-generator-Handle-.-configure-disable-rust.patch
%if 0%{patches_touch_autotools}
BuildRequires: autoconf, automake, libtool
%endif
@ -224,7 +227,8 @@ autoreconf -i
--disable-ocaml \
%endif
--enable-fuse \
--disable-golang
--disable-golang \
--disable-rust
make %{?_smp_mflags}
@ -374,6 +378,10 @@ make %{?_smp_mflags} check || {
%changelog
* Fri Aug 04 2023 Richard W.M. Jones <rjones@redhat.com> - 1.17.3-1
- New upstream development version 1.17.3
- Disable Rust bindings.
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.17.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild

View File

@ -1,2 +1,2 @@
SHA512 (libnbd-1.17.2.tar.gz) = 9485f265f30dab1d518366d5c712f5e5c45443b06e84bb454288f4db6009b4ad5c286469d864aa78c1b9a3f3b64bc76dfc67f48fd9d257dd31482ef7b85e5909
SHA512 (libnbd-1.17.2.tar.gz.sig) = aba3fb0ee3ffde4144f7dca888492c8d0df8dc31dd7615cf21745a0dd75828c4c8ba36580867b0a7b64963cc1bea7a9257d9bad1b190cdd7278b5ff4a9a172c9
SHA512 (libnbd-1.17.3.tar.gz) = 8e5c703dd88f3432284aaf2c912fd3ad98ef47fae89a72e6d26d833826108aca718d3447506bb7a7a247008da4525df0a691c197abc3ab4d6ad68e04495bd3b9
SHA512 (libnbd-1.17.3.tar.gz.sig) = 31cf45662d1d71be3e2ad7c942092f1d0ddd3390a4f4644fd7395b3a0f0f00c4a68605697ba6b9eb9fd1270a931150dbc3a6917b014eff12ecdd7045ea8f1175