-
Notifications
You must be signed in to change notification settings - Fork 930
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lxddoc: Add a readthedoc pre-build hook to build and generate codebase doc #12043
Conversation
f6b3996
to
7a06337
Compare
97be63d
to
b7f8755
Compare
bb03740
to
221b98b
Compare
I tested it locally now, and I think it works - but we should remove it from the Makefile. I'm actually not sure when the generation happens now. ;) Also, I tried including our example in the docs now, with the following markup:
This gives an error though, because the |
@ru-fu you're right, the lxd-doc tool is called twice now. I'll remove it from the |
Sure, a separate target makes sense. :) |
What is causing the lxd-doc tool to be called twice now (for my understanding)? |
It's in the Makefile as a requirement of the doc build ( Line 129 in fc1c870
|
And sphinx gets called as part of |
Yes, it's in |
Ah in that case we shouldn't have a lxd-doc target, the lxd-doc tool should be build as part of the normal "make" command target. |
I think we should have a target that can be used to run the lxd-doc tool manually. In the future, we'll need this to generate the YAML file that the UI can consume. But having the tool built as part of the main make command surely makes sense. |
Yep, happy to have a target that runs the tool, but building should take place in main target so we catch any issues as part of the main build. Ta |
d56d3ef
to
dfa89fc
Compare
Makefile
Outdated
@@ -120,18 +114,25 @@ endif | |||
|
|||
.PHONY: doc-setup | |||
doc-setup: | |||
@go version > /dev/null 2>&1 || { echo "go is not installed for lxd-doc installation."; exit 1; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @tomponline meant to build the tool as part of the general Go build, not as part of the doc setup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, this here would mean that we build the tool twice when building the docs - once here in doc-setup and once during the actual doc build (conf.py).
We don't need this. But we want to see if the tool build breaks because of some code change, so it makes sense to add the tool build to the general build.
dfa89fc
to
569089b
Compare
Makefile
Outdated
@@ -29,7 +29,9 @@ ifeq "$(TAG_SQLITE3)" "" | |||
@echo "Missing dqlite, run \"make deps\" to setup." | |||
exit 1 | |||
endif | |||
|
|||
@go version > /dev/null 2>&1 || { echo "go is not installed for lxd-doc installation."; exit 1; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know enough about Go to really review this part, but the other steps for this target require Go as well. Do they already have a check whether it's installed? Or if not, should this be made more generic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, there is already an implicit check (line 10 with GOPATH ?= $(shell go env GOPATH)
). I'll remove my useless check.
569089b
to
a1eeb81
Compare
Makefile
Outdated
@@ -30,6 +30,8 @@ ifeq "$(TAG_SQLITE3)" "" | |||
exit 1 | |||
endif | |||
|
|||
cd lxd/config/generate && CGO_ENABLED=0 go build -o $(GOPATH)/bin/lxd-doc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use the same sort of invocation we do for the other commands, e.g.
CGO_ENABLED=0 go install -v -tags netgo ./lxd-migrate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gabrielmougard Can you update this?
Makefile
Outdated
@@ -30,6 +30,8 @@ ifeq "$(TAG_SQLITE3)" "" | |||
exit 1 | |||
endif | |||
|
|||
cd lxd/config/generate && CGO_ENABLED=0 go build -o $(GOPATH)/bin/lxd-doc | |||
@echo "LXD-DOC built successfully" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for this line
a1eeb81
to
f752719
Compare
@ru-fu please let me know if/when you would like this merged. Thanks |
I've tested it and it seems to work, so I'm fine with merging it. |
@gabrielmougard needs a rebase now. |
f752719
to
415552e
Compare
317691d
to
def8ca2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
def8ca2
to
3230df9
Compare
Needs a rebase |
3230df9
to
109c2b9
Compare
4453888
to
9dd5bd3
Compare
Signed-off-by: Gabriel Mougard <gabriel.mougard@canonical.com>
Signed-off-by: Gabriel Mougard <gabriel.mougard@canonical.com>
9dd5bd3
to
51d8706
Compare
@ru-fu Now
lxd-doc
can be built from source and executed entirely from theconf.py
file which means that we no longer have to use the makefile and it should directly integrates with the readthedoc pipeline.