-
Notifications
You must be signed in to change notification settings - Fork 52
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
XCRemoteCache prototype yielding unexpected results and looking for guidance on how to debug #92
Comments
I think you can see xcremotecache logs by using
See more: https://github.com/spotify/XCRemoteCache/blob/master/docs/FAQ.md |
Thanks, @dwirandytlvk. Following your tip, I found out those 172 modules the consumer is failing to find in the cache have the following error:
There are no errors in the producer log and the md5 files can be found on the server. I do not know yet why these md5 files are missing in the consumer. I also found 175 occurrences of Did anyone experience these issues or have any hypotheses on what could be going on? |
Hello! The warning about I prepared a list of steps to troubleshoot low cache hit rate - PR: #93
|
Thanks, @polac24. By following your troubleshooting steps I discovered those The xcodeproj files are generated via Looks like I need to fix this on the Are any other integration problems with .... Additionally, I also saw the following errors in the producer side:
And these errors on the consumer side:
|
Hi! Producer:
Consumer:
|
Thank you @polac24 for the insights and sorry for the delay. I went on holidays and now changed machines. I am (now) using a M1 MAX with Xcode 13.2.1 and RC 0.3.7. With the new machine, the As suggested, I used the
As far as I can tell, And the consumer build does not leverage the cached artifacts, also shows the
where The consumer logs also contain the same amount (174) of So, it looks like:
Regarding #1, I did not find yet any issues or particularities about those 12 modules. |
I tried to not use RC for those 12 modules to see if cache hits would improve, but what I saw instead was the return of those I simply deleted the As I was surprised to see that again, I deleted And I am now consistently stuck with that error again. |
Hi!
|
Hi! Let's reduce the problem scope. I changed workspaces to another that builds within 1 minute. It has 70 projects, each with one or more targets. That is a sub-project of the previous one and therefore contains some of those 12 libraries. I am including my own projects, as well as submodules and Pods (which are committed to the repo). I am consistently getting the So I checked the Xcode IDE for Now that you brought it up, I also checked the And I am not running Xcode in the Rosetta. Still, when I run |
Yes! So these are the ENVs containing
I also checked the other ENVs listed in #42 and for me these are their values:
And From what I read on #33, #39 and #42, I should not be seeing this issue. Do you have any clues? |
@polac24 I have good and bad news 📦 I got both producer and consumer to work. The producer logs did not contain I basically cut all the corners (to identify what problems have to be addressed). Meaning that I overrode all those ENVs so they don't not contain x86_64 and manually moved each auto-generated With that working, my plan was to undo change individually to find out what is causing the issue. However (here come the bad news), without doing any changes (just deleting caches) and re-building in producer mode a few more times and randomly got That means I will not be able to undo changes individually and reliably test the outcome to identify the issue. Have you seen this behavior before? Any tips on how to debug or isolate the problem? |
I was thinking about that and the case is really strange. I have never seen that. TBH, probably building xcpostbuild from Xcode and debugging the flow locally is inevitable. |
To delete the caches, I run Then, to switch to consumer mode, I do the same (but don't delete the docker folder) and run the automatic integration commands, open Xcode and CMD+B. About building xcpostbuild from Xcode and debugging the flow locally, is it possible to do that when building my project? How would I got about doing that? (currently the compiled swift binaries are called from the sh build steps) Thanks again for all the support! |
Your steps look legit. Debugging XCRemoteCache locally is really simple. I prepared a short instruction. |
Thank @polac24 Before we go into solving the Producer mode issue (random missing file errors), I did some more testing with the successful case I mentioned (14s consumer build with no errors) and found:
These are key issues that take priority over the Producer issues at this point. Can you help with these issues? |
Hello!
|
Hi! This is the content of
I see the same when running
Deleting the This is the content of all my
Regarding the
No, I have not yet built RC from code, so far I just tried making things work on the RC user side, using the binaries provided in the release page. What's behind that Regarding the order of build steps, the step I manually moved after the RC prebuild step is a custom code gen step. I did that because in a 100% clean build scenario, the code gen step will gen code first and then RC prebuild would trigger. That could cause RC prebuild step to fail. And even if it did not, if RC prebuild hits the cache, I don't want Xcode to invest time generating code that is not going to be compiled. In any case, I tried building the consumer without reordering the steps and the 2nd build failed as well. Here is the cycle message:
|
Hi!
|
Okay, so I have now tried to debug RC following the instructions on Development.md. But it did not work :O The RC project builds and runs (waiting for execution) just fine, but when I build my project (with build steps updated to point to the produced binary in DerivedData), instead stopping on the RC breakpoints, Xcode shows "Finished running xcpostbuild : xcpostbuild" in the status bar and my project also does fully build the code (it does not reuse the cache). RC logs do not show any errors (I only notice some Xcode stopped to use the cached artifacts once I run I also added the And regarding the cycle, no, neither BUCK nor Xcode complain of cycles unless I ran |
@polac24 I just realized I might not have been clear when I first said that debugging is not working, but I meant my project is no longer debuggable after In my last message, I did download the RC code and was also unable to debug it by following the instructions. The first time around, I built the |
It becomes challenging to track so many questions in a single issue. Can you create separate issues for independent problems?
|
Sure, thanks @polac24! I created the following issues to cover all the pending topics on this thread:
From my point of view, these issues are sorted by priority. At this point I am looking to validate RC as a viable solution (and the debugger must work on my application) and to estimate the effort to adopt it properly in case it is viable. But I do need to sort out all these issues (particularly the first 3 in case I move forward with RC). Thanks again! |
@cezarsignori, can we then close this ticket? |
Sorry, it took me a while to see your message. Sure. Thanks for your help! |
Hi @cezarsignori did you find out the root cause of From this issue I understand that it has something to do with Thank you! |
Hey @hendych , sorry for the late response. I was off on holidays. |
Hi @cezarsignori thanks for your respond! |
I am trying out XCRemoteCache and got an unexpected outcome. I am unsure how to interpret it and about how best to investigate and solve the problems I found. Thought of asking here for guidance.
What did I do?
I performed the "automatic integration" of XCRemoteCache in my workspace (for 329 xcodeproj files).
I set my machine up to be a producer, then built the app and verified all (329) artifacts were correctly stored in localhost.
Then, I re-configured my machine to be a consumer, deleted the DerivedData directory, and clean built the app.
What happened?
Unfortunately only 60s were saved (from a total of 30 minutes).
After inspecting the Xcode build log, I noticed the following:
"[RC] Cached build for X target"
"[RC] Disabled remote cache for X"
The problem
After inspecting the XCRemoteCache code, I found out
"[RC] Cached build for X target"
means a cache hit and"[RC] Disabled remote cache for X"
the opposite. Now, I expect 157 modules cache hits to save a lot more than 60s total. So I wonder if XCRemoteCache is actually doing what it is supposed to do on my project and if not, why?Also, I clean built the same branch without any code changes in the same machine. Why did 172 modules failed to hit cache? And how do I investigate the issue more effectively? Right now, I am reading the XCRemoteCache code looking for issues that could cause a miss and trying to identify a pattern across those modules in my workspace, since all build artifacts are they where should be (logs match files and location on local server).
And lastly, it is not clear to me if the pre-build warning is a problem or not and how to get rid of it.
I appreciate any insights. Thank you!
The text was updated successfully, but these errors were encountered: