Skip to content
This repository was archived by the owner on Jan 9, 2023. It is now read-only.
This repository was archived by the owner on Jan 9, 2023. It is now read-only.

Release executables and libraries depend on gtest #651

Open
@tst-lsavoie

Description

@tst-lsavoie

On some platforms, some of the executables produced and installed in the RPM depend on gtest. The affected executables/libraries are libgeprotobuf, gerasterimport, fusion, libsharedportablelib.so, and geraster2gigapxl. Since gtest is only used for testing this should not be a requirement for run time libraries.

Steps to reproduce the error with libgeprotobuf:

  1. Build RPMs on CentOS 7
  2. Install the RPMs on another machine on which gtest and gtest-devel are not installed
  3. Symptom 1: run sudo /opt/google/bin/geserveradmin. You will get an error message indicating that there was a problem loading libgtest.
  4. Symptom 2: run /etc/init.d/geserver restart. You will get an error because a file named "stream_space" does not exist and the server will fail to start.

Reproducing the error with the other executables involves installing and running them on a system without gtest installed. Reproducing the error with the other libraries is similar except that you first have to find an executable that uses the affected library and run that.

As part of this ticket, we should make sure that RPMs do not include gtest as a dependency (currently gtest is automatically included as a dependency because the listed executables require it).

The following script can be used to find executables and libraries that depend on gtest. It should be run after running the build and stage_install steps in scons.

#! /bin/bash

: ${SEARCH_PATH:=/tmp/fusion_os_install}

find "$SEARCH_PATH" |
    while read f; do
        reqs=$(echo "$f" | /usr/lib/rpm/find-requires)
        if [ -n "$reqs" ]; then
            echo "-----------------------------"
            echo "File: $f"
            echo "---------"
            echo "$reqs"
            echo "-----------------------------"
            echo
        fi
    done

This problem was solved in the (rejected) PR #652 for libgeprotobuf. This PR was rejected because it doesn't solve the problem for the other executables. In this case, however, libgeprotobuf doesn't actually depend on gtest, but gtest is linked in anyway. The fix is to remove gtest from the linking step. It's possible that the other executables and libraries can be fixed similarly. The exact reason that scons decides to link gtest into these executables is unknown.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions