Monday, February 07, 2022

Re: UPDATE: gtest 1.11.0 + some patches from upstream

On Mon, Feb 07, 2022 at 10:18:43PM +0000, Klemens Nanni wrote:
>On Tue, Feb 08, 2022 at 01:11:23AM +0300, Andrew Krasavin wrote:
>> I apologize for the long answer, it's been quite a busy day.
>>
>> >
>> > Another thing, upstream won't release further versions and suggest to
>> > build from the latest commit instead... so I'd fetch from a specific
>> > commit instead of keeping a long list of PATCHFILES.
>> >
>> > cf https://github.com/google/googletest/releases/tag/release-1.11.0
>> >
>> > > GoogleTest will not accept patches of new features to v1.11.0.
>> > > We recommend building GoogleTest from the latest commit instead.
>> > > Exceptional critical bug fixes may be considered.
>> >
>> > FWIW i had the following diff locally (which has to be updated to the
>> > latest commit) and I can confirm that devel/msgpack and proj still
>> > builds fine with this and test are passing.
>>
>> Thanks for testing that!
>> Yes, your version of the port that uses the actual gtest commit is
>> much better than the one I suggested. I would be glad if such changes
>> would be integrated into the port tree.
>> >
>> > I'll update it to 14aa11db02d9851d957f93ef9fddb110c1aafdc6 (latest
>> > commit as of now), cherry pick you fix-gtest-help-test (which is the
>> > only test failing for me here), do a mini bulk overnight and report back
>> > how it goes :)
>> >
>>
>> Please clarify about the fix-gtest-help-test. I had this test failed
>> without this patch. According to the code, I have enabled the same
>> logic for OpenBSD as was already done for Linux,
>> GNU/kFreeBSD, and hurd.
>>
>> If you get an error during the test after applying my patch then
>> please tell me more about it. Maybe I should cancel my pull request
>> before it is already merged.
>
>Your patch works for me on amd64 and sparc64 and is required to get 100%
>tests working.

Thanks for testing! Good thing you reminded me: I tested on amd64
and macppc.
Similarly, in both cases patch is required to get 100% tests working.

>
>Here's the diff I just tried.
>It also records the missing python dependency and zaps SEPARATE_BUILD
>(default with cmake).
>base-gcc is too old for recent c++, so zap that (not used anyway).
>

Thanks again!

