Open oraNod opened 1 year ago
Taken from this comment: https://github.com/ansible/ansible-documentation/pull/21#issuecomment-1602997366
If these warnings are just noise, we may be better off ignoring them and instead focusing on removing the need to build ansible-core from a clone during the docs build. Otherwise this repo becomes more dependent (not less) on the structure of the ansible repository -- which will make it more likely that moving/changing things in the ansible repo will break the docs build.
To resolve this issue we should further decouple the docs build from ansible-core, so that it doesn't require building it from source using a partial clone of the repo.
What antsibull does is run python -m build --sdist --outdir <dist_dir> <source_dir>
for the <source_dir>
passed as --ansible-core-source
. If for some reason the source directory isn't a checkout of ansible/ansible
but some random subset, the build scripts of ansible-core itself will produce these warnings/errors. antsibull-docs only passes them on to the user.
So these warnings come from ansible/ansible itself, not from antsibull-docs.
If ansible
, ansible-galaxy
, and ansible-doc
from that partial checkout are available on $PATH, using --ansible-core-source
is no longer necessary by passing --use-installed-ansible-core
instead of --ansible-core-source /path/to/checkout
.
(https://github.com/ansible/ansible-documentation/blob/devel/hacking/build_library/build_ansible/command_plugins/docs_build.py#L136 and https://github.com/ansible/ansible-documentation/blob/devel/hacking/build_library/build_ansible/command_plugins/docs_build.py#L189 would need to be modified.)
Thanks for investigating @felixfontein I'll try and take a look at this today and play around with it.
Just to note we have an issue to go through that hacking
folder, #35 so this could maybe be our first foray into rejigging things for the new repo.
@felixfontein Can antsibull be updated to build the sdist from a clone in a temporary directory instead of trying to pull the ansible source into the current tree?
Re-reading what @felixfontein wrote above, it sounds like this wouldn't require a change in antsibull. Instead, we'd change docs/bin/clone-core.py
to put the clone of ansible into a subdirectory (perhaps called ansible-core
) and then update https://github.com/ansible/ansible-documentation/blob/devel/hacking/build_library/build_ansible/command_plugins/docs_build.py to pass that directory as --ansible-core-source
instead of the current tree.
@felixfontein Does that sound about right to you?
@mattclay yes, that sounds about right! Having it in a different place probably also need adjustments to other files in hacking/build_library/build_ansible/ though, like dump_keywords.py and generate_man.py, which dynamically import Python files from ansible-core.
Docs build contains the following warns:
These warns occur because the
changelogs
folder and theREADME.rst
file are not present after runningbin/clone-core.py
to clone relevant bits from Ansible core.