diff --git a/pkgs/servers/foundationdb/default.nix b/pkgs/servers/foundationdb/default.nix index 10d517179c2f..e1cb2e29a05a 100644 --- a/pkgs/servers/foundationdb/default.nix +++ b/pkgs/servers/foundationdb/default.nix @@ -69,6 +69,7 @@ in with builtins; { patches = [ ./patches/ldflags-6.0.patch + ./patches/include-fixes-6.0.patch ]; }; diff --git a/pkgs/servers/foundationdb/patches/include-fixes-6.0.patch b/pkgs/servers/foundationdb/patches/include-fixes-6.0.patch new file mode 100644 index 000000000000..93959def44f8 --- /dev/null +++ b/pkgs/servers/foundationdb/patches/include-fixes-6.0.patch @@ -0,0 +1,137 @@ +diff --git a/fdbrpc/ContinuousSample.h b/fdbrpc/ContinuousSample.h +index 54ff1b109..577c228ae 100644 +--- a/fdbrpc/ContinuousSample.h ++++ b/fdbrpc/ContinuousSample.h +@@ -26,6 +26,7 @@ + #include "flow/IRandom.h" + #include + #include ++#include + + template + class ContinuousSample { +diff --git a/fdbrpc/Smoother.h b/fdbrpc/Smoother.h +index 3ed8e6e98..f3e4504b6 100644 +--- a/fdbrpc/Smoother.h ++++ b/fdbrpc/Smoother.h +@@ -23,6 +23,7 @@ + #pragma once + + #include "flow/flow.h" ++#include + + struct Smoother { + // Times (t) are expected to be nondecreasing +@@ -50,7 +51,7 @@ struct Smoother { + double elapsed = t - time; + if(elapsed) { + time = t; +- estimate += (total-estimate) * (1-exp( -elapsed/eFoldingTime )); ++ estimate += (total-estimate) * (1-std::exp( -elapsed/eFoldingTime )); + } + } + +@@ -83,11 +84,11 @@ struct TimerSmoother { + void update(double t) { + double elapsed = t - time; + time = t; +- estimate += (total-estimate) * (1-exp( -elapsed/eFoldingTime )); ++ estimate += (total-estimate) * (1-std::exp( -elapsed/eFoldingTime )); + } + + double eFoldingTime; + double time, total, estimate; + }; + +-#endif +\ No newline at end of file ++#endif +diff --git a/fdbserver/Knobs.cpp b/fdbserver/Knobs.cpp +index a924bc905..0dc70e7ac 100644 +--- a/fdbserver/Knobs.cpp ++++ b/fdbserver/Knobs.cpp +@@ -20,6 +20,7 @@ + + #include "Knobs.h" + #include "fdbrpc/Locality.h" ++#include + + ServerKnobs const* SERVER_KNOBS = new ServerKnobs(); + +diff --git a/flow/Knobs.cpp b/flow/Knobs.cpp +index 2d706dddd..5dbe08861 100644 +--- a/flow/Knobs.cpp ++++ b/flow/Knobs.cpp +@@ -20,6 +20,7 @@ + + #include "Knobs.h" + #include "flow/flow.h" ++#include + + FlowKnobs const* FLOW_KNOBS = new FlowKnobs(); + +@@ -128,7 +129,7 @@ FlowKnobs::FlowKnobs(bool randomize, bool isSimulated) { + init( MAX_METRICS, 600 ); + init( MAX_METRIC_SIZE, 2500 ); + init( MAX_METRIC_LEVEL, 25 ); +- init( METRIC_LEVEL_DIVISOR, log(4) ); ++ init( METRIC_LEVEL_DIVISOR, std::log(4) ); + init( METRIC_LIMIT_START_QUEUE_SIZE, 10 ); // The queue size at which to start restricting logging by disabling levels + init( METRIC_LIMIT_RESPONSE_FACTOR, 10 ); // The additional queue size at which to disable logging of another level (higher == less restrictive) + +diff --git a/flow/Platform.cpp b/flow/Platform.cpp +index a754c8747..4d47fad32 100644 +--- a/flow/Platform.cpp ++++ b/flow/Platform.cpp +@@ -98,6 +98,8 @@ + #include + /* Needed for crash handler */ + #include ++/* Needed for major() and minor() with recent glibc */ ++#include + #endif + + #ifdef __APPLE__ +diff --git a/flow/Profiler.actor.cpp b/flow/Profiler.actor.cpp +index 4603dcb77..78eda7278 100644 +--- a/flow/Profiler.actor.cpp ++++ b/flow/Profiler.actor.cpp +@@ -35,8 +35,6 @@ + + extern volatile int profilingEnabled; + +-static uint64_t gettid() { return syscall(__NR_gettid); } +- + struct SignalClosure { + void (* func)(int, siginfo_t*, void*, void*); + void *userdata; +diff --git a/flow/TDMetric.actor.h b/flow/TDMetric.actor.h +index 306352c39..fc63e12f9 100755 +--- a/flow/TDMetric.actor.h ++++ b/flow/TDMetric.actor.h +@@ -35,6 +35,7 @@ + #include "genericactors.actor.h" + #include "CompressedInt.h" + #include ++#include + #include + + struct MetricNameRef { +@@ -799,7 +800,7 @@ struct EventMetric : E, ReferenceCounted>, MetricUtilMAX_METRIC_LEVEL-1; + else +- l = std::min(FLOW_KNOBS->MAX_METRIC_LEVEL-1, (int64_t)(::log(1.0/x) / FLOW_KNOBS->METRIC_LEVEL_DIVISOR)); ++ l = std::min(FLOW_KNOBS->MAX_METRIC_LEVEL-1, (int64_t)(std::log(1.0/x) / FLOW_KNOBS->METRIC_LEVEL_DIVISOR)); + + if(!canLog(l)) + return 0; +@@ -1274,7 +1275,7 @@ public: + l = std::min( + FLOW_KNOBS->MAX_METRIC_LEVEL-1, + (int64_t)( +- log((toggleTime - tv.time) / x) / ++ std::log((toggleTime - tv.time) / x) / + FLOW_KNOBS->METRIC_LEVEL_DIVISOR + ) + );