-
Notifications
You must be signed in to change notification settings - Fork 313
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
Heroku CI requires to always rebuild #93
Comments
In what way is the code not compiled correctly? Is it missing some files or skipping compilation completely for CI builds? |
/cc @joshwlewis |
It's missing some files that should have been compiled. Could be from force pushing to the branch? |
Force push should not affect it. What kind of files are missing, is it skipping compiling some files or are source files? Are you seeing any errors? |
Here's the test setup log:
And here's the test log:
|
Hi @fbjork -- I suspect this is a caching issue of some kind. I have some suspicions as to why. I'll look into it. |
I think I've found the issue. When we're extracting the test cache, we're not respecting the |
I've just deployed a change to our test runner that respects the All that said, I'd be curious to see if the issue has improved now, and also how the rebuild works. If we can support incremental builds, that would be pretty slick. |
We are caching build artifacts in the normal slug compilation cache, is this different from the test cache? AFAIK, no caching changes were made when CI support was added.
I think the assumption was that git will only touch changed files and the changed files will have a newer mtime than those extracted from the cache. If you are always retrieving a full source archive without timestamps this will not work, I would be surprised if incremental compilation for the app ever worked if this was the case. We never recompile deps unless they change though because the comparison is not based on mtimes. |
I wonder if we should change back to always force compiling the app 58710ee. |
The test cache is shared for all test runs. So the cache will have compiled files from the last test run in that pipeline, which could be a different branch or commit. The cache for production builds is separate cache, and should contain cached files from the last build of that app.
Yeah, that's true. It should not work any different.
I have a suspicion that your team would know if incremental builds weren't working for production builds. Heroku CI uses a slightly different build process than production builds, it's possible that the mtimes are lost only for CI.
Can you clarify that? Do you mean app files are compiled based on mtimes, but dependencies are compiled based on something else? |
Hmm, actually, I think this may be right. Since git doesn't track mtimes, any git based deploy (like However, the build-api should support mtimes, so incremental builds may work in that case. |
Did something change on Heroku's side this morning? No builds are working now in CI.
|
My guess is that the This is probably a bug in Hex also, it should not try to use a locally cached package if it does not exist. I will add a check for that in Hex. |
A workaround until I push out a new Hex version and this is fixed on the Heroku side is to add |
We actually have always_rebuild=true set already. Note that this log is from the test setup step |
Actually, I was able to reproduce this on my own Elixir project. I've rolled back a change we shipped this morning, and it seems good again, can you confirm/deny @fbjork? |
Yes, works now! Would be great to not have to always rebuild all the time, will that be possible? |
@fbjork It sure would be nice. I'm not sure it's something we'll ever be able to support given that git doesn't track timestamps. If the recompilation check would be based on the contents of the file, rather than metadata, it'd be a different story. The change that I deployed before the weekend caused the issues you were seeing. The error was a |
OK! I deployed a change to better inspect what was going on, and it turns out that the timestamp I was using i.e. I've just deployed that change, so file modification times should be set correctly now. Hopefully that'll help with partial recompilations. |
Does 73df63b fix this issue? |
I think it was already fixed but we can close this now. Please let us know if you still have issues. |
@ericmj Sounds good. We'll update our projects to use |
It's a shame we can't get incremental building working. We could get around this by updating the file modification times based on state we keep in the test cache. It does require elbow grease and fingerprinting of files. |
@ericmj we're noticing rebuilds on every CI run now. Has there been any change that could have affected this? |
Sorry, I don't really maintain this project anymore and I have never developed or tested the buildpack on Heroku CI. |
I'm currently testing the Heroku CI beta and noticed that randomly tests would fail due to new code not being complied properly.
I can work around this by setting
always_rebuild=true
, but I would prefer not to. Any idea what's going on?The text was updated successfully, but these errors were encountered: