meson: exclude intermediate files of docs generation from tarball
Summary
Put the generated documentation in a different folder of the tarball's root folder, called docs-dist, instead of putting them in the source tree.
This change fixes the CI failure of the jobs using meson generated tarballs to then build with autotools.
Additionally, fix the CI failing when doing meson build
on old meson versions where
that command doesn't exist.
Resolves: https://issues.redhat.com/browse/NMT-1073
Purpose
We want to distribute the generated documentation when we generate the
tarball because we normally do it when we do a release, but meson dist
only includes files that are commited to the repository, so a script
meson-dist-data.sh was added with meson.add_dist_script in commit
1c41066a ('build: include documentation in meson dist').
This script was copying the whole documentation folders, including some intermediate files that are not useful for users that wants to read the docs. Get rid of them and copy only the files that are useful for users: the generated html pages in docs/api and docs/libnm and the final man pages.
Also, including these intermediate files caused at least one build failure, although quite difficult to reproduce:
- Generate tarball with meson
- Untar the generated tarball
- Using the sources from the tarball, configure the project with autotools, but building to an out-of-tree folder, not building in the source dir (i.e. using a 'build' subfolder). This is called a "VPATH build" by autotools and Make. See:
- Build
In that scenario, we get an error trying to generate any file under man/ because the man/ subdirectory has not been created. The reason of this was that the man/ subdirectory is created by the Makefile when generating the file man/common.ent. However, this file was present in the source directory because it has been included in the tarball, so Make detects it and doesn't run the rules to generate it. The result is that out-of-tree-dir/man folder is not created.
Not including the intermediate files solves this problem.
Additionally, fix the CI failing when doing meson build
on old meson versions where
that command doesn't exist. ninja dist
has to be used instead.
Checklist
Please read https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/main/CONTRIBUTING.md before opening the merge request. In particular, check that:
-
the subject for all commits is concise and explicative -
the message for all commits explains the reason for the change -
the source is properly formatted -
any relevant documentation is up to date -
you have added unit tests if applicable -
the NEWS file is updated when the change deserves to be mentioned, for example for new features, behavior changes, API deprecations, etc.