-
Notifications
You must be signed in to change notification settings - Fork 189
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
Rebuild crate dependencies when the rust compiler version changes #45
Conversation
I'm sorry to hear about this issue! I haven't looked at this problem in detail, but I feel like one of two things is true (at least in an ideal world):
Since you've looked at this problem more closely than I have, what do you think? |
I agree. I decided to dig deeper into what is going on and I don't believe the buildpack should have to worry about the build cache. When the compiler is upgraded it triggers the project to rebuild its dependencies. But it doesn't clean the target folders for the crates in
I think you're correct. It looks like not cleaning what's in cargo's registry is a known missing feature. Fixing the library that is a problem is a good idea. I incorrectly assumed it was an issue with the buildpack because the problem only occurs on linux, and I primarily develop on macOS and the only time I was having an issue was when building on Heroku. I just spun up a linux VM and created a simple project with the library as a dependency and was able to recreate the failure by performing On linux, the custom build script for the library creates a symlink in its
As I've investigated this more I've concluded this isn't an issue specific to the compiler updating. It just so happens that the only time the buildpack is rebuilding existing dependencies is when the compiler version is changed. If you agree that it is a good idea to clean
For my use case I'm ok with not making this a configuration variable. I made it configurable because I was not sure if there are other users who have a longer or more complex build process who don't want to clear the cargo registry folder. Let me know what you think and I can update or close this PR. |
This sounds like an upstream bug that should be fixed upstream, if possible. But since that hasn't happened, let's go with a plan where we clear the entire build cache whenever the compiler version changes. (But don't clear anything if the compiler version stays the same.) Sound reasonable? |
b3243eb
to
11a4591
Compare
Sounds good to me. Should I remove the config var? |
I fixed the issue with the crate that was causing the error. |
I've noticed that every time a new version of Rust is released my Heroku deployments fail and I have to purge the build cache using the Heroku CLI. It turns out that there is one particular crate that has a build script that fails. I intend on working with the maintainer of the crate to make their build script more resilient. But, I thought it might be nice to also have the option to rebuild all crates when a new version of Rust is released.