This is an archive of the discontinued LLVM Phabricator instance.

utils/release: Add script for building release documentation
ClosedPublic

Authored by tstellar on Jan 22 2021, 8:54 PM.

Diff Detail

Event Timeline

tstellar created this revision.Jan 22 2021, 8:54 PM
tstellar requested review of this revision.Jan 22 2021, 8:54 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 22 2021, 8:54 PM
hans added a subscriber: hans.Jan 25 2021, 1:53 AM
hans added inline comments.
llvm/utils/release/build-docs.sh
21

I don't know if the script needs to comment on whether docs need to be built for -final releases or others.

(I also think it's useful to have them for release candidates, so people can get an idea of what the current state of the docs are.)

61

This should be relative to the script's dir, not the cwd. Is there some way to figure this out in bash?

70

This assumes srcdir is a git checkout. One could imagine someone wanting to build the docs after extracting the llvm-project tarball for example.

I think the script should either be able to build against any src dir, or it should take a git revision/tag and grab the sources itself.

In the script I used, it does the latter, using

curl -L https://github.com/llvm/llvm-project/archive/$GIT_REF.tar.gz | tar --strip-components=1 -xzf -
84

In my script I had -DLLVM_BUILD_DOCS=ON
I see that both exist in the cmake files.. not sure what the difference is.

101

In my script I had to move the html around a bit to match the layout of previous docs builds, and so the links to the docs would work.

For example, the clang docs would be in tools/clang/docs/html, but the link would point to tools/clang/docs/

hans edited reviewers, added: hans; removed: hansw.Jan 25 2021, 1:54 AM
tstellar updated this revision to Diff 334868.Apr 1 2021, 5:23 PM

Address review comments.

hans accepted this revision.Apr 7 2021, 1:17 AM
This revision is now accepted and ready to land.Apr 7 2021, 1:17 AM
kuhnel added a subscriber: kuhnel.Apr 23 2021, 2:46 AM
kuhnel added inline comments.
llvm/utils/release/build-docs.sh
29

I would not limit the usage of this to releases. I guess this can also be used for any other situation where someone wants to build the documentation locally, e.g. to check if your documentation change is rendered as expected.

61
tstellar updated this revision to Diff 362241.Jul 27 2021, 5:18 PM

Don't limit script usage to releases.

tstellar marked 2 inline comments as done.Jul 27 2021, 5:18 PM

@kuhnel Does this version of the patch look good to you?

kuhnel accepted this revision.Oct 27 2021, 6:33 AM

No more comments from me. However I'm not an expert on bash scripting...

ljmf00 added a subscriber: ljmf00.Oct 27 2021, 1:04 PM

I suggest the usage of shellcheck linter. A lot of errors can happen due to e.g. missing double quotes causing word splitting on bash.

I left some comments :)

llvm/utils/release/build-docs.sh
26

Use double quotes to prevent word split

31

Use $(...) instead of legacy backticks for subshell. Using backticks is limited to one level of subshell and make the rest of the code consistent.

45

Double quotes

69

POSIX test is not so well defined to allow these XSI extensions in a reliable way. Read this for context: https://github.com/koalaman/shellcheck/wiki/SC2166

86

pushd and popd is not POSIX compliant and are only available via bash, not sh.