Protobuf: We are considering deprecating autotools in favor of CMake

Created on 7 Sep 2018  路  11Comments  路  Source: protocolbuffers/protobuf

We are considering deprecating autotools builds. CMake has wide platform support, and we need to support the CMake build for systems like Windows that don't support autotools.

Please let us know if this would cause major problems for you.

Before we deprecated autotools, there is a fair amount of logic we would need to port to CMake. For example:

  • conformance tests
  • benchmarks
  • platform detection for Objective C (Objective C only builds on macOS)
  • various scripts that call "make"
c++ cmake discussion

Most helpful comment

Hello,

Supporting cmake for all platforms including Android and iOS would be perfect!

Side note: those 2 patforms do not compile out of the box with cmake, shall I create tickets for it?

All 11 comments

OK, if we decide to do that, I'll put benchmark's cleaning into next q's okr

How much of the respective audience would be utilising Windows native, MSVC or Git for Windows with MSYS2, as opposed to WSL?

Has ninja (optionally re2c), python3, and meson, been considered?

@forskning CMake works with MVSC, and I would expect that it works with UNIX-like environments on Windows like WSL or MSYS2 also?

CMake can compile to Ninja. That is how I usually use CMake.

I don't think we want to create a new build system in meson. We already have a CMake build to support Windows. I want to deprecate autotools support in favor of CMake everywhere.

I only mentioned ninja (optionally re2c), and python3, as meson dependencies.

https://github.com/python/cpython
Python version 3.8.0 alpha 0

FWIW, downloading cpython-master.zip, extracting it, and running
'grep -r %EXTERNAL_DIR% cpython-master' returns a result
for cpython-master/PCbuild/find_python.bat, and running thereafter
'grep -r %EXTERNALS_DIR% cpython-master' returns results in both
the cpython-master/PCbuild and cpython-master/Tools directories.

https://github.com/python/cpython/commit/68d663cf85d1ac5eaf83482eed39c0a6f8093601#diff-60f6a0e6e49e5990c3ad465771fff9cd

committed on GitHub Jul 17, 2017

So I wonder was there a typo in the above commit, as "%EXTERNAL_DIR%" rather than "%EXTERNALS_DIR%"?

PCbuild/find_python.bat

lines 27-28

I'm not on the Python mailing list so if someone could clarify whether a typo occurred or not it would be appreciated.

http://nurmi-labs.blogspot.com/2017/03/p9p.html
http://nurmi-labs.blogspot.com/2017/04/xs.html

A couple of links regarding Win10 (Anniversary Update circa) WSL.

@haberman I haven't used CMake under WSL, but the the compiler toolchain tests were successful.

https://github.com/TieDyedDevil/XS

FWIW, xs has switched to a meson build.

http://nurmi-labs.blogspot.com/2016/11/git.html

Some modifications of a legacy 'Git for Windows' installation.

Update: I registered for the python bug tracker and opened the following issue on 30 Sept. 2018.

https://bugs.python.org/issue34855
batch file variables

Hello,

Supporting cmake for all platforms including Android and iOS would be perfect!

Side note: those 2 patforms do not compile out of the box with cmake, shall I create tickets for it?

Currently you have both a cmake based build system and a configure based one. Its worth adding a note somewhere about what the relative capabilities and limitations are. See also #5760

Also note that unless you use cmake to build protocol buffers (at least in v3.3.0) the installation does not include a cmake directory and this creates problems for cmake's FindProtobuf to find protocol buffers (the provided pkg-config should be sufficient but for some reason is ignored).

Gtest dropped Autotools support a couple months ago and now supports only Bazel and CMake: https://github.com/google/googletest/pull/2286 Maybe that is another good reason for us to do the same. Otherwise it may be difficult to keep our tests working with autotools.

Any news on this?

  • I couldn't find the documentation for building protobuf with CMake.

Presently it seems there is solely this reference.

https://github.com/protocolbuffers/protobuf/blob/master/src/README.md

To build from source using Microsoft Visual C++, see cmake/README.md.

Please do it. We're using a bunch of Google's libraries and most of them are a nightmare to build across all the platforms we support (macOS, all sorts of Linux, Win32/64, Android and iOS), protobuf being particularly bad. Thanks for not using depot tools btw :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sunpoet picture sunpoet  路  32Comments

kolea2 picture kolea2  路  40Comments

laszloagardi picture laszloagardi  路  40Comments

tang3w picture tang3w  路  39Comments

blowmage picture blowmage  路  73Comments