Re: UPDATE: devel/abseil-cpp - some fixes and turning on tests
On Wed, Mar 02, 2022 at 09:14:37AM +0100, Omar Polo wrote: > Klemens Nanni wrote: > > > I have no fix for this but would like to get tests enabled where > > possible. > > > > Since enabling tests breaks the build and thus the package, how about > > disabling tests on sparc6? > > > > I guess some other arch will fail as well, but we can still fix that > > once bulk reports come in. > > (we could also enable the tests only on amd64 and then add other arches > when we test them) Yes, but since abseil-cpp is a leave port and will only knock out tdesktop, I'd like to see the bulk machines build it with tests such that I can see the reports and either fix or disable tests there. > > > Until then, at least amd64 gets test coverage and we can work on it > > in-tree. > > > > Feedback? Objection? OK? > > In case nothing comes up I'll just commit this in a few days. > > I hoped we could avoid this kind of conditional for tests, but since we > don't it's ok for me. Just one comment: Thanks. > > > +.include > > +.if ${MACHINE_ARCH} == "sparc64" > > AFAIK there's no need to pull in bsd.port.arch.mk, MACHINE_ARCH is > available outside of it. You're right, I zapped it. > > > +# XXX hash/hash_test.cc:614:22: error: use of deleted function > > 'absl::lts_20211102::hash_internal::PoisonedHash::PoisonedHash()' > > NO_TEST = Yes > > +.else > > +# use googletest from ports > > +CONFIGURE_ARGS += > > -DABSL_USE_EXTERNAL_GOOGLETEST:BOOL=${LOCALBASE}/include/gtest > > +# turn on tests builds > > +CONFIGURE_ARGS += -DBUILD_TESTING:BOOL=ON > > you could also close the conditional here: if NO_TEST is set to "Yes" I > guess TEST_ENV and pre-test are ignored too. (not tested and just a > nit, i'm fine either the way.) Even if pre-test would run it's not > doing anything important and `make test' is not a step done in package > building anyway. your call :) Leaving the target unconditionally looks odd to me. We can probably improve this, but I think its good enough as first step. > > > +# 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 {} . > > +.endif > > > > .include >
Re: UPDATE: devel/abseil-cpp - some fixes and turning on tests
Klemens Nanni wrote: > I have no fix for this but would like to get tests enabled where > possible. > > Since enabling tests breaks the build and thus the package, how about > disabling tests on sparc6? > > I guess some other arch will fail as well, but we can still fix that > once bulk reports come in. (we could also enable the tests only on amd64 and then add other arches when we test them) > Until then, at least amd64 gets test coverage and we can work on it > in-tree. > > Feedback? Objection? OK? > In case nothing comes up I'll just commit this in a few days. I hoped we could avoid this kind of conditional for tests, but since we don't it's ok for me. Just one comment: > +.include > +.if ${MACHINE_ARCH} == "sparc64" AFAIK there's no need to pull in bsd.port.arch.mk, MACHINE_ARCH is available outside of it. > +# XXX hash/hash_test.cc:614:22: error: use of deleted function > 'absl::lts_20211102::hash_internal::PoisonedHash::PoisonedHash()' > NO_TEST =Yes > +.else > +# use googletest from ports > +CONFIGURE_ARGS += > -DABSL_USE_EXTERNAL_GOOGLETEST:BOOL=${LOCALBASE}/include/gtest > +# turn on tests builds > +CONFIGURE_ARGS +=-DBUILD_TESTING:BOOL=ON you could also close the conditional here: if NO_TEST is set to "Yes" I guess TEST_ENV and pre-test are ignored too. (not tested and just a nit, i'm fine either the way.) Even if pre-test would run it's not doing anything important and `make test' is not a step done in package building anyway. your call :) > +# 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 {} . > +.endif > > .include
Re: UPDATE: devel/abseil-cpp - some fixes and turning on tests
On Fri, Feb 25, 2022 at 07:37:30PM +, Klemens Nanni wrote: > 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 > >': > /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; I have no fix for this but would like to get tests enabled where possible. Since enabling tests breaks the build and thus the package, how about disabling tests on sparc6? I guess some other arch will fail as well, but we can still fix that once bulk reports come in. Until then, at least amd64 gets test coverage and we can work on it in-tree. Feedback? Objection? OK? In case nothing comes up I'll just commit this in a few days. 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 --- Makefile18 Dec 2021 19:38:17 - 1.1.1.1 +++ Makefile28 Feb 2022 23:04:30 - @@ -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,25 @@ CONFIGURE_ARGS += -DCMAKE_CXX_STANDARD=1 # to ensure that our project builds correctly. CONFIGURE_ARGS += -DABSL_PROPAGATE_CXX_STD:BOOL=ON +.include +.if ${MACHINE_ARCH} == "sparc64" +# XXX hash/hash_test.cc:614:22: error: use of deleted function 'absl::lts_20211102::hash_internal::PoisonedHash::PoisonedHash()' NO_TEST =
Re: UPDATE: devel/abseil-cpp - some fixes and turning on tests
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 >': /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 --- Makefile18 Dec 2021 19:38:17 - 1.1.1.1 +++ Makefile25 Feb 2022 16:41:23 - @@ -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 Index: patches/patch-absl_base_internal_raw_logging_cc === RCS file: patches/patch-absl_base_internal_raw_logging_cc
Re: UPDATE: devel/abseil-cpp - some fixes and turning on tests
Andrew Krasavin writes: > 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. don't worry, but the attached patch don't apply either :/ > Thank you for your comment, I fixed it as you suggested. > > diff --git a/devel/abseil-cpp/Makefile b/devel/abseil-cpp/Makefile > index 4fb8a93ab48..343c27b7aaf 100644 > --- a/devel/abseil-cpp/Makefile > +++ b/devel/abseil-cpp/Makefile > @@ -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=17 > # 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 > diff --git a/devel/abseil-cpp/patches/patch-absl_base_internal_raw_logging_cc > b/devel/abseil-cpp/patches/patch-absl_base_internal_raw_logging_cc > new file mode 100644 > index 000..71ef528b32b > --- /dev/null > +++ b/devel/abseil-cpp/patches/patch-absl_base_internal_raw_logging_cc > @@ -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 > +@@ -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 > + #define ABSL_HAVE_SYSCALL_WRITE 1 > + #define ABSL_LOW_LEVEL_WRITE_SUPPORTED 1 > diff --git a/devel/abseil-cpp/patches/patch-absl_debugging_CMakeLists_txt > b/devel/abseil-cpp/patches/patch-absl_debugging_CMakeLists_txt > new file mode 100644 > index 000..df5a9e9ed5d > --- /dev/null > +++ b/devel/abseil-cpp/patches/patch-absl_debugging_CMakeLists_txt > @@ -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( > + $<$:-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
Re: UPDATE: devel/abseil-cpp - some fixes and turning on tests
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. diff --git a/devel/abseil-cpp/Makefile b/devel/abseil-cpp/Makefile index 4fb8a93ab48..343c27b7aaf 100644 --- a/devel/abseil-cpp/Makefile +++ b/devel/abseil-cpp/Makefile @@ -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=17 # 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 diff --git a/devel/abseil-cpp/patches/patch-absl_base_internal_raw_logging_cc b/devel/abseil-cpp/patches/patch-absl_base_internal_raw_logging_cc new file mode 100644 index 000..71ef528b32b --- /dev/null +++ b/devel/abseil-cpp/patches/patch-absl_base_internal_raw_logging_cc @@ -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 +@@ -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 + #define ABSL_HAVE_SYSCALL_WRITE 1 + #define ABSL_LOW_LEVEL_WRITE_SUPPORTED 1 diff --git a/devel/abseil-cpp/patches/patch-absl_debugging_CMakeLists_txt b/devel/abseil-cpp/patches/patch-absl_debugging_CMakeLists_txt new file mode 100644 index 000..df5a9e9ed5d --- /dev/null +++ b/devel/abseil-cpp/patches/patch-absl_debugging_CMakeLists_txt @@ -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( + $<$:-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