libutil: make backoffTimeouts inline

Commit 5dc847b47b introduced it as a non-inline
function with definition in the header, which can result in linker errors like
the following:

    /build/source/build/lix/libutil/backoff.hh:36: multiple definition of `nix::backoffTimeouts(unsigned int, std::chrono::duration<long, std::ratio<1l, 1000l> >, std::chrono::duration<long, std::ratio<1l, 1000l> >, std::chrono::duration<long, std::ratio<1l, 1000l> >)'; tests/unit/liblixutil-tests.p/libutil_backoff.cc.o:/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-gtest-static-x86_64-unknown-linux-musl-1.17.0-dev/include/gtest/gtest-printers.h:1223: first defined here

This error was observed during trying to bump `lixPackageSets.git` in nixpkgs.
I am not sure why it can't be observed in the in-tree `nixStatic` package but
the definition is wrong in any case.

Change-Id: I6a6a6964e218a03ca2a2e8eddbb72d44e06e904e
This commit is contained in:
Alois Wohlschlager
2025-08-23 11:23:15 +02:00
parent 5dc847b47b
commit 0f50bc452e
+1 -1
View File
@@ -27,7 +27,7 @@ struct BackoffTiming
* The increase factor 2^i is capped at 2^48, the initial backoff value is capped at 30s
* (30000ms) to prevent overflows.
*/
Generator<BackoffTiming> backoffTimeouts(
inline Generator<BackoffTiming> backoffTimeouts(
unsigned int maxAttempts,
std::chrono::milliseconds maxBackoff,
std::chrono::milliseconds initialBackoff,