Skip to content

Strip absolute path to compiled rust package to share crates cache when possible. - #206

Closed
versusvoid wants to merge 1 commit into
mozilla:masterfrom
versusvoid:cross-package-rust-cache
Closed

versusvoid wants to merge 1 commit into
mozilla:masterfrom
versusvoid:cross-package-rust-cache

Conversation

@versusvoid

Copy link
Copy Markdown

Fix #196

share crates cache when possible.
@mmun

mmun commented Jan 18, 2018

Copy link
Copy Markdown

I ran into this as well.

@luser

luser commented Feb 2, 2018

Copy link
Copy Markdown
Contributor

Hey, sorry for letting this sit for so long, I would really like to fix this! I took a look at your patch, and I think we could do things in a slightly simpler way (just remove -L, --extern, --out-dir args from the hash calculation entirely). However, from local testing unfortunately the build directory winds up in the generated rlib in a number of places, so I don't think we can actually do this without figuring something out there. ☹️ There is a rustc issue that tracks adding a compiler option to remap paths, but it hasn't stabilized yet. It's available in nightly Rust as -Zremap-path-prefix-from=... -Zremap-path-prefix-to=..., but even with that I don't seem to get bit-identical rlibs out for dependent crates when building in different directories.

@mitchmindtree

Copy link
Copy Markdown

@luser just thought I'd mention that it looks like the blocking issue you linked has since been stabilised in rustc v1.26.

@freesig and I are currently trying to reduce some massive build times nannou-org/nannou#178 and it looks like this might be a nice win, at least until cargo gets some sort of built-in caching. That said, I haven't actually tested this PR to know if it contributes significantly - today's the first day I've taken a look at sccache and I'm still getting my head around what it is and how it works!

@luser

luser commented Dec 14, 2018

Copy link
Copy Markdown
Contributor

I've got an alternate patch for this that seems to work reasonably well. I'm going to close this out and open a separate PR for that. Thanks for the patch, I'm sorry it didn't get merged!

@luser luser closed this Dec 14, 2018
tottoto pushed a commit to tottoto/sccache that referenced this pull request Feb 6, 2026
* Run CI checks & tests on Windows and Mac

* Fix uds windows compile

Co-authored-by: Lucio Franco <[email protected]>
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.

4 participants