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

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

Closed
wants to merge 1 commit into from
Closed

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

wants to merge 1 commit into from

Conversation

versusvoid
Copy link

Fix #196

share crates cache when possible.
@mmun
Copy link

mmun commented Jan 18, 2018

I ran into this as well.

@luser
Copy link
Contributor

luser commented Feb 2, 2018

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

@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
Copy link
Contributor

luser commented Dec 14, 2018

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
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