diff --git a/0001-tests-test-tar-info-Remove-bogus-test-requires-of-gu.patch b/0001-tests-test-tar-info-Remove-bogus-test-requires-of-gu.patch index 3047bcf..680bfc8 100644 --- a/0001-tests-test-tar-info-Remove-bogus-test-requires-of-gu.patch +++ b/0001-tests-test-tar-info-Remove-bogus-test-requires-of-gu.patch @@ -1,7 +1,7 @@ From d2e335b2d05e68c1fc7ed9b507fd5cafc172a112 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 13 Jun 2023 20:11:34 +0100 -Subject: [PATCH 01/15] tests/test-tar-info*: Remove bogus test requires of +Subject: [PATCH 01/16] tests/test-tar-info*: Remove bogus test requires of guestfish These tests don't need guestfish so don't test for it. diff --git a/0002-tar-Document-the-optional-tar-option-in-help-output-.patch b/0002-tar-Document-the-optional-tar-option-in-help-output-.patch index 84be7bc..f1b4059 100644 --- a/0002-tar-Document-the-optional-tar-option-in-help-output-.patch +++ b/0002-tar-Document-the-optional-tar-option-in-help-output-.patch @@ -1,7 +1,7 @@ From eb44ca26a84c369a7908f19517c0a2f8f621d57f Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 13 Jun 2023 20:25:40 +0100 -Subject: [PATCH 02/15] tar: Document the optional tar option in --help output +Subject: [PATCH 02/16] tar: Document the optional tar option in --help output and synopsis Fixes: commit 05b49f89dccb0ca3fd0919e9502c54dbcadf0b73 diff --git a/0003-tar-Implement-tar-limit.patch b/0003-tar-Implement-tar-limit.patch index cd54c95..be8003c 100644 --- a/0003-tar-Implement-tar-limit.patch +++ b/0003-tar-Implement-tar-limit.patch @@ -1,7 +1,7 @@ From ae3fb4def811f5bc42563128e8fae0a4288584d1 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 13 Jun 2023 20:01:05 +0100 -Subject: [PATCH 03/15] tar: Implement tar-limit +Subject: [PATCH 03/16] tar: Implement tar-limit This can be used to ensure that the tar filter does not read indefinite amounts of input when opening the tar file. diff --git a/0004-xz-Fix-error-message-to-refer-to-xz-max-block-parame.patch b/0004-xz-Fix-error-message-to-refer-to-xz-max-block-parame.patch index ed32847..cf99a97 100644 --- a/0004-xz-Fix-error-message-to-refer-to-xz-max-block-parame.patch +++ b/0004-xz-Fix-error-message-to-refer-to-xz-max-block-parame.patch @@ -1,7 +1,7 @@ From 35db543e38293808e910b291ff26b17284640ec9 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 19 Jun 2023 13:53:09 +0100 -Subject: [PATCH 04/15] xz: Fix error message to refer to xz-max-block +Subject: [PATCH 04/16] xz: Fix error message to refer to xz-max-block parameter In the original xz plugin the parameter was called "maxblock", but diff --git a/0005-configure-Recommend-using-g-with-OCAMLOPTFLAGS.patch b/0005-configure-Recommend-using-g-with-OCAMLOPTFLAGS.patch index 6d419b0..ec9999d 100644 --- a/0005-configure-Recommend-using-g-with-OCAMLOPTFLAGS.patch +++ b/0005-configure-Recommend-using-g-with-OCAMLOPTFLAGS.patch @@ -1,7 +1,7 @@ From 4398b1871f8832109fcdbe25c70a1dd341ed5bd4 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 21 Jun 2023 13:05:22 +0100 -Subject: [PATCH 05/15] configure: Recommend using -g with OCAMLOPTFLAGS +Subject: [PATCH 05/16] configure: Recommend using -g with OCAMLOPTFLAGS --- configure.ac | 4 ++-- diff --git a/0006-tests-test_ocaml_plugin.ml-Print-a-message-when-test.patch b/0006-tests-test_ocaml_plugin.ml-Print-a-message-when-test.patch index 25fbbdb..5c75615 100644 --- a/0006-tests-test_ocaml_plugin.ml-Print-a-message-when-test.patch +++ b/0006-tests-test_ocaml_plugin.ml-Print-a-message-when-test.patch @@ -1,7 +1,7 @@ From b53b78e542fe8e49ce5c670e8ddc9d2be66f73cc Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 21 Jun 2023 18:47:40 +0100 -Subject: [PATCH 06/15] tests/test_ocaml_plugin.ml: Print a message when test +Subject: [PATCH 06/16] tests/test_ocaml_plugin.ml: Print a message when test plugin initializes It's useful to have a message which is printed as the top level diff --git a/0007-ocaml-Add-I-unix-before-using-unix.cmxa.patch b/0007-ocaml-Add-I-unix-before-using-unix.cmxa.patch index cb40bc2..049cfb4 100644 --- a/0007-ocaml-Add-I-unix-before-using-unix.cmxa.patch +++ b/0007-ocaml-Add-I-unix-before-using-unix.cmxa.patch @@ -1,7 +1,7 @@ From b778c56443e11817d4974dcab5356e2d4065980b Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 21 Jun 2023 18:56:58 +0100 -Subject: [PATCH 07/15] ocaml: Add -I +unix before using unix.cmxa +Subject: [PATCH 07/16] ocaml: Add -I +unix before using unix.cmxa In OCaml 5.0 you will see this warning: diff --git a/0008-ocaml-Replace-caml_leave_blocking_section-with-caml_.patch b/0008-ocaml-Replace-caml_leave_blocking_section-with-caml_.patch index f7ba249..cb00591 100644 --- a/0008-ocaml-Replace-caml_leave_blocking_section-with-caml_.patch +++ b/0008-ocaml-Replace-caml_leave_blocking_section-with-caml_.patch @@ -1,7 +1,7 @@ From f8b761c62f177176dfe154a95824576eef740827 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 21 Jun 2023 19:07:00 +0100 -Subject: [PATCH 08/15] ocaml: Replace caml_leave_blocking_section with +Subject: [PATCH 08/16] ocaml: Replace caml_leave_blocking_section with caml_acquire_runtime_system Replace: diff --git a/0009-ocaml-Always-unregister-the-global-root-and-free-the.patch b/0009-ocaml-Always-unregister-the-global-root-and-free-the.patch index 2380388..acb9bc5 100644 --- a/0009-ocaml-Always-unregister-the-global-root-and-free-the.patch +++ b/0009-ocaml-Always-unregister-the-global-root-and-free-the.patch @@ -1,7 +1,7 @@ From f4d5f179c9be6db3c39bc0752e36f262c3f87716 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 21 Jun 2023 20:15:46 +0100 -Subject: [PATCH 09/15] ocaml: Always unregister the global root and free the +Subject: [PATCH 09/16] ocaml: Always unregister the global root and free the handle If the OCaml code did not provide a close method, we would never call diff --git a/0010-ocaml-Fix-thread-registration-for-OCaml-5.patch b/0010-ocaml-Fix-thread-registration-for-OCaml-5.patch index 05982d0..ebf111c 100644 --- a/0010-ocaml-Fix-thread-registration-for-OCaml-5.patch +++ b/0010-ocaml-Fix-thread-registration-for-OCaml-5.patch @@ -1,7 +1,7 @@ From 9d4b87e0338d45456c0506fd2c25b80f7ef6b1e1 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 21 Jun 2023 20:18:58 +0100 -Subject: [PATCH 10/15] ocaml: Fix thread registration for OCaml 5 +Subject: [PATCH 10/16] ocaml: Fix thread registration for OCaml 5 OCaml 5 is strict about registering threads before calling OCaml heap functions, and will abort the program with this error if you don't do diff --git a/0011-tests-test-cc-ocaml.sh-Use-nbdkit-v-option-to-help-w.patch b/0011-tests-test-cc-ocaml.sh-Use-nbdkit-v-option-to-help-w.patch index fc8045c..47186fb 100644 --- a/0011-tests-test-cc-ocaml.sh-Use-nbdkit-v-option-to-help-w.patch +++ b/0011-tests-test-cc-ocaml.sh-Use-nbdkit-v-option-to-help-w.patch @@ -1,7 +1,7 @@ From c78266258709e2cbe6f0e869c866d09ad72c072c Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 22 Jun 2023 10:33:31 +0100 -Subject: [PATCH 11/15] tests/test-cc-ocaml.sh: Use nbdkit -v option to help +Subject: [PATCH 11/16] tests/test-cc-ocaml.sh: Use nbdkit -v option to help with debugging --- diff --git a/0012-tests-Replace-SRCDIR-with-abs_top_srcdir.patch b/0012-tests-Replace-SRCDIR-with-abs_top_srcdir.patch index 991b3a7..2d783f0 100644 --- a/0012-tests-Replace-SRCDIR-with-abs_top_srcdir.patch +++ b/0012-tests-Replace-SRCDIR-with-abs_top_srcdir.patch @@ -1,7 +1,7 @@ From d968c4858847388e515bc1ef84ff4479c18a414d Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 22 Jun 2023 10:44:10 +0100 -Subject: [PATCH 12/15] tests: Replace $SRCDIR with $abs_top_srcdir +Subject: [PATCH 12/16] tests: Replace $SRCDIR with $abs_top_srcdir functions.sh defines $abs_top_srcdir so there's no need to use $SRCDIR in any test scripts. diff --git a/0013-tests-test-read-password-Remove-use-of-SRCDIR.patch b/0013-tests-test-read-password-Remove-use-of-SRCDIR.patch index 6ef088e..0d14568 100644 --- a/0013-tests-test-read-password-Remove-use-of-SRCDIR.patch +++ b/0013-tests-test-read-password-Remove-use-of-SRCDIR.patch @@ -1,7 +1,7 @@ From 92ae65f93d8ebeb09500552d7ebfc1e8149ded6f Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 22 Jun 2023 10:48:51 +0100 -Subject: [PATCH 13/15] tests/test-read-password*: Remove use of $SRCDIR +Subject: [PATCH 13/16] tests/test-read-password*: Remove use of $SRCDIR These tests required exporting $abs_top_srcdir so that the plugin (which is a C script) can use it. diff --git a/0014-tests-Stop-setting-SRCDIR-for-tests.patch b/0014-tests-Stop-setting-SRCDIR-for-tests.patch index d61725d..2ff84a2 100644 --- a/0014-tests-Stop-setting-SRCDIR-for-tests.patch +++ b/0014-tests-Stop-setting-SRCDIR-for-tests.patch @@ -1,7 +1,7 @@ From 2e3dcb2a720e4258b54d04ffd081c5159783df8e Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 22 Jun 2023 10:50:17 +0100 -Subject: [PATCH 14/15] tests: Stop setting $SRCDIR for tests +Subject: [PATCH 14/16] tests: Stop setting $SRCDIR for tests Since no tests use this variable any longer we can stop setting it. diff --git a/0015-tests-Explicitly-add-L.-plugins-ocaml-.libs-to-find-.patch b/0015-tests-Explicitly-add-L.-plugins-ocaml-.libs-to-find-.patch index ca09a13..e1b9e45 100644 --- a/0015-tests-Explicitly-add-L.-plugins-ocaml-.libs-to-find-.patch +++ b/0015-tests-Explicitly-add-L.-plugins-ocaml-.libs-to-find-.patch @@ -1,7 +1,7 @@ From 3e4c1b79a72970c17cb42b21070e61ec634a38bb Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 22 Jun 2023 11:15:27 +0100 -Subject: [PATCH 15/15] tests: Explicitly add -L../plugins/ocaml/.libs to find +Subject: [PATCH 15/16] tests: Explicitly add -L../plugins/ocaml/.libs to find -lnbdkitocaml The actual libnbdkitocaml.so library is located in diff --git a/0016-perl-Call-PERL_SET_CONTEXT-from-.open-method.patch b/0016-perl-Call-PERL_SET_CONTEXT-from-.open-method.patch new file mode 100644 index 0000000..0a12e96 --- /dev/null +++ b/0016-perl-Call-PERL_SET_CONTEXT-from-.open-method.patch @@ -0,0 +1,39 @@ +From 495708e9d1b396ff450df15d5789b4f6c51f6ebc Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Thu, 13 Jul 2023 11:50:02 +0100 +Subject: [PATCH 16/16] perl: Call PERL_SET_CONTEXT from .open method + +This appears to be necessary with Perl 5.38. +--- + plugins/perl/perl.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +diff --git a/plugins/perl/perl.c b/plugins/perl/perl.c +index d3b7cede2..1d8d0c2b4 100644 +--- a/plugins/perl/perl.c ++++ b/plugins/perl/perl.c +@@ -339,6 +339,21 @@ perl_open (int readonly) + SV *sv; + dSP; + ++ /* ++ * From perlembed(1): ++ * ++ * "PERL_SET_CONTEXT(interp) should also be called whenever "interp" ++ * is used by a thread that did not create it (using either ++ * perl_alloc(), or the more esoteric perl_clone())." ++ * ++ * Since we may be called here from a new thread created within ++ * nbdkit, do this. This is necessary since Perl 5.38. It didn't ++ * seem to make a difference with earlier Perl, but doesn't break ++ * them either. ++ */ ++ ++ PERL_SET_CONTEXT (my_perl); ++ + /* We check in perl_config that this callback is defined. */ + ENTER; + SAVETMPS; +-- +2.41.0 + diff --git a/nbdkit.spec b/nbdkit.spec index 5a11bfa..f916994 100644 --- a/nbdkit.spec +++ b/nbdkit.spec @@ -95,6 +95,7 @@ Patch: 0012-tests-Replace-SRCDIR-with-abs_top_srcdir.patch Patch: 0013-tests-test-read-password-Remove-use-of-SRCDIR.patch Patch: 0014-tests-Stop-setting-SRCDIR-for-tests.patch Patch: 0015-tests-Explicitly-add-L.-plugins-ocaml-.libs-to-find-.patch +Patch: 0016-perl-Call-PERL_SET_CONTEXT-from-.open-method.patch BuildRequires: make %if 0%{patches_touch_autotools}