8000 Add documentation builder by rsdy · Pull Request #186 · foniod/redbpf · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Jul 11, 2023. It is now read-only.

Add documentation builder #186

Closed
wants to merge 5 commits into from
Closed

Add documentation builder #186

wants to merge 5 commits into from

Conversation

rsdy
Copy link
Collaborator
@rsdy rsdy commented Sep 19, 2021

Build and deploy documentation to foniod.org. Normally this should only happen after releases.

@rsdy rsdy force-pushed the documentation-fix branch 3 times, most recently from 9ff2e7a to d097ae0 Compare September 19, 2021 14:14
Signed-off-by: rsdy <p@symmetree.dev>
@rsdy rsdy force-pushed the documentation-fix branch from d097ae0 to d11058f Compare September 19, 2021 14:21
@rhdxmr
Copy link
Collaborator
rhdxmr commented Sep 19, 2021

Hello @rsdy
Long time no see.

I reviewed your PR and I found one error when I run cargo doc with --all-features option.

See the error message below:

  --> cargo-bpf/src/build_c.rs:10:20   |10 | use crate::build::{get_llc_executable, kernel_headers, BUILD_FLAGS};   |                    ^^^^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^  ^^^^^^^^^^^ no `BUILD_FLAGS` in `build`
   |                    |                   |
   |                    |                   no `kernel_headers` in `build`
   |                    no `get_llc_executable` in `build`

error: Compilation failed, aborting rustdoc

error[E0432]: unresolved imports `crate::build::get_llc_executable`, `crate::build::kernel_headers`, `crate::build::BUILD_FLAGS`
  --> cargo-bpf/src/build_c.rs:10:20
   |
10 | use crate::build::{get_llc_executable, kernel_headers, BUILD_FLAGS};
   |                    ^^^^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^  ^^^^^^^^^^^ no `BUILD_FLAGS` in `build`
   |                    |                   |
   |                    |                   no `kernel_headers` in `build`
   |                    no `get_llc_executable` in `build`

cargo-bpf/src/build_c.rs seems to be not used for a very long time. I don't know since when this module is not able to be compiled properly. Hmm..

And I am not sure what build_c.rs is for. So IMO it would be better to remove this code because it is dead code.


I have one question. Your PR only contains git push at the end. I don't understand how this command changes the content of foniod.org. Can you explain me this? Thanks in advance.

@rsdy
Copy link
Collaborator Author
rsdy commented Sep 19, 2021

@rhdxmr Sorry for the radio silence, I've been busy on other projects.

  1. build_c.rs is responsible for building C code. I'm inclined to fix it, since it's a good tool for interfacing C code with Rust, and it seems like the issue is with LLVM.

  2. git push at the end is supposed to update the repo. If you look at the following snippet, the work happens in the checked out directory that is https://github.com/foniod/foniod.org

     # check out the website repo
     git clone https://$GITHUB_TOKEN:@github.com/foniod/foniod.org publish
     
     # clean up the existing docs
     rm -rf publish/api/
     mkdir -p publish/api/
     cp -r target/doc/* publish/api/
    
     # this is an automatic redirect that btw needs to be fixed ;)
     >publish/api/index.html echo '<meta http-equiv="refresh" content="0; url=https://ingraind.org/api/redbpf/" />'
    
     # change directory, commit changeset, push
     cd publish
     git add *
     git commit -a -m '[CI] Update redbpf docs'
     git push
    

@rhdxmr
Copy link
Collaborator
rhdxmr commented Sep 19, 2021

@rsdy
I don't understand how git push deploys the content to foniod.org site. It just pushes the code to github.

If deploying the content to foniod.org is completed by git push, the foniod.org site should already serve API docs correctly. Because the repo already has docs.

Signed-off-by: rsdy <p@symmetree.dev>
@rsdy
Copy link
Collaborator Author
rsdy commented Sep 19, 2021

@rhdxmr Sorry, you're right. I think that's a separate bug, because I have changed the location of the build artifacts from root to /docs/. Will fix that on this branch once doc build goes through.

On another note, as you see, I removed build_c.rs. I took another look, and it seems superflous at this stage.

Signed-off-by: rsdy <p@symmetree.dev>
Signed-off-by: rsdy <p@symmetree.dev>
@rsdy rsdy force-pushed the documentation-fix branch from 80a9f87 to 63dfaa5 Compare September 19, 2021 16:04
@rhdxmr
Copy link
Collaborator
rhdxmr commented Sep 19, 2021

@rsdy unfortunately the build test of documentation had failed because of an authentication problem.

BTW what projects are you working on these days? Are there some interesting subjects or new tech? I am just curious. Can you tell me if you don't mind?

Signed-off-by: rsdy <p@symmetree.dev>
@rsdy
Copy link
Collaborator Author
rsdy commented Sep 19, 2021

@caniszczyk do you think you can help us set up an api.foniod.org domain on netlify to serve static build content from this repo? I've tried but it doesn't seem like I have the necessary permissions.

@caniszczyk
Copy link
caniszczyk commented Sep 23, 2021 via email

@rsdy
Copy link
Collaborator Author
rsdy commented Sep 24, 2021

@caniszczyk Thanks for this. We're looking to create a special branch on this repo that hosts documentation. This is the cleanest way to host the API docs due to permission boundaries in GitHub. Will test this some more, but I should be set with the required permissions on both ends.

Please also delete the following sites on Netlify, they're no longer needed:

@caniszczyk
Copy link
caniszczyk commented Sep 24, 2021 via email

@rhdxmr
Copy link
Collaborator
rhdxmr commented Sep 25, 2021

I just re-ran all jobs of github action and I will see whether the building documentation test succeeds

@rsdy
Copy link
Collaborator Author
rsdy commented Sep 25, 2021

@rhdxmr I haven't followed up with the necessary changes to make this build successfully. I'll be able to take a look one of these days.

@rsdy
Copy link
Collaborator Author
rsdy commented Nov 16, 2021

closing as superceded by #225

@rsdy rsdy closed this Nov 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0