-
Couldn't load subscription status.
- Fork 881
Generate manpages #2373
Generate manpages #2373
Conversation
rkt/rkt.go
Outdated
| os.Exit(0) | ||
| } | ||
|
|
||
| // update rkt.bash |
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.
wrong comment
rkt/rkt.go
Outdated
| Section: "1", | ||
| } | ||
|
|
||
| doc.GenManTree(cmdRkt, header, "dist/manpages") |
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.
Maybe we should not ignore errors?
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 will fix.
|
Assigning to @s-urbaniak to get a review. |
|
Seems odd that we are using the How about having a separate |
| // // Uncomment to update rkt.bash | ||
| // stdout.Print("Generating rkt.bash") | ||
| // cmdRkt.GenBashCompletionFile("dist/bash_completion/rkt.bash") | ||
| // os.Exit(0) |
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.
👍 for removing commented code
|
@s-urbaniak PR updated. I also updated the description above. PTAL. |
rkt/manpages_gen.go
Outdated
|
|
||
| err := doc.GenManTree(cmdRkt, header, "dist/manpages") | ||
| if err != nil { | ||
| fmt.Printf("Failed to generate the man pages: %v\n", err) |
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.
nit: use stderr instead?
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.
ok
|
@alban small nits, I am still unsure of checking in the generated man files (@jonboulle, comments?), else LGTM :-) |
|
I agree with @s-urbaniak that we should avoid committing the generated artefacts - otherwise we're inevitably going to have rot between them. Can't we just keep the generation as part of the release process and in notes for distributors? |
|
@s-urbaniak @jonboulle Updated. I added new commits and I will squash them once it looks good to you. I removed the generated files from the git repository (except the protobuf generated files, see #2004 - to be done in a different PR), and updated the build scripts. |
| @@ -1,3 +1,12 @@ | |||
| ## vUNRELEASED | |||
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.
the v is superfluous.
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.
We usually prepend v to version number, so I think it's ok.
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.
got it, thanks!
|
LGTM |
scripts/build-rkt.sh
Outdated
| set -e | ||
|
|
||
| ./autogen.sh && ./configure --enable-tpm=no --with-stage1-default-images-directory=/usr/lib/rkt/stage1-images --with-stage1-default-location=/usr/lib/rkt/stage1-images/stage1-coreos.aci && make -j4 | ||
| ./autogen.sh && \ |
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.
Hm, we have the set -e call above so chaining everything with && is not really necessary. Could you simplify it by removing those && and removing one level of indentation in the lines below?
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.
ok
rkt/rkt.mk
Outdated
| # RKT_STAMP deliberately not cleared | ||
| # RKT_BINARY deliberately not cleared | ||
|
|
||
| manpages: |
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.
/me turns a blind eye on this. The concerns I have, and which maybe I'll address later when I simplify some bits and document them, are:
- I would make it a part of
make all. - I would prefer the files to be generated inside
$(BUILDDIR)- That would require passing that directory to the generator, so it would know where to put the files.
- But that complicates things (make clean, deps, forwarding variables, blah blah blah), so don't bother with it for now.
- Pretty printers could be used there.
- No big deal, since the output is rather short.
- These additions should be put above the
$(call undefine-namespaces,LOCAL)line.
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 would make it a part of make all.
It would make the compilation quite slow if we run make manpages/bash-completion at each make though... On my laptop:
- time make manpages: 25 seconds
- time make bash-completion: 24 seconds
- total: 49 seconds
I would prefer the files to be generated inside $(BUILDDIR)
That would require passing that directory to the generator, so it would know where to put the files.
But that complicates things (make clean, deps, forwarding variables, blah blah blah), so don't bother with it for now.
Ok, I'll skip that for now.
Pretty printers could be used there.
No big deal, since the output is rather short.
How to do that?
These additions should be put above the $(call undefine-namespaces,LOCAL) line.
Will do in the next update.
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.
It would make the compilation quite slow if we run
make manpages/bash-completionat eachmakethough... On my laptop:
- time make manpages: 25 seconds
- time make bash-completion: 24 seconds
- total: 49 seconds
I wanted it to be a part of make all, because it is about building everything. Possibly this could be controlled with --enable-man and --enable-bash-completion flags which could be disabled by default.
Pretty printers could be used there.
No big deal, since the output is rather short.How to do that?
manpages:
$(VQ) \ <- this expands to @ when pretty printing (V=0,1,2) or to nothing for raw output (V=3)
set -e; \
$(call vb,vt,GEN,manpages) \ <- this will print "GEN manpages" for V=1,2, nothing otherwise)
ls rkt/*.go | blah blah blah
|
Updated. PTAL. |
|
Running doesn't work for me because before make, there's nothing in |
|
Meh, as a workaround for this issue ( |
|
The workaround works 👷 |
|
Cool. |
|
LGTM |
|
Ok, commits squashed. |
|
LGTMTMOG |
|
Nit: actually you don't update the release guide but the release script (commit message). |
To update the manpages, use:
$ make manpages
It will generate the manpages in dist/manpages/.
Also the bash completion file is no longer built manually, but you can
use:
$ make bash-completion
It will generate dist/bash_completion/rkt.bash.
The release scripts are updated to make sure that each release
contains an up-to-date version of the manpages and the bash completion
file.
manpages: generate manpages with cobra
To update the manpages, use:
It will generate the manpages in dist/manpages/.
Also the bash completion file is no longer built manually, but you can
use:
It will generate dist/bash_completion/rkt.bash.
The release guide (release.md) is updated to make sure that each release
contains an up-to-date version of the manpages and the bash completion
file.
Fixes #2370