Skip to content

[Feature Request] Cache builds #447

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

Closed
jyn514 opened this issue Oct 26, 2019 · 5 comments
Closed

[Feature Request] Cache builds #447

jyn514 opened this issue Oct 26, 2019 · 5 comments
Labels
A-newcomer-roadblock Area: A problem that isn't a bug, but makes it harder for people to contribute P-low Low priority issues

Comments

@jyn514
Copy link
Member

jyn514 commented Oct 26, 2019

I don't mind this being all or nothing, but it would be nice in cratesfyi build crate my_crate_here && cratesfyi build crate my_crate_here for the second build to be a no-op. I see the line 2019/10/26 03:02:42 [DEBUG] cratesfyi::db::add_package: Adding package into database in the output, so the binary would just have to check whether the database entry exists already, and if so not rebuild the package.

Cache invalidation shouldn't be an issue since all versions on crates.io should be immutable.

@jyn514
Copy link
Member Author

jyn514 commented Oct 27, 2019

Related: rustup install nightly always installs the latest version, even if there is an earlier version that is cached. Rustwide should avoid installing the toolchain if it already exists.

@pietroalbini
Copy link
Member

it would be nice in cratesfyi build crate my_crate_here && cratesfyi build crate my_crate_here for the second build to be a no-op.

We actually rely on being able to rebuild the same version of a crate multiple times on production, for example when there is a bug in docs.rs or rustdoc and the output is broken. What's your use case for this?

Related: rustup install nightly always installs the latest version, even if there is an earlier version that is cached. Rustwide should avoid installing the toolchain if it already exists.

This is intentional, because on production we need to always build on the latest nightly. While developing locally it's annoying though (especially with the huge stds nowadays), so what do you think about adding an environment variable that disables toolchain updates in docker-compose?

@jyn514
Copy link
Member Author

jyn514 commented Oct 28, 2019

We actually rely on being able to rebuild the same version of a crate multiple times on production

Ok, in that case this probably doesn't make sense to add. I just wanted it for convenience so I don't have to remember which crates have already been built, but I can do that by looking at the website locally.

what do you think about adding an environment variable that disables toolchain updates in docker-compose

That might be convenient. It looks like rustup doesn't have an easy way to say 'install this only if it's not installed' but we can just look at the output of rustup toolchain list.

@pietroalbini
Copy link
Member

You can use Workspace::installed_toolchains to check whether the toolchain is already installed.

@jyn514 jyn514 added A-newcomer-roadblock Area: A problem that isn't a bug, but makes it harder for people to contribute P-low Low priority issues and removed minor labels Jun 27, 2020
@jyn514
Copy link
Member Author

jyn514 commented Jun 24, 2021

The toolchain thing actually doesn't need a separate environment variable, you can just set DOCSRS_TOOLCHAIN to a specific nightly. So I don't think there's much point in keeping this issue open.

@jyn514 jyn514 closed this as completed Jun 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-newcomer-roadblock Area: A problem that isn't a bug, but makes it harder for people to contribute P-low Low priority issues
Projects
None yet
Development

No branches or pull requests

2 participants