Impact of libexpat dropping Automake?

Dear CMake community,

libexpat is a third-party library to parse XML and a dependency of CMake
(Utilities/cmexpat). It currently has two build systems, Autotools and
CMake. The maintainer wanted to finally migrate to CMake and get rid of
Automake.

Several users argued that they need Autotools to build libexpat when
bootstrapping their system. Without Autotools they would face a
dependency cycle that cannot be resolved.

Is this true? Or can CMake be built without XML support and just lose
some handy features? Or can libexpat proceed and work towards becoming a
CMake-only project.

Link to discussion:

Kind regards,
Christoph

1 Like

This is a great idea. There could be a special variable to indicate support of such features like

CMAKE_HAVE_XML
CMAKE_HAVE_JSON

This would be a good design upgrade to help isolate issues, or if there is some severe bug that needs to be worked around with existing cmake versions in a controlled environment.

Downsides include it increases the testing configurations needed in CI, but that’s a solvable problem I think and tractable.

1 Like

There is currently no option to build CMake without the features
that rely on expat. However, CMake can be built without using
a system-provided expat because it vendors a copy of the source.
CMake has options to switch between vendored sources and
system-provided libraries for most of its external dependencies.

One can bootstrap a system by first building CMake with its vendored
dependencies in a temporary location. Then use that CMake to
build and install expat and other third-party dependencies of CMake.
Then build the final CMake against those.

Thanks Brad for the answer! I reformulate my question, to eliminate any
doubts:

Can CMake built its vendored libexpat without a provided CMake from the
system? In other words, when CMake bootstraps, it provides enough of
CMake to built its vendored libexpat?

Yes. The bootstrap script that comes with CMake’s source tree can configure a complete build of cmake without any preexisting cmake or libexpat on the system. The resulting build of cmake statically links the vendored libexpat.

1 Like