>Index: Makefile
>===================================================================
>RCS file: /home/cvs/ports/devel/gtest/Makefile,v
>retrieving revision 1.25
>diff -u -p -r1.25 Makefile
>--- Makefile 31 Oct 2021 16:09:26 -0000 1.25
>+++ Makefile 7 Feb 2022 22:16:06 -0000
>@@ -5,16 +5,23 @@ BROKEN-alpha = googletest/test/gtest_uni
>
> COMMENT = C++ unit test framework
>
>-V= 1.8.1
> GH_ACCOUNT= google
> GH_PROJECT= googletest
>-GH_TAGNAME= release-$V
>-PKGNAME = gtest-$V
>+GH_COMMIT= 43efa0a4efd40c78b9210d15373112081899a97c
>+DISTNAME = gtest-1.11.0.20220207
>
>-SHARED_LIBS += gmock 0.1 # .0.0
>-SHARED_LIBS += gmock_main 0.1 # .0.0
>-SHARED_LIBS += gtest 1.1 # .0.0
>-SHARED_LIBS += gtest_main 1.1 # .0.0
>+MASTER_SITES0 = https://github.com/google/googletest/commit/
>+# Fix gtest-help-test failure on OpenBSD
>+# https://github.com/google/googletest/pull/3751
>+PATCHFILES = fix-gtest-help-test-{}631f4f99.patch:0
>+
>+PATCH_DIST_STRIP = -p1
>+
>+
>+SHARED_LIBS += gmock 1.0 # .0.0
>+SHARED_LIBS += gmock_main 1.0 # .0.0
>+SHARED_LIBS += gtest 2.0 # .0.0
>+SHARED_LIBS += gtest_main 2.0 # .0.0
>
> CATEGORIES = devel
>
>@@ -28,13 +35,14 @@ CXXFLAGS += -mxgot
> # New BSD
> PERMIT_PACKAGE = Yes
>
>-SEPARATE_BUILD = Yes
>-
> WANTLIB = m ${COMPILER_LIBCXX}
>
>-COMPILER = base-clang ports-gcc base-gcc
>+COMPILER = base-clang ports-gcc
>+
>+MODULES = devel/cmake \
>+ lang/python
>+MODPY_RUNDEP = No
>
>-MODULES += devel/cmake
> CONFIGURE_ARGS = -DBUILD_SHARED_LIBS=ON \
> -Dgtest_build_tests=ON
>
>Index: distinfo
>===================================================================
>RCS file: /home/cvs/ports/devel/gtest/distinfo,v
>retrieving revision 1.5
>diff -u -p -r1.5 distinfo
>--- distinfo 31 Oct 2021 16:09:26 -0000 1.5
>+++ distinfo 7 Feb 2022 22:04:42 -0000
>@@ -1,2 +1,4 @@
>-SHA256 (googletest-1.8.1.tar.gz) = m/H+UYKmBLQTXtwaQlrjVsmtFemyP58SoC6AGEw6JJw=
>-SIZE (googletest-1.8.1.tar.gz) = 992298
>+SHA256 (gtest-1.11.0.20220207-43efa0a4.tar.gz) = 9yE7RQBtYYhP15ekcULS+3tmNheSn16cbPwoGklWkQk=
>+SHA256 (gtest-fix-gtest-help-test-631f4f99.patch) = irvc5uvRbb+BE3mKGVtoIHX9GEcRuLYTWEjTRcPzrsA=
>+SIZE (gtest-1.11.0.20220207-43efa0a4.tar.gz) = 835348
>+SIZE (gtest-fix-gtest-help-test-631f4f99.patch) = 1285
>Index: pkg/PLIST
>===================================================================
>RCS file: /home/cvs/ports/devel/gtest/pkg/PLIST,v
>retrieving revision 1.4
>diff -u -p -r1.4 PLIST
>--- pkg/PLIST 31 Oct 2021 16:09:26 -0000 1.4
>+++ pkg/PLIST 7 Feb 2022 21:27:57 -0000
>@@ -2,35 +2,28 @@
> include/gmock/
> include/gmock/gmock-actions.h
> include/gmock/gmock-cardinalities.h
>-include/gmock/gmock-generated-actions.h
>-include/gmock/gmock-generated-actions.h.pump
>-include/gmock/gmock-generated-function-mockers.h
>-include/gmock/gmock-generated-function-mockers.h.pump
>-include/gmock/gmock-generated-matchers.h
>-include/gmock/gmock-generated-matchers.h.pump
>-include/gmock/gmock-generated-nice-strict.h
>-include/gmock/gmock-generated-nice-strict.h.pump
>+include/gmock/gmock-function-mocker.h
> include/gmock/gmock-matchers.h
> include/gmock/gmock-more-actions.h
> include/gmock/gmock-more-matchers.h
>+include/gmock/gmock-nice-strict.h
> include/gmock/gmock-spec-builders.h
> include/gmock/gmock.h
> include/gmock/internal/
> include/gmock/internal/custom/
> include/gmock/internal/custom/README.md
> include/gmock/internal/custom/gmock-generated-actions.h
>-include/gmock/internal/custom/gmock-generated-actions.h.pump
> include/gmock/internal/custom/gmock-matchers.h
> include/gmock/internal/custom/gmock-port.h
>-include/gmock/internal/gmock-generated-internal-utils.h
>-include/gmock/internal/gmock-generated-internal-utils.h.pump
> include/gmock/internal/gmock-internal-utils.h
> include/gmock/internal/gmock-port.h
>+include/gmock/internal/gmock-pp.h
> include/gtest/
>+include/gtest/gtest-assertion-result.h
> include/gtest/gtest-death-test.h
>+include/gtest/gtest-matchers.h
> include/gtest/gtest-message.h
> include/gtest/gtest-param-test.h
>-include/gtest/gtest-param-test.h.pump
> include/gtest/gtest-printers.h
> include/gtest/gtest-spi.h
> include/gtest/gtest-test-part.h
>@@ -47,17 +40,11 @@ include/gtest/internal/custom/gtest.h
> include/gtest/internal/gtest-death-test-internal.h
> include/gtest/internal/gtest-filepath.h
> include/gtest/internal/gtest-internal.h
>-include/gtest/internal/gtest-linked_ptr.h
>-include/gtest/internal/gtest-param-util-generated.h
>-include/gtest/internal/gtest-param-util-generated.h.pump
> include/gtest/internal/gtest-param-util.h
> include/gtest/internal/gtest-port-arch.h
> include/gtest/internal/gtest-port.h
> include/gtest/internal/gtest-string.h
>-include/gtest/internal/gtest-tuple.h
>-include/gtest/internal/gtest-tuple.h.pump
> include/gtest/internal/gtest-type-util.h
>-include/gtest/internal/gtest-type-util.h.pump
> lib/cmake/
> lib/cmake/GTest/
> lib/cmake/GTest/GTestConfig.cmake

--
Wbr, Andrew Krasavin

No comments:

Post a Comment