From f2c92ce30130bfc377ad39e62e8966fd3f29fa5a Mon Sep 17 00:00:00 2001 From: Yuanyuan Chen Date: Mon, 15 Dec 2025 18:05:05 +0800 Subject: [PATCH] Fix BSD builds Signed-off-by: cyy --- tensorpipe/common/system.cc | 5 ++++- tensorpipe/test/common/defs_test.cc | 2 ++ tensorpipe/test/peer_group.h | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tensorpipe/common/system.cc b/tensorpipe/common/system.cc index 9e5751960..1a640c9f4 100644 --- a/tensorpipe/common/system.cc +++ b/tensorpipe/common/system.cc @@ -101,7 +101,10 @@ std::string getPathForLinuxNamespace(LinuxNamespace ns) { } return oss.str(); } - +#else +optional getBootIDInternal() { + return {}; +} #endif } // namespace diff --git a/tensorpipe/test/common/defs_test.cc b/tensorpipe/test/common/defs_test.cc index cd67e64f5..1b39c335b 100644 --- a/tensorpipe/test/common/defs_test.cc +++ b/tensorpipe/test/common/defs_test.cc @@ -14,7 +14,9 @@ TEST(Defs, Exception) { EXPECT_THROW(TP_THROW_EINVAL(), std::invalid_argument); EXPECT_THROW(TP_THROW_EINVAL() << "hola", std::invalid_argument); EXPECT_THROW(TP_THROW_EINVAL() << "adioshola", std::invalid_argument); +#if !defined(__FreeBSD__) EXPECT_THROW(TP_THROW_SYSTEM(ENODATA) << "adioshola", std::system_error); +#endif EXPECT_THROW(TP_THROW_SYSTEM(EBUSY), std::system_error); EXPECT_THROW(TP_THROW_SYSTEM(EBUSY) << "my message", std::system_error); } diff --git a/tensorpipe/test/peer_group.h b/tensorpipe/test/peer_group.h index 0bae41403..390396f9a 100644 --- a/tensorpipe/test/peer_group.h +++ b/tensorpipe/test/peer_group.h @@ -15,6 +15,7 @@ #include #include +#include #include #include