Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#1999 closed defect (fixed)

detection of googletest

Reported by: jreed Owned by: jreed
Priority: medium Milestone: Sprint-20120731
Component: Unclassified Version:
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: N/A
Sub-Project: Core Feature Depending on Ticket:
Estimated Difficulty: 4 Add Hours to Ticket: 0
Total Hours: 0 Internal?: no

Description

googletest no longer provides a library installation. The latest Debian package, as an example, installs the src code and headers. It does not provide any pkg-config pc file or gtest-config script.

My workaround for this was:

make -f /usr/share/doc/libgtest-dev/examples/make/Makefile gtest.a
ar cr libgtest.a gtest-all.o 
ranlib libgtest.a
cp libgtest.a /usr/lib/

(As an alternative can just link with the gtest.a instead.)

We need to have some solution -- either documentation or provide the build steps as part of our system when using gtest.

Subtickets

Change History (10)

comment:1 Changed 7 years ago by shane

  • Milestone changed from New Tasks to Sprint-20120703

comment:2 follow-up: Changed 7 years ago by muks

Some distributions have switched to a new googletest and provide the source code version. Some distributions (including Fedora 17) still provide gtest 1.5.0 which is a library. There's no source code.

Supporting both will result in a very dirty build system patch, as both need vastly different approaches. As the _new_ approach simply builds a .a of gtest in the buildroot, I strongly suggest that we drop support for the older gtest and expect those who build BIND 10 to supply path to a 1.6+ version source code. On distributions such as Fedora, this would mean simply downloading gtest-1.6.0 from Google's website, extracting it to a directory and passing a path to this directory when configuring BIND 10 (no gtest build would be necessary).

So, shall we drop support for old shared library versions of gtest?

Last edited 7 years ago by muks (previous) (diff)

comment:3 in reply to: ↑ 2 Changed 7 years ago by muks

Replying to muks:

Some distributions have switched to a new googletest and provide the source code version. Some distributions (including Fedora 17) still provide gtest 1.5.0 which is a library. There's no source code.

Supporting both will result in a very dirty build system patch, as both need vastly different approaches. As the _new_ approach simply builds a .a of gtest in the buildroot, I strongly suggest that we drop support for the older gtest and expect those who build BIND 10 to supply path to a 1.6+ version source code. On distributions such as Fedora, this would mean simply downloading gtest-1.6.0 from Google's website, extracting it to a directory and passing a path to this directory when configuring BIND 10 (no gtest build would be necessary).

So, shall we drop support for old shared library versions of gtest?

comment:4 Changed 7 years ago by jreed

  • Owner set to jreed
  • Status changed from new to accepted

comment:5 Changed 7 years ago by jreed

I started a branch and added a --with-gtest-source configure option. It needs testing. I need
to have it do some automated checking of the gtest method to use.

comment:6 Changed 7 years ago by jreed

  • Owner changed from jreed to UnAssigned
  • Status changed from accepted to reviewing

The trac1999 branch may be reviewed. I tested on a three different systems with three different versions of googletest. Please test both the --with-gtest-source and previous --with-gtest options with different gtest versions.

For example:
./configure --with-gtest-source=/home/jreed/src/gtest-1.6.0

Feel free to make modifications or improvements as needed. I will be unavailable for one week so won't be able to respond to review comments during that time.

(By the way, as I tested this I found that at least one package system installs the 1.6.0 version the old way -- no source and just provides the headers and the libraries.)

comment:7 Changed 7 years ago by jelte

  • Owner changed from UnAssigned to jelte

comment:8 follow-up: Changed 7 years ago by jelte

  • Owner changed from jelte to jreed

Is having a second option the way to go? Do we plan on deprecating the first at some point?

Is anyone else having problems that ~ is not expanded? :)

Apart from that, it works fine on my system, both with --with-gtest=/usr, --with-gtest (sysinstalled one, 1.5.0), and --with-gtest-source=/home/jelte/apps/gtest-1.6.0

I did commit a whitespace fix to configure.ac (there were lots of interleaved tabs and spaces in there, and I'm thinking about getting rid of all tabs soonish, it's one run through the file)

comment:9 Changed 7 years ago by jreed

  • Resolution set to fixed
  • Status changed from reviewing to closed

merged to master; closing

comment:10 in reply to: ↑ 8 Changed 7 years ago by jreed

Replying to jelte:

Is having a second option the way to go? Do we plan on deprecating the first at some point?

Is anyone else having problems that ~ is not expanded? :)

We will keep both ways for now, since some package system installs the latest googletest framework the old way: no source but with headers and library.

Note: See TracTickets for help on using tickets.