Add libfmt 10+ support (#11140)

This commit is contained in:
Boris Korzun 2024-01-19 00:25:12 +03:00
parent 9c795c5f52
commit f7a443aea4
6 changed files with 12 additions and 11 deletions

View File

@ -172,7 +172,7 @@ void WorkloadBase::error(const std::string& msg) {
fmt::print(stderr, "[{}] ERROR: {}\n", workloadId, msg);
numErrors++;
if (numErrors > maxErrors && !failed) {
fmt::print(stderr, "[{}] ERROR: Stopping workload after {} errors\n", workloadId, numErrors);
fmt::print(stderr, "[{}] ERROR: Stopping workload after {} errors\n", workloadId, numErrors.load());
failed = true;
}
}

View File

@ -2378,7 +2378,7 @@ int statsProcessMain(Arguments const& args,
fmt::fprintf(fp, "\"txntrace\": %d,", args.txntrace);
fmt::fprintf(fp, "\"txntagging\": %d,", args.txntagging);
fmt::fprintf(fp, "\"txntagging_prefix\": \"%s\",", args.txntagging_prefix);
fmt::fprintf(fp, "\"streaming_mode\": %d,", args.streaming_mode);
fmt::fprintf(fp, "\"streaming_mode\": %d,", static_cast<int>(args.streaming_mode));
fmt::fprintf(fp, "\"disable_ryw\": %d,", args.disable_ryw);
fmt::fprintf(fp, "\"transaction_timeout_db\": %d,", args.transaction_timeout_db);
fmt::fprintf(fp, "\"transaction_timeout_tx\": %d,", args.transaction_timeout_tx);

View File

@ -3025,7 +3025,7 @@ ACTOR Future<Void> validateSpecialSubrangeRead(ReadYourWritesTransaction* ryw,
// Test
RangeResult testResult = wait(ryw->getRange(testBegin, testEnd, limits, Snapshot::True, reverse));
if (testResult != expectedResult) {
fmt::print("Reverse: {}\n", reverse);
fmt::print("Reverse: {}\n", static_cast<bool>(reverse));
fmt::print("Original range: [{}, {})\n", begin.toString(), end.toString());
fmt::print("Original result:\n");
for (const auto& kr : result) {

View File

@ -585,8 +585,8 @@ ACTOR Future<Void> updateGranuleSplitState(Transaction* tr,
fmt::print("Updating granule {0} split state from {1} {2} -> {3}\n",
currentGranuleID.toString(),
parentGranuleID.toString(),
currentState,
newState);
static_cast<int>(currentState),
static_cast<int>(newState));
}
Key myStateKey = blobGranuleSplitKeyFor(parentGranuleID, currentGranuleID);
@ -631,8 +631,8 @@ ACTOR Future<Void> updateGranuleSplitState(Transaction* tr,
fmt::print("Ignoring granule {0} split state from {1} {2} -> {3}\n",
currentGranuleID.toString(),
parentGranuleID.toString(),
currentState,
newState);
static_cast<int>(currentState),
static_cast<int>(newState));
}
return Void();
@ -5442,7 +5442,7 @@ ACTOR Future<Void> blobWorkerCore(BlobWorkerInterface bwInterf, Reference<BlobWo
assignReq.keyRange.end.printable(),
assignReq.managerEpoch,
assignReq.managerSeqno,
assignReq.type);
static_cast<int>(assignReq.type));
}
if (self->managerEpochOk(assignReq.managerEpoch)) {

View File

@ -3639,7 +3639,7 @@ ACTOR Future<std::pair<ChangeFeedStreamReply, bool>> getChangeFeedMutations(Stor
req.rangeID.printable().substr(0, 6),
req.id.toString().substr(0, 8),
foundVersion ? "key" : "version",
DEBUG_CF_MISSING_VERSION,
static_cast<int64_t>(DEBUG_CF_MISSING_VERSION),
req.range.begin.printable(),
req.range.end.printable(),
req.begin,
@ -3659,7 +3659,7 @@ ACTOR Future<std::pair<ChangeFeedStreamReply, bool>> getChangeFeedMutations(Stor
data->thisServerID.toString().substr(0, 4),
req.rangeID.printable().substr(0, 6),
req.id.toString().substr(0, 8),
DEBUG_CF_MISSING_VERSION,
static_cast<int64_t>(DEBUG_CF_MISSING_VERSION),
req.range.begin.printable(),
req.range.end.printable(),
req.begin,

View File

@ -216,7 +216,8 @@ int main(int argc, char** argv) {
fmt::print(stderr, "ERROR: unknown option '{}'\n", args.OptionText());
return FDB_EXIT_ERROR;
default:
fmt::print(stderr, "ERROR: unknown error {} with option '{}'\n", err, args.OptionText());
fmt::print(
stderr, "ERROR: unknown error {} with option '{}'\n", static_cast<int>(err), args.OptionText());
return FDB_EXIT_ERROR;
}
} else {