diff mbox series

[v2] fmt: Get rid of std::copy

Message ID 20240829165850.518504-1-raj.khem@gmail.com
State Accepted, archived
Commit 9549d4aeb3dc1abb81fd6d01a340a2f99b69fdba
Headers show
Series [v2] fmt: Get rid of std::copy | expand

Commit Message

Khem Raj Aug. 29, 2024, 4:58 p.m. UTC
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
v2: Use an upstream fix instead of own

 .../fmt/fmt/0001-Get-rid-of-std-copy.patch    | 52 +++++++++++++++++++
 meta/recipes-devtools/fmt/fmt_11.0.2.bb       |  4 +-
 2 files changed, 55 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-devtools/fmt/fmt/0001-Get-rid-of-std-copy.patch

Comments

patchtest@automation.yoctoproject.org Aug. 29, 2024, 5:19 p.m. UTC | #1
Thank you for your submission. Patchtest identified one
or more issues with the patch. Please see the log below for
more information:

---
Testing patch /home/patchtest/share/mboxes/v2-fmt-Get-rid-of-std-copy.patch

FAIL: test commit message presence: Please include a commit message on your patch explaining the change (test_mbox.TestMbox.test_commit_message_presence)

PASS: pretest src uri left files (test_metadata.TestMetadata.pretest_src_uri_left_files)
PASS: test CVE check ignore (test_metadata.TestMetadata.test_cve_check_ignore)
PASS: test CVE tag format (test_patch.TestPatch.test_cve_tag_format)
PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test Signed-off-by presence (test_patch.TestPatch.test_signed_off_by_presence)
PASS: test Upstream-Status presence (test_patch.TestPatch.test_upstream_status_presence_format)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test lic files chksum modified not mentioned (test_metadata.TestMetadata.test_lic_files_chksum_modified_not_mentioned)
PASS: test max line length (test_metadata.TestMetadata.test_max_line_length)
PASS: test mbox format (test_mbox.TestMbox.test_mbox_format)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test shortlog format (test_mbox.TestMbox.test_shortlog_format)
PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
PASS: test src uri left files (test_metadata.TestMetadata.test_src_uri_left_files)

SKIP: pretest pylint: No python related patches, skipping test (test_python_pylint.PyLint.pretest_pylint)
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
SKIP: test lic files chksum presence: No added recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_presence)
SKIP: test license presence: No added recipes, skipping test (test_metadata.TestMetadata.test_license_presence)
SKIP: test pylint: No python related patches, skipping test (test_python_pylint.PyLint.test_pylint)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)
SKIP: test summary presence: No added recipes, skipping test (test_metadata.TestMetadata.test_summary_presence)
SKIP: test target mailing list: Series merged, no reason to check other mailing lists (test_mbox.TestMbox.test_target_mailing_list)

---

Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this
email with an explanation of why the patch should be accepted. If you
believe these results are due to an error in patchtest, please submit a
bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category
under 'Yocto Project Subprojects'). For more information on specific
failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank
you!
diff mbox series

Patch

diff --git a/meta/recipes-devtools/fmt/fmt/0001-Get-rid-of-std-copy.patch b/meta/recipes-devtools/fmt/fmt/0001-Get-rid-of-std-copy.patch
new file mode 100644
index 00000000000..1b495ea075c
--- /dev/null
+++ b/meta/recipes-devtools/fmt/fmt/0001-Get-rid-of-std-copy.patch
@@ -0,0 +1,52 @@ 
+From 6e462b89aa22fd5f737ed162d0150e145ccb1914 Mon Sep 17 00:00:00 2001
+From: Victor Zverovich <viz@meta.com>
+Date: Mon, 29 Jul 2024 15:58:05 -0700
+Subject: [PATCH] Get rid of std::copy
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Backport [https://github.com/fmtlib/fmt/commit/6e462b89aa22fd5f737ed162d0150e145ccb1914]
+---
+ include/fmt/color.h | 11 +++++------
+ 1 file changed, 5 insertions(+), 6 deletions(-)
+
+diff --git a/include/fmt/color.h b/include/fmt/color.h
+index f0e9dd94..231d93c8 100644
+--- a/include/fmt/color.h
++++ b/include/fmt/color.h
+@@ -560,31 +560,30 @@ struct formatter<detail::styled_arg<T>, Char> : formatter<T, Char> {
+   auto format(const detail::styled_arg<T>& arg, FormatContext& ctx) const
+       -> decltype(ctx.out()) {
+     const auto& ts = arg.style;
+-    const auto& value = arg.value;
+     auto out = ctx.out();
+ 
+     bool has_style = false;
+     if (ts.has_emphasis()) {
+       has_style = true;
+       auto emphasis = detail::make_emphasis<Char>(ts.get_emphasis());
+-      out = std::copy(emphasis.begin(), emphasis.end(), out);
++      out = detail::copy<Char>(emphasis.begin(), emphasis.end(), out);
+     }
+     if (ts.has_foreground()) {
+       has_style = true;
+       auto foreground =
+           detail::make_foreground_color<Char>(ts.get_foreground());
+-      out = std::copy(foreground.begin(), foreground.end(), out);
++      out = detail::copy<Char>(foreground.begin(), foreground.end(), out);
+     }
+     if (ts.has_background()) {
+       has_style = true;
+       auto background =
+           detail::make_background_color<Char>(ts.get_background());
+-      out = std::copy(background.begin(), background.end(), out);
++      out = detail::copy<Char>(background.begin(), background.end(), out);
+     }
+-    out = formatter<T, Char>::format(value, ctx);
++    out = formatter<T, Char>::format(arg.value, ctx);
+     if (has_style) {
+       auto reset_color = string_view("\x1b[0m");
+-      out = std::copy(reset_color.begin(), reset_color.end(), out);
++      out = detail::copy<Char>(reset_color.begin(), reset_color.end(), out);
+     }
+     return out;
+   }
diff --git a/meta/recipes-devtools/fmt/fmt_11.0.2.bb b/meta/recipes-devtools/fmt/fmt_11.0.2.bb
index 5a7041088cd..5c60921efae 100644
--- a/meta/recipes-devtools/fmt/fmt_11.0.2.bb
+++ b/meta/recipes-devtools/fmt/fmt_11.0.2.bb
@@ -4,7 +4,9 @@  HOMEPAGE = "https://fmt.dev"
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=b9257785fc4f3803a4b71b76c1412729"
 
-SRC_URI = "git://github.com/fmtlib/fmt;branch=master;protocol=https"
+SRC_URI = "git://github.com/fmtlib/fmt;branch=master;protocol=https \
+           file://0001-Get-rid-of-std-copy.patch \
+           "
 SRCREV = "0c9fce2ffefecfdce794e1859584e25877b7b592"
 
 S = "${WORKDIR}/git"