From 0f50bc452ef0f5b988a2ae4794837fdb2bf19f61 Mon Sep 17 00:00:00 2001 From: Alois Wohlschlager Date: Sat, 23 Aug 2025 11:23:15 +0200 Subject: [PATCH] libutil: make backoffTimeouts inline Commit 5dc847b47b4e0e970d6a1cf2da0abd7a4e1bad2e 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 >, std::chrono::duration >, std::chrono::duration >)'; 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 --- lix/libutil/backoff.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lix/libutil/backoff.hh b/lix/libutil/backoff.hh index e4a97163d..81757baca 100644 --- a/lix/libutil/backoff.hh +++ b/lix/libutil/backoff.hh @@ -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 backoffTimeouts( +inline Generator backoffTimeouts( unsigned int maxAttempts, std::chrono::milliseconds maxBackoff, std::chrono::milliseconds initialBackoff,