Opened 9 years ago

Closed 2 years ago

#48800 closed defect (wontfix)

gtest: please remove

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by:
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: drkp (Dan Ports), kurthindenburg (Kurt Hindenburg), mojca (Mojca Miklavec), mascguy (Christopher Nielsen)
Port: gtest

Description

Please remove the gtest port. We previously had this software in MacPorts as "google-test" but removed it in r115909; the developers of Google Test do not want package managers to distribute it. Instead, a private copy should be included in each project that wants to use it.

Attachments (1)

gtest-github.diff (901 bytes) - added by mojca (Mojca Miklavec) 8 years ago.
Fetch gtest 1.8.0 from github

Download all attachments as: .zip

Change History (20)

comment:1 Changed 9 years ago by blair (Blair Zajac)

Yes, I read that too. However, it's in Ubuntu:

$ apt-cache show libgtest-dev
Package: libgtest-dev
Priority: optional
Section: libdevel
Installed-Size: 1302
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Steve M. Robbins <smr@debian.org>
Architecture: all
Source: gtest
Version: 1.6.0-1ubuntu6
Filename: pool/main/g/gtest/libgtest-dev_1.6.0-1ubuntu6_all.deb
Size: 262206
MD5sum: 3952cdc66cdead128769b18d13df4bd7
SHA1: d47ddbabd85abc4c6ba6ae4f54b7aefd3782f54e
SHA256: 144e70bde71d5894da4cf8a4762a88cc5ca97df6b374828e59c83168151c7916
Description-en: Google's framework for writing C++ tests - header files
 Google's framework for writing C++ tests on a variety of platforms. Based on
 the xUnit architecture. Supports automatic test discovery, a rich set of
 assertions, user-defined assertions, death tests, fatal and non-fatal failures,
 value- and type-parameterized tests, various options for running the tests, and
 XML test report generation.
 .
 This package contains the header files needed to link programs against
 gtest.
Description-md5: 91f80794a8414047791bb3f205c9aa39
Multi-Arch: foreign
Homepage: http://code.google.com/p/googletest/
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu
Supported: 9m

And the instructions for installing grpc, Google's RPC system installs it:

https://github.com/grpc/grpc/blob/master/INSTALL

In fact, they install it into /opt/local, which is why I want to have a package do it:

  $ sudo /opt/local/bin/port install autoconf automake libtool gflags cmake
  $ mkdir ~/gtest-svn
  $ svn checkout http://googletest.googlecode.com/svn/trunk/ gtest-svn
  $ mkdir mybuild
  $ cd mybuild
  $ cmake ../gtest-svn
  $ make
  $ make gtest.a gtest_main.a
  $ sudo cp libgtest.a libgtest_main.a /opt/local/lib
  $ sudo mkdir /opt/local/include/gtest
  $ sudo cp -pr ../gtest-svn/include/gtest /opt/local/include/gtest 

So unless there's good reason otherwise, I'll close this.

comment:2 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

The Google Test Makefile contains these comments:

# Disables 'make install' as installing a compiled version of Google
# Test can lead to undefined behavior due to violation of the
# One-Definition Rule.

And this line:

echo "'make install' is dangerous and not supported. Instead, see README for how to integrate Google Test into your build system."

This seems to make clear that a package manager like MacPorts should not include Google Test, nor should any other means be used to install Google Test into a public location. Projects should only use private copies of Google Test in their build systems for testing.

The developers of GRPC should be directed to these facts and advised to include a copy of Google Test in their project, and not advocate installing Google Test into the MacPorts prefix.

comment:3 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

They also have a FAQ entry on this topic.

comment:4 Changed 9 years ago by blair (Blair Zajac)

I would agree with you, except that Ubuntu provides it also. Also, the developers of GRPC is Google ;)

In the end, I'm not going to remove the package. I don't think it's the end of the world to keep it there.

comment:5 Changed 8 years ago by little-big-h

By now, the port is broken because the svn-URL isn't valid anymore (the project was moved to github). This must be the worst possible solution: a port that is not really maintained, broken and discouraged by the upstream developers.

comment:6 Changed 8 years ago by ryandesign (Ryan Carsten Schmidt)

Blair, please remove the port as per my previous remarks.

comment:7 Changed 8 years ago by drkp (Dan Ports)

Cc: drkp added

The Debian/Ubuntu package just installs a copy of the source tarball into /usr/src/gtest so that dependencies can build and link it in themselves. That's probably what we should do.

comment:8 Changed 8 years ago by kurthindenburg (Kurt Hindenburg)

Cc: kurthindenburg added

IT looks like this is now at https://github.com/google/googletest - however if we don't want to include this in macports, lets remove it.

comment:9 Changed 8 years ago by mojca (Mojca Miklavec)

Cc: mojca added

comment:10 Changed 8 years ago by mojca (Mojca Miklavec)

The FAQ entry is now here.

I just stumbled on this after playing with dvisvgm. I wanted to run tests when I got an error:

BezierTest.cpp:21:10: fatal error: 'gtest/gtest.h' file not found
#include <gtest/gtest.h>
         ^
1 error generated.

Saying to myself: oh, look, we have a port for gtest, let's try it out. Of course it didn't install since SVN on google code is no longer working, so I ported it to github (I'll add an attachment).

It built fine, but failed during destroot with

Error: Failed to destroot gtest: error copying "/path/to/gtest/work/build/libgtest.a": no such file or directory

Then I found this ticket.

In the light of this discussion I was wondering if there was a way to at least create some PortGroup that could simplify testing other ports using googletest.

Changed 8 years ago by mojca (Mojca Miklavec)

Attachment: gtest-github.diff added

Fetch gtest 1.8.0 from github

comment:11 Changed 7 years ago by ctreleaven (Craig Treleaven)

In e00556269726cc09219721b90ec06bec49eb0d1c/macports-ports:

mkvtoolnix: ensure c++14 compiler, use internal gtest

certain c++14 features are required, ensure a suitable compiler is available.
don't use MacPorts gtest -- see #48800

comment:12 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)

comment:13 Changed 7 years ago by Dan R. K. Ports <drkp@…>

In d8308f7f6875f9158dca422018ce715675581deb/macports-ports:

gtest: install source files, the preferred way to distribute gtest
(see #48800)

comment:14 in reply to:  3 ; Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to ryandesign:

They also have a FAQ entry on this topic.

This portion of the FAQ was removed without explanation. The parts of the Makefile that say make install has been disabled are still there, but make install actually works in 1.8.0. I do not know whether that change was intentional or just an unintended consequence of other changes. Someone asked the developers for clarification and the developers closed the issue without answering the question. I have asked them to re-open it.

comment:15 Changed 6 years ago by mf2k (Frank Schima)

Owner: blair deleted
Status: newassigned

comment:16 Changed 4 years ago by mouse07410 (Mouse)

Hmm... Why isn't gtest port removed then?

Last edited 4 years ago by mouse07410 (Mouse) (previous) (diff)

comment:17 in reply to:  14 Changed 2 years ago by mascguy (Christopher Nielsen)

Replying to ryandesign:

Replying to ryandesign:

They also have a FAQ entry on this topic.

This portion of the FAQ was removed without explanation. The parts of the Makefile that say make install has been disabled are still there, but make install actually works in 1.8.0. I do not know whether that change was intentional or just an unintended consequence of other changes. Someone asked the developers for clarification and the developers closed the issue without answering the question. I have asked them to re-open it.

While the upstream situation is a bit odd, it is what it is. Can we close this?

comment:18 Changed 2 years ago by mascguy (Christopher Nielsen)

Cc: mascguy added

comment:19 Changed 2 years ago by neverpanic (Clemens Lang)

Resolution: wontfix
Status: assignedclosed

I think the situation has stabilized to the point where the gtest developers have given in and accepted that distributions will package and ship their library, and occasionally projects do use a system-installed gtest where available.

As a consequence, I think we should just keep gtest as it is today, like other distributions.

Note: See TracTickets for help on using tickets.