On Fri, Feb 25, 2022 at 03:29:52AM +0300, Andrew Krasavin wrote:
> On Thu, Feb 24, 2022 at 09:29:13AM +0100, Omar Polo wrote:
> > Hello,
> >
> > the patch is malformed and don't apply :/
> >
> > Patching file Makefile using Plan A...
> > patch: **** malformed patch at line 52: @@ -99,6 +100,19 @@ CONFIGURE_ARGS
> > += -DCMAKE_CXX_STANDARD=17
> >
> > Just a quick comment thought, the `find | xargs ls' machinery in
> > pre-test is quite fragile and will break if we forget to sync it with
> > the next update (or if we need to bump only some of the libraries.)
> > Assuming that it's required for the tests (I haven't looked into it yet)
> > I'd either go with "*\.so\..\.." or *\.so\.*\.*, or something along
> > these lines.
> >
> > Thanks
>
> Oh, I'm sorry. It's not the first time this has happened with me( I
> promise to make an effort and be careful not to send any more
> corrupted diffs.
> I also apologize for the late response.
>
> Thank you for your comment, I fixed it as you suggested.
Here's a diff that applies (needs `sed 's,^ , ,'` to strip leading
spaces).
sparc64 fails to build with this, I can look into fixing this later:
/usr/ports/pobj/abseil-cpp-20211102.0/bin/c++
-DGTEST_LINKED_AS_SHARED_LIBRARY=1
-I/usr/ports/pobj/abseil-cpp-20211102.0/abseil-cpp-20211102.0 -isystem
/usr/local/include -O2 -pipe -DNDEBUG -Wall -Wextra -Wcast-qual
-Wconversion-null -Wformat-security -Wmissing-declarations -Woverlength-strings
-Wpointer-arith -Wundef -Wunused-local-typedefs -Wunused-result -Wvarargs -Wvla
-Wwrite-strings -DNOMINMAX -Wno-conversion-null -Wno-deprecated-declarations
-Wno-missing-declarations -Wno-sign-compare -Wno-unused-function
-Wno-unused-parameter -Wno-unused-private-field -std=gnu++17 -MD -MT
absl/hash/CMakeFiles/absl_hash_test.dir/hash_test.cc.o -MF
absl/hash/CMakeFiles/absl_hash_test.dir/hash_test.cc.o.d -o
absl/hash/CMakeFiles/absl_hash_test.dir/hash_test.cc.o -c
/usr/ports/pobj/abseil-cpp-20211102.0/abseil-cpp-20211102.0/absl/hash/hash_test.cc
/usr/ports/pobj/abseil-cpp-20211102.0/abseil-cpp-20211102.0/absl/hash/hash_test.cc:
In instantiation of 'struct
{anonymous}::IsAggregateInitializable<absl::lts_20211102::hash_internal::Hash<{anonymous}::IsHashableTest_PoisonHash_Test::TestBody()::X>
>':
/usr/ports/pobj/abseil-cpp-20211102.0/abseil-cpp-20211102.0/absl/hash/hash_test.cc:639:3:
required from here
/usr/ports/pobj/abseil-cpp-20211102.0/abseil-cpp-20211102.0/absl/hash/hash_test.cc:614:22:
error: use of deleted function
'absl::lts_20211102::hash_internal::PoisonedHash::PoisonedHash()'
: std::true_type {};
^
In file included from
/usr/ports/pobj/abseil-cpp-20211102.0/abseil-cpp-20211102.0/absl/hash/hash.h:78,
from
/usr/ports/pobj/abseil-cpp-20211102.0/abseil-cpp-20211102.0/absl/hash/hash_test.cc:15:
/usr/ports/pobj/abseil-cpp-20211102.0/abseil-cpp-20211102.0/absl/hash/internal/hash.h:1021:3:
note: declared here
PoisonedHash() = delete;
^~~~~~~~~~~~
/usr/ports/pobj/abseil-cpp-20211102.0/abseil-cpp-20211102.0/absl/hash/hash_test.cc:614:22:
error: use of deleted function
'absl::lts_20211102::hash_internal::PoisonedHash::PoisonedHash()'
: std::true_type {};
^
In file included from
/usr/ports/pobj/abseil-cpp-20211102.0/abseil-cpp-20211102.0/absl/hash/hash.h:78,
from
/usr/ports/pobj/abseil-cpp-20211102.0/abseil-cpp-20211102.0/absl/hash/hash_test.cc:15:
/usr/ports/pobj/abseil-cpp-20211102.0/abseil-cpp-20211102.0/absl/hash/internal/hash.h:1021:3:
note: declared here
PoisonedHash() = delete;
^~~~~~~~~~~~
Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/abseil-cpp/Makefile,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 Makefile
--- Makefile 18 Dec 2021 19:38:17 -0000 1.1.1.1
+++ Makefile 25 Feb 2022 16:41:23 -0000
@@ -1,6 +1,7 @@
# $OpenBSD: Makefile,v 1.1.1.1 2021/12/18 19:38:17 kn Exp $
COMMENT = abseil common libraries (c++)
+REVISION = 0
CATEGORIES = devel
GH_ACCOUNT = abseil
@@ -99,6 +100,19 @@ CONFIGURE_ARGS += -DCMAKE_CXX_STANDARD=1
# to ensure that our project builds correctly.
CONFIGURE_ARGS += -DABSL_PROPAGATE_CXX_STD:BOOL=ON
-NO_TEST = Yes
+# use googletest from ports
+CONFIGURE_ARGS +=
-DABSL_USE_EXTERNAL_GOOGLETEST:BOOL=${LOCALBASE}/include/gtest
+# turn on tests builds
+CONFIGURE_ARGS += -DBUILD_TESTING:BOOL=ON
+
+# use TEST_TMPDIR instead of /tmp for tests temp data (like in bazel build)
+TEST_ENV += TEST_TMPDIR=${WRKBUILD}/test_tmp \
+ LD_LIBRARY_PATH=/usr/lib:${WRKBUILD}/test_lib
+
+pre-test:
+ @mkdir -p ${WRKBUILD}/test_tmp
+ @mkdir -p ${WRKBUILD}/test_lib
+ cd ${WRKBUILD}/test_lib && \
+ find ${WRKBUILD} -name "*\.so\.*\.*" | xargs -I {} ln -s {} .
.include <bsd.port.mk>
Index: patches/patch-absl_base_internal_raw_logging_cc
===================================================================
RCS file: patches/patch-absl_base_internal_raw_logging_cc
diff -N patches/patch-absl_base_internal_raw_logging_cc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-absl_base_internal_raw_logging_cc 25 Feb 2022 16:41:23
-0000
@@ -0,0 +1,23 @@
+$OpenBSD$
+
+Index: absl/base/internal/raw_logging.cc
+--- absl/base/internal/raw_logging.cc.orig
++++ absl/base/internal/raw_logging.cc
+@@ -36,7 +36,7 @@
+ // This preprocessor token is also defined in raw_io.cc. If you need to copy
+ // this, consider moving both to config.h instead.
+ #if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \
+- defined(__Fuchsia__) || defined(__native_client__) || \
++ defined(__Fuchsia__) || defined(__native_client__) ||
defined(__OpenBSD__) || \
+ defined(__EMSCRIPTEN__) || defined(__ASYLO__)
+
+ #include <unistd.h>
+@@ -50,7 +50,7 @@
+ // ABSL_HAVE_SYSCALL_WRITE is defined when the platform provides the syscall
+ // syscall(SYS_write, /*int*/ fd, /*char* */ buf, /*size_t*/ len);
+ // for low level operations that want to avoid libc.
+-#if (defined(__linux__) || defined(__FreeBSD__)) && !defined(__ANDROID__)
++#if (defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__)) &&
!defined(__ANDROID__)
+ #include <sys/syscall.h>
+ #define ABSL_HAVE_SYSCALL_WRITE 1
+ #define ABSL_LOW_LEVEL_WRITE_SUPPORTED 1
Index: patches/patch-absl_debugging_CMakeLists_txt
===================================================================
RCS file: patches/patch-absl_debugging_CMakeLists_txt
diff -N patches/patch-absl_debugging_CMakeLists_txt
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-absl_debugging_CMakeLists_txt 25 Feb 2022 16:41:23 -0000
@@ -0,0 +1,56 @@
+$OpenBSD$
+
+Disable all tests that require a leak sanitizer because
+OpenBSD does not support it.
+
+Index: absl/debugging/CMakeLists.txt
+--- absl/debugging/CMakeLists.txt.orig
++++ absl/debugging/CMakeLists.txt
+@@ -225,6 +225,7 @@ absl_cc_library(
+ PUBLIC
+ )
+
++if (NOT CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
+ absl_cc_library(
+ NAME
+ leak_check_api_enabled_for_testing
+@@ -237,6 +238,7 @@ absl_cc_library(
+ $<$<BOOL:${ABSL_HAVE_LSAN}>:-DLEAK_SANITIZER>
+ TESTONLY
+ )
++endif()
+
+ absl_cc_library(
+ NAME
+@@ -251,6 +253,7 @@ absl_cc_library(
+ TESTONLY
+ )
+
++if (NOT CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
+ absl_cc_test(
+ NAME
+ leak_check_test
+@@ -266,6 +269,7 @@ absl_cc_test(
+ absl::base
+ GTest::gmock_main
+ )
++endif()
+
+ absl_cc_test(
+ NAME
+@@ -281,6 +285,7 @@ absl_cc_test(
+ GTest::gmock_main
+ )
+
++if (NOT CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
+ absl_cc_test(
+ NAME
+ disabled_leak_check_test
+@@ -297,6 +302,7 @@ absl_cc_test(
+ absl::raw_logging_internal
+ GTest::gmock_main
+ )
++endif()
+
+ absl_cc_library(
+ NAME