Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Questions about Abseil as dependency of googletest #2883

Closed
falk-werner opened this issue Jun 5, 2020 · 2 comments
Closed

Questions about Abseil as dependency of googletest #2883

falk-werner opened this issue Jun 5, 2020 · 2 comments
Assignees

Comments

@falk-werner
Copy link

I've read that you plan to take a dependency on Abseil and I wonder what this exactly means for the users of googletest.

  • Do you plan to use Abseil as a private dependency (for internal use only) or will the dependency be visible outside (e.g. propagate through public headers)?
  • Will googletest be bundled to a specific version of Abseil (e.g. a copy of Abseil will be shipped along with googletest) or must a compatible version of Abseil be provided independently on the system?
  • Will there be restrictions if my project already uses Abseil (e.g. my project uses an newer or older version of Abseil than the one which is required by googletest?
@derekmauro
Copy link
Member

derekmauro commented Jun 22, 2020

The plans aren't finalized and I don't know when we will get to this. As background information, Abseil was created because at Google we have a large monorepo of code, and Abseil is the common code that a lot of other code, including GoogleTest, depends on. When GoogleTest was open-sourced, a lot of that common code was forked because Abseil didn't exist. One reason for doing this is to get rid of the forked code.

We've actually had an optional implementation of this for a while.

googletest/BUILD.bazel

Lines 44 to 47 in c6e309b

config_setting(
name = "has_absl",
values = {"define": "absl=1"},
)

If you use Bazel, you can add --define=absl=1 to see how this might work. Really what we are talking about is removing the optional code path, because maintaining compile options is somewhat expensive in terms of testing cost.

Do you plan to use Abseil as a private dependency (for internal use only) or will the dependency be visible outside (e.g. propagate through public headers)?

It will be visible though public headers.

Will googletest be bundled to a specific version of Abseil (e.g. a copy of Abseil will be shipped along with googletest) or must a compatible version of Abseil be provided independently on the system?

It won't be bundled. This would be potentially create diamond dependencies for other Abseil users.

Will there be restrictions if my project already uses Abseil (e.g. my project uses an newer or older version of Abseil than the one which is required by googletest?

You would need a compatible version of Abseil. In practice we expect this to be a non-issue if you follow our recommendations to upgrade often.

Let us know if you have concerns.

@falk-werner
Copy link
Author

Thank you for clarification. I asked out of curiosity and have no concerns with that solution.

I'm writing software for embedded linux devices using the PTXdist build system (similar to Yocto, which might be more popular). In order to have tests which are executed on the target device, googletest is used. Since PTXdist manages dependencies via it's own recipe-based mechanism, I'm always curious about dependencies of basic software packages.

Therefore, your intendet solution to have Abseil as a separate package suits very well, especially when it is visible through public headers. In this case, I can add a recipe for Abseil and make it a dependency of my googletest recipe and everything is fine.

Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants