[upstream_utils] Upgrade to fmtlib 11.0.0 (#6796)

This commit is contained in:
Tyler Veness
2024-07-02 13:34:59 -07:00
committed by GitHub
parent 6a5448322b
commit 19ea73ef69
44 changed files with 5463 additions and 4870 deletions

View File

@@ -1,17 +1,17 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Tyler Veness <calcmogul@gmail.com>
Date: Tue, 16 May 2023 13:49:18 -0700
Subject: [PATCH 1/2] Suppress warnings we can't fix
Subject: [PATCH] Suppress warnings we can't fix
---
include/fmt/format.h | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/include/fmt/format.h b/include/fmt/format.h
index 7637c8a0d0687ae3b77a145c2e1ceadf7fe5f67d..bfc6d70d1c5de100b3e413d61f7394cbb3b644f1 100644
index 7c2a19b4084de8f8bb9376d91c9a508f396e50df..ed372239a24466d32d5f81514efbdbe2ddafdba8 100644
--- a/include/fmt/format.h
+++ b/include/fmt/format.h
@@ -1289,7 +1289,14 @@ inline auto equal2(const char* lhs, const char* rhs) -> bool {
@@ -1268,7 +1268,14 @@ inline auto equal2(const char* lhs, const char* rhs) -> bool {
template <typename Char>
FMT_CONSTEXPR20 FMT_INLINE void copy2(Char* dst, const char* src) {
if (!is_constant_evaluated() && sizeof(Char) == sizeof(char)) {

View File

@@ -1,33 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Victor Zverovich <viz@meta.com>
Date: Mon, 29 Jan 2024 07:48:48 -0800
Subject: [PATCH 2/2] Fix tautological-compare warning
---
include/fmt/ranges.h | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/include/fmt/ranges.h b/include/fmt/ranges.h
index 3638fffb83bce6035c13659f26fe13749c8b19ea..767378c6203fc34e7d763075bd663d2bb6774a97 100644
--- a/include/fmt/ranges.h
+++ b/include/fmt/ranges.h
@@ -206,12 +206,13 @@ class is_tuple_formattable_ {
static constexpr const bool value = false;
};
template <typename T, typename C> class is_tuple_formattable_<T, C, true> {
- template <std::size_t... Is>
- static auto check2(index_sequence<Is...>,
- integer_sequence<bool, (Is == Is)...>) -> std::true_type;
- static auto check2(...) -> std::false_type;
- template <std::size_t... Is>
- static auto check(index_sequence<Is...>) -> decltype(check2(
+ template <size_t... Is>
+ static auto all_true(index_sequence<Is...>,
+ integer_sequence<bool, (Is >= 0)...>) -> std::true_type;
+ static auto all_true(...) -> std::false_type;
+
+ template <size_t... Is>
+ static auto check(index_sequence<Is...>) -> decltype(all_true(
index_sequence<Is...>{},
integer_sequence<bool,
(is_formattable<typename std::tuple_element<Is, T>::type,

View File

@@ -5,8 +5,8 @@ Subject: [PATCH 2/4] Use fmtlib
---
include/.styleguide | 1 +
include/sleipnir/util/Print.hpp | 27 ++++++++++++++-------------
2 files changed, 15 insertions(+), 13 deletions(-)
include/sleipnir/util/Print.hpp | 31 ++++++++++++++++++-------------
2 files changed, 19 insertions(+), 13 deletions(-)
diff --git a/include/.styleguide b/include/.styleguide
index 8fb61fdf9cc5ceff633d3126f0579eef25a1326f..6a7f8ed28f9cb037c9746a7e0ef5e110481d9825 100644
@@ -19,10 +19,10 @@ index 8fb61fdf9cc5ceff633d3126f0579eef25a1326f..6a7f8ed28f9cb037c9746a7e0ef5e110
+ ^fmt/
}
diff --git a/include/sleipnir/util/Print.hpp b/include/sleipnir/util/Print.hpp
index 339320bce6d017ca85025060ba445b2f025bb225..fcf2e69bfb5a081cd915bdded3caa80cd9c38518 100644
index 339320bce6d017ca85025060ba445b2f025bb225..a9220cdaadcb9b88862542935bc72781d8389239 100644
--- a/include/sleipnir/util/Print.hpp
+++ b/include/sleipnir/util/Print.hpp
@@ -2,52 +2,53 @@
@@ -2,52 +2,57 @@
#pragma once
@@ -30,7 +30,11 @@ index 339320bce6d017ca85025060ba445b2f025bb225..fcf2e69bfb5a081cd915bdded3caa80c
#include <system_error>
#include <utility>
+#if __has_include(<fmt/base.h>)
+#include <fmt/base.h>
+#else
+#include <fmt/core.h>
+#endif
+
namespace sleipnir {

View File

@@ -13,16 +13,13 @@ from upstream_utils import (
def main():
upstream_root = clone_repo("https://github.com/fmtlib/fmt", "10.2.1")
upstream_root = clone_repo("https://github.com/fmtlib/fmt", "11.0.0")
wpilib_root = get_repo_root()
wpiutil = os.path.join(wpilib_root, "wpiutil")
# Apply patches to upstream Git repo
os.chdir(upstream_root)
for f in [
"0001-Suppress-warnings-we-can-t-fix.patch",
"0002-Fix-tautological-compare-warning.patch",
]:
for f in ["0001-Suppress-warnings-we-can-t-fix.patch"]:
git_am(os.path.join(wpilib_root, "upstream_utils/fmt_patches", f))
# Delete old install