Skip to content
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

Easier debugging when using cmake commands generated by mrdocs #762

Open
anarthal opened this issue Dec 6, 2024 · 3 comments
Open

Easier debugging when using cmake commands generated by mrdocs #762

anarthal opened this issue Dec 6, 2024 · 3 comments

Comments

@anarthal
Copy link

anarthal commented Dec 6, 2024

I've had a hard time figuring out what was going wrong in #761, in part because CMake generated files seem to be deleted as soon as mrdocs return. When things go wrong, it's very difficult to find out what happened.

In particular, I had to invent an ugly workaround to copy compile_commands.json to a location where mrdocs wouldn't delete it.

I think mrdocs shouldn't be trying to hide CMake generated files. They are a valuable tool when things go wrong (e.g. imagine a non-Boost user submitting a bug report).

@alandefreitas alandefreitas moved this to Accepted in MrDocs Dec 23, 2024
@alandefreitas
Copy link
Collaborator

I think mrdocs shouldn't be trying to hide CMake generated files

Yes. We could leave it there when the process fails. We must remove it when it succeeds because no one wants those temp files in the output directory.

@anarthal
Copy link
Author

Note that configuring cmake for the first time takes non-trivial amount of time, in the order of several seconds for Boost libs depending on Asio. Would not deleting temp files provide an improve in performance for rebuilds? Rebuilds being slow is one of my main pains with quickbook, and I think antora+mrdocs are in the same order of magnitude.

I don't know if this is fact is relevant or not - keeping the cache might involve other problems.

@alandefreitas
Copy link
Collaborator

Would not deleting temp files provide an improve in performance for rebuilds?

Mmmm... That's a different issue. There are implications in terms of performance and correctness.

In terms of correctness, the command in mrdocs.yml is valid when it works for the first time. Because reusing the cache in CMake is not reproducible, CMake doesn't guarantee it will even attempt to have the same results. So there's this problem: people often want to clear their caches when trying something new to ensure the command works when being run for the first time.

In terms of performance, MrDocs assumes the command in mrdocs.yml will usually work once it's set up, so I think that's the answer in that regard.

There's also a matter of correctness and separation of concerns when not using CMake directly. One thing is CMake expecting the user to remove ./build for a complete rebuild. Another thing is expecting the user to remove a temporary MrDocs directory they shouldn't even know exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Accepted
Development

No branches or pull requests

2 participants