Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fmt] Update to 11.1.0 #42936

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

3 changes: 1 addition & 2 deletions ports/fmt/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO fmtlib/fmt
REF "${VERSION}"
SHA512 47ff6d289dcc22681eea6da465b0348172921e7cafff8fd57a1540d3232cc6b53250a4625c954ee0944c87963b17680ecbc3ea123e43c2c822efe0dc6fa6cef3
SHA512 9ade20cedd848c6128fbbc725c62de13cf575ee2261eb469e31653a74bcd0e5473e755c3e25d3623c725faf76bdffaae9399b23987198dd2d96237f51f8dc88f
HEAD_REF master
PATCHES
fix-write-batch.patch
fix-pass-utf-8-only-if-the-compiler-is-MSVC-at-build.patch # remove in next release
)

vcpkg_cmake_configure(
Expand Down
3 changes: 1 addition & 2 deletions ports/fmt/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "fmt",
"version": "11.0.2",
"port-version": 1,
"version": "11.1.0",
"description": "{fmt} is an open-source formatting library providing a fast and safe alternative to C stdio and C++ iostreams.",
"homepage": "https://github.com/fmtlib/fmt",
"license": "MIT",
Expand Down
7 changes: 7 additions & 0 deletions ports/spdlog/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
vcpkg_download_distfile(FMT_PATCH
URLS https://github.com/gabime/spdlog/pull/3301/commits/e693420a38b58d29a56b3ea921e15b175a5f2843.patch?full_index=1
FILENAME fix-fmt-e693420a38b58d29a56b3ea921e15b175a5f2843.patch
SHA512 03871e96d5d7059066f1a671381578a9430cdd26221cec9f1193d047e16b582c320511da7bce7c939301c634d1a677ff6121dffa465d32c35b3e9ee89cb3ab49
)

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO gabime/spdlog
Expand All @@ -6,6 +12,7 @@ vcpkg_from_github(
HEAD_REF v1.x
PATCHES
fix-msvc-utf8.patch
"${FMT_PATCH}"
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
Expand Down
2 changes: 1 addition & 1 deletion ports/spdlog/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "spdlog",
"version-semver": "1.15.0",
"port-version": 1,
"port-version": 2,
"description": "Very fast, header-only/compiled, C++ logging library.",
"homepage": "https://github.com/gabime/spdlog",
"license": "MIT",
Expand Down
100 changes: 92 additions & 8 deletions ports/wpilib/fix-build-error-with-fmt11.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/ntcore/src/dev/native/cpp/main.cpp b/ntcore/src/dev/native/cpp/main.cpp
index 6e43fdb..ad93644 100644
index d724bbe..425bc4d 100644
--- a/ntcore/src/dev/native/cpp/main.cpp
+++ b/ntcore/src/dev/native/cpp/main.cpp
@@ -13,6 +13,7 @@
Expand All @@ -10,6 +10,82 @@ index 6e43fdb..ad93644 100644
#include <wpi/Synchronization.h>
#include <wpi/timestamp.h>

diff --git a/ntcore/src/main/native/cpp/LocalStorage.cpp b/ntcore/src/main/native/cpp/LocalStorage.cpp
index 7d1c3e4..0bf2711 100644
--- a/ntcore/src/main/native/cpp/LocalStorage.cpp
+++ b/ntcore/src/main/native/cpp/LocalStorage.cpp
@@ -10,6 +10,7 @@
#include <wpi/SmallString.h>
#include <wpi/StringExtras.h>
#include <wpi/json.h>
+#include <fmt/ranges.h>

#include "IListenerStorage.h"
#include "Log.h"
diff --git a/ntcore/src/main/native/cpp/net/ServerImpl.cpp b/ntcore/src/main/native/cpp/net/ServerImpl.cpp
index 0a9071d..9917605 100644
--- a/ntcore/src/main/native/cpp/net/ServerImpl.cpp
+++ b/ntcore/src/main/native/cpp/net/ServerImpl.cpp
@@ -20,6 +20,7 @@
#include <wpi/json.h>
#include <wpi/raw_ostream.h>
#include <wpi/timestamp.h>
+#include <fmt/ranges.h>

#include "IConnectionList.h"
#include "Log.h"
diff --git a/wpimath/src/main/native/include/frc/geometry/Translation2d.h b/wpimath/src/main/native/include/frc/geometry/Translation2d.h
index 9d9a77c..60a58ec 100644
--- a/wpimath/src/main/native/include/frc/geometry/Translation2d.h
+++ b/wpimath/src/main/native/include/frc/geometry/Translation2d.h
@@ -87,7 +87,7 @@ class WPILIB_DLLEXPORT Translation2d {
*
* @return A Vector representation of this translation.
*/
- constexpr Eigen::Vector2d ToVector() const;
+ inline Eigen::Vector2d ToVector() const;

/**
* Returns the norm, or distance from the origin to the translation.
diff --git a/wpimath/src/main/native/include/frc/geometry/Translation2d.inc b/wpimath/src/main/native/include/frc/geometry/Translation2d.inc
index 6b291e1..30ddcd4 100644
--- a/wpimath/src/main/native/include/frc/geometry/Translation2d.inc
+++ b/wpimath/src/main/native/include/frc/geometry/Translation2d.inc
@@ -16,7 +16,7 @@ constexpr Translation2d::Translation2d(units::meter_t distance,
const Rotation2d& angle)
: m_x{distance * angle.Cos()}, m_y{distance * angle.Sin()} {}

-constexpr Eigen::Vector2d Translation2d::ToVector() const {
+Eigen::Vector2d Translation2d::ToVector() const {
return Eigen::Vector2d{{m_x.value(), m_y.value()}};
}

diff --git a/wpimath/src/main/native/include/frc/geometry/Translation3d.h b/wpimath/src/main/native/include/frc/geometry/Translation3d.h
index b83b661..fa4d4d2 100644
--- a/wpimath/src/main/native/include/frc/geometry/Translation3d.h
+++ b/wpimath/src/main/native/include/frc/geometry/Translation3d.h
@@ -94,7 +94,7 @@ class WPILIB_DLLEXPORT Translation3d {
*
* @return A Vector representation of this translation.
*/
- constexpr Eigen::Vector3d ToVector() const;
+ inline Eigen::Vector3d ToVector() const;

/**
* Returns the norm, or distance from the origin to the translation.
diff --git a/wpimath/src/main/native/include/frc/geometry/Translation3d.inc b/wpimath/src/main/native/include/frc/geometry/Translation3d.inc
index 19268e6..2ec96f3 100644
--- a/wpimath/src/main/native/include/frc/geometry/Translation3d.inc
+++ b/wpimath/src/main/native/include/frc/geometry/Translation3d.inc
@@ -19,7 +19,7 @@ constexpr Translation2d Translation3d::ToTranslation2d() const {
return Translation2d{m_x, m_y};
}

-constexpr Eigen::Vector3d Translation3d::ToVector() const {
+Eigen::Vector3d Translation3d::ToVector() const {
return Eigen::Vector3d{{m_x.value(), m_y.value(), m_z.value()}};
}

diff --git a/wpiutil/examples/printlog/printlog.cpp b/wpiutil/examples/printlog/printlog.cpp
index cb89934..4fe4817 100644
--- a/wpiutil/examples/printlog/printlog.cpp
Expand All @@ -23,14 +99,22 @@ index cb89934..4fe4817 100644
#include "wpi/DataLogReader.h"
#include "wpi/DenseMap.h"
diff --git a/wpiutil/src/main/native/include/wpi/Logger.h b/wpiutil/src/main/native/include/wpi/Logger.h
index 01a02fd..bd524a9 100644
index 01a02fd..45b576d 100644
--- a/wpiutil/src/main/native/include/wpi/Logger.h
+++ b/wpiutil/src/main/native/include/wpi/Logger.h
@@ -9,6 +9,7 @@
#include <utility>

#include <fmt/format.h>
+#include <fmt/ranges.h>
@@ -66,11 +66,10 @@ class Logger {
#pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments"
#endif

namespace wpi {
-#define WPI_LOG(logger_inst, level, format, ...) \
- if ((logger_inst).HasLogger() && level >= (logger_inst).min_level()) { \
- (logger_inst) \
- .Log(level, __FILE__, __LINE__, \
- FMT_STRING(format) __VA_OPT__(, ) __VA_ARGS__); \
+#define WPI_LOG(logger_inst, level, format, ...) \
+ if ((logger_inst).HasLogger() && level >= (logger_inst).min_level()) { \
+ (logger_inst) \
+ .Log(level, __FILE__, __LINE__, format __VA_OPT__(, ) __VA_ARGS__); \
}

#define WPI_ERROR(inst, format, ...) \
13 changes: 13 additions & 0 deletions ports/wpilib/fix-dep.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 79df359..17e0edc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -213,7 +213,7 @@ endif()

find_package(LIBSSH 0.7.1)

-find_package(Protobuf REQUIRED)
+find_package(protobuf CONFIG REQUIRED)

set(APRILTAG_DEP_REPLACE "find_dependency(apriltag)")
set(CAMERASERVER_DEP_REPLACE_IMPL "find_dependency(cameraserver)")
44 changes: 0 additions & 44 deletions ports/wpilib/fix-usage.patch

This file was deleted.

12 changes: 0 additions & 12 deletions ports/wpilib/missing-find_dependency.patch

This file was deleted.

15 changes: 0 additions & 15 deletions ports/wpilib/no-werror.patch

This file was deleted.

12 changes: 6 additions & 6 deletions ports/wpilib/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
string(REPLACE "-0" "." temp_date ${VERSION})
string(REPLACE "-" "." formatted_date ${temp_date})

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO wpilibsuite/allwpilib
REF 165ebe4c79c437c7ba6c03af4a88a8c8680f742a
SHA512 f6ee07db0a119a7ac5876c4b0cf74abfb6af635d3d3ba913300138c450f62f6595ac4849bc499346f9f0179cc563f548a5e8a9a47122af593b425af453afd99f
REF "v${formatted_date}"
SHA512 ce62bb225132aba6f22d45fce8a1a3f55d92a61a61187efd09d47a0e0c351125949ed41cc5cee0d69b5bb5b71baacfa45a9e19a33f7e69d3ae63a11e47257da4
PATCHES
no-werror.patch
windows-install-location.patch
missing-find_dependency.patch
fix-usage.patch
fix-build-error-with-fmt11.patch
fix-dep.patch
)

if("allwpilib" IN_LIST FEATURES)
Expand Down
3 changes: 1 addition & 2 deletions ports/wpilib/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "wpilib",
"version-date": "2023-08-24",
"port-version": 1,
"version-date": "2024-03-02",
"description": "WPILib is the software library package for the FIRST Robotics Competition. The core install includes wpiutil, a common utilies library, and ntcore, the base NetworkTables library.",
"homepage": "https://github.com/wpilibsuite/allwpilib",
"license": null,
Expand Down
Loading
Loading