On EPEL9, disable doctests that require a newer Rust compiler

epel10
Benjamin A. Beasley 5 months ago
parent 423121f9a8
commit 58ad727144

@ -0,0 +1,30 @@
From 82676b976a5a6397eda4e83bcbf9af8953bfbdf3 Mon Sep 17 00:00:00 2001
From: "Benjamin A. Beasley" <code@musicinmybrain.net>
Date: Thu, 19 Sep 2024 06:59:15 -0400
Subject: [PATCH] EPEL9: Ignore doctests that require very recent Rust
compilers
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
In this crate, doctests and examples (but not the lib and integration tests) are allowed to use Rust features from versions newer than the MSRV. Its therefore necessary to ignore some of them on EPEL9. If this patch becomes too unwieldy, we could choose to start skipping doctests and/or examples there entirely.
---
src/lib.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lib.rs b/src/lib.rs
index b058186..5e791fd 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -262,7 +262,7 @@ println!("{zdt}");
You can eliminate the possibility of a panic at runtime by using `time` in
a `const` block:
-```
+```ignore
use jiff::{civil::time, Zoned};
let zdt = Zoned::now().with().time(const { time(14, 0, 0, 0) }).build()?;
--
2.46.0

@ -1,5 +1,5 @@
--- jiff-0.1.13/Cargo.toml 1970-01-01T00:00:01+00:00
+++ jiff-0.1.13/Cargo.toml 2024-09-07T16:28:22.842511+00:00
+++ jiff-0.1.13/Cargo.toml 2024-09-19T11:24:01.514919+00:00
@@ -126,46 +126,22 @@
"tzdb-zoneinfo",
]

@ -1,5 +1,5 @@
--- jiff-0.1.13/Cargo.toml 1970-01-01T00:00:01+00:00
+++ jiff-0.1.13/Cargo.toml 2024-09-07T16:28:27.885572+00:00
+++ jiff-0.1.13/Cargo.toml 2024-09-19T11:24:03.829950+00:00
@@ -142,6 +142,3 @@
]
tzdb-zoneinfo = ["std"]

@ -20,6 +20,13 @@ Patch: jiff-fix-metadata.diff
# * Downstream-only: Omit doctests that require hifitime. It is not worth
# packaging it solely for a couple of tiny examples.
Patch10: 0001-Downstream-only-Omit-doctests-that-require-hifitime.patch
# * EPEL9: Ignore doctests that require very recent Rust compilers
# * In this crate, doctests and examples (but not the lib and integration tests)
# are allowed to use Rust features from versions newer than the MSRV. Its
# therefore necessary to ignore some of them on EPEL9. If this patch becomes
# too unwieldy, we could choose to start skipping doctests and/or examples
# there entirely.
Patch1009: 0001-EPEL9-Ignore-doctests-that-require-very-recent-Rust-.patch
BuildRequires: cargo-rpm-macros >= 24
BuildRequires: tomcli
@ -147,7 +154,14 @@ use the "tzdb-zoneinfo" feature of the "%{crate}" crate.
%ghost %{crate_instdir}/Cargo.toml
%prep
%autosetup -n %{crate}-%{version} -p1
%autosetup -n %{crate}-%{version} -N
# NOTE: The -p1 in %%autosetup, above, must be replaced with -N so that we can
# do conditional patching, below.
%autopatch -M 999 -p1
# We reserved patch number 1000+<N> for EPEL<N>.
%if 0%{?el9}
%patch -P 1009 -p1
%endif
%cargo_prep
# Exclude test and debug scripts that would BuildRequire sh or bash
tomcli set Cargo.toml append package.exclude test test-wasm 'scripts/*'

@ -30,12 +30,40 @@ comments = [
It is not worth packaging it solely for a couple of tiny examples.\
""",
]
[[package.extra-patches]]
number = 1009
file = "0001-EPEL9-Ignore-doctests-that-require-very-recent-Rust-.patch"
comments = [
"EPEL9: Ignore doctests that require very recent Rust compilers",
"""\
In this crate, doctests and examples (but not the lib and integration tests) \
are allowed to use Rust features from versions newer than the MSRV. Its \
therefore necessary to ignore some of them on EPEL9. If this patch becomes too \
unwieldy, we could choose to start skipping doctests and/or examples there \
entirely.\
""",
]
[requires]
build = [
"tomcli",
]
[scripts.prep]
pre = [
"# NOTE: The -p1 in %%autosetup, above, must be replaced with -N so that we can",
"# do conditional patching, below.",
"%autopatch -M 999 -p1",
"# We reserved patch number 1000+<N> for EPEL<N>.",
"%if 0%{?el9}",
# EPEL9 rpm does not support "%patch <N>", and would quietly attempt and
# fail to re-apply Patch0 instead of applying the desired patch. We *need*
# to use "%patch -P <N>" instead.
"%patch -P 1009 -p1",
"%endif",
]
post = [
"# Exclude test and debug scripts that would BuildRequire sh or bash",
"tomcli set Cargo.toml append package.exclude test test-wasm 'scripts/*'",

Loading…
Cancel
Save