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

Use sccache when available #221

Open
LeSnake04 opened this issue Mar 5, 2023 · 3 comments
Open

Use sccache when available #221

LeSnake04 opened this issue Mar 5, 2023 · 3 comments
Labels

Comments

@LeSnake04
Copy link

LeSnake04 commented Mar 5, 2023

Sccache speeds up the install process by reusing existing compiled libraries.

I think it would be useful if this plugin checks whether sccache is installed and use it if available.

Using it works by setting RUSTC_WRAPPER=sccache.

@nabijaczleweli
Copy link
Owner

Sounds like you want to set that in the environment with the appropriate path, then, right? I don't see how cargo-update needs to (or can) be involved?

@LeSnake04
Copy link
Author

LeSnake04 commented Mar 5, 2023

Yes, It works by setting the environment variable on each run. But its easy to forget to do that. And I dont want to do it via the global cargo config, since this would affect personal rust coding projects as well, which doesnt make sense IMO.

It would be nice if i could tell cargo-update to use it. And this could allow less expericenced users to make use of it just by installing it. Though maybe it makes sense to make it opt-in by adding cargo install-update-config --enable-sccache and cargo install-update-config --disable-sccache to avoid breaking stuff. Once its clear it doesnt break things make it enable when its available, similar to the cargo-binstall integration.

Also it would help a lot if there was a env vars option. These variable defined via e.g. cargo install-update-config --add-env RUSTC_WRAPPER sccache . This would also be quite useful for other config customizations users only want for updating cargo applications. The counterpart to remove it could look like this: cargo install-update-config --rm-env RUSTC_WRAPPER

@alpha-tango-kilo
Copy link

@LeSnake04 cargo install-update respects your ~/.cargo/config.toml, and you can configure sccache to be used in there like so:

[build]
rustc-wrapper = "/path/to/sccache"

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

No branches or pull requests

3 participants