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

Reuse existing target directory #402

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

thomaseizinger
Copy link
Sponsor Contributor

@thomaseizinger thomaseizinger commented Feb 24, 2023

Previously, each synthetic project got its own target directory. That results in a lot of recompilation. Because the entire workspace of cargo semver-checks is within the original projects target directory, we can simply point the cargo doc process to that one.

This allows us to reuse a lot of compilation artifacts up to the point where an invocation of cargo semver-checks only takes a couple of seconds if the user already has a debug build locally or a cache in CI.

Originally, I thought that walking up two directories is a bit of a hack but it is actually extremely stable in my testing. It works with custom target dirs (CARGO_TARGET_DIR) because our entire workspace is within the parent project's target dir.

Thoughts?

Resolves #401.

@obi1kenobi
Copy link
Owner

Thanks for the ideas and PR!

Let's keep the discussion here focused on the specific implementation of the idea, and discuss the idea itself in #401. I'll switch to the issue so we can sort that out first.

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

Successfully merging this pull request may close these issues.

Caching-friendly generation of "current" rustdoc JSON
2 participants