Embed manpages into the binaries#93
Merged
Merged
Conversation
Collaborator
Author
|
Oh this breaks the arm64 cross compilation, I'll work on a fix |
With this invoking one of the utilities with `-h` will display the manpage. Since quark is not a "system utility", we can't expect people to go to the trouble of installing manpages, and typing `man ./quark-mon.8` is a pain. It's also likely that the binary is sent somewhere and thus the man relationship was lost. I had to write a mini-utility to embed the manpage, it's a bit sad that there isn't a `mandoc -T c` to export the manpage as a C struct. Arm64 cross compilation gets a little bit trickier: In order to build quark-mon, quark-btf and quark-test, it needs to build manpage.h, and to build manpage.h it needs to build man-embedder. But it can't build man-embedder for arm64, since we must be able to execute it! We fix it by cheating the order build, we force manpages.h to be evaluated before `all` in the host system. Which pulls man-embedder for the host and generates manpage.h. The only drawback is that man-embedder will stay built for the host system, which is fine since it's a build-system executable.
nicholasberlin
approved these changes
Oct 28, 2024
82b9e6e to
cf121ba
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With this invoking one of the utilities with
-hwill display the manpage.Since quark is not a "system utility", we can't expect people to go to the trouble of installing manpages, and typing
man ./quark-mon.8is a pain. It's also likely that the binary is sent somewhere and thus the man relationship was lost.I had to write a mini-utility to embed the manpage, it's a bit sad that there isn't a
mandoc -T cto export the manpage as a C struct.