-
Notifications
You must be signed in to change notification settings - Fork 464
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
Xcode project corruption due to UUID conflict #681
Comments
@jmkk Does your project have How do you reference |
We have We're referencing the |
@sebastianv1 any updates? I'll be happy to provide more context as needed. Thank you! |
@jmkk No update here. I haven't been able to reproduce this issue and a sample project would help a lot. If you can't get a repro project, do you mind getting the raw number of objects from a project that breaks. You can do this through |
I just verified and I see the issue persisted in Cocoapods 1.7.0 beta 3, but I do not see it reproduce in version 1.7.0.rc.1 and later. So whatever it was (be it in Cocoapods or Xcodeproj 1.9.0 release) it seems fixed (or the race conditions changed...) |
Spoke too soon. At a different commit # for our project, 1.7.1 still is broken the same way. I will spend more time trying to reproduce with a test project. |
@sebastianv1 Here's how I hope you can reproduce the issue using your large project. Just add this to your installer.generated_projects.each do |proj|
xcconfigsPath = "../../../build/buildSettings/xcconfigs"
common_ref = proj.new_file("#{xcconfigsPath}/X.common.xcconfig")
debug_ref = proj.new_file("#{xcconfigsPath}/X.debug.xcconfig")
release_ref = proj.new_file("#{xcconfigsPath}/X.release.xcconfig")
warnings_ref = proj.new_file("#{xcconfigsPath}/X.common.warnings.xcconfig")
proj.build_configurations.each do |bc|
if bc.name == 'Release'
bc.base_configuration_reference = release_ref
else
bc.base_configuration_reference = debug_ref
end
end
end (The paths referenced there do not matter, and you do not need to have these xcconfigs files in the right locations - the refs will be broken but that’s ok for this purpose). Make sure Hope this helps a bit. |
@sebastianv1 lets try to review this again this week? |
Any updates? @dnkoutso @sebastianv1 Thank you |
not much from me, currently on vacation in August. |
@jmkk I've tried plugging your post install hook into one of our larger projects and couldn't seem to repro. A reproducible project is ideal here to get this fixed. Based on your description above though it still seems to be a magic number causing this bug (since it disappeared then reappeared). One step that might help debug is if you can the use |
@sebastianv1 I've spent some more time debugging this and this is what I've found - at least this is my understanding based on my limited familiarity with Ruby. TL;DR the issue can be reproduced when adding new file references to the project in post-install, when the number of existing file refs almost exhausts
What purpose does the |
@segiddins Do you remember why the line @jmkk inlined above: In order to fix this in the short term, maybe we can add another installation flag to disable stabilizing target UUIDs since @jmkk 's project already disabled deterministic UUIDs. We would just have to add another validation to incremental installation flag. Thoughts @dnkoutso ? Sorry this is taking so long to resolve @jmkk and thanks for being so patient. |
At the time of reporting the issue I did confirm that without #627 things worked fine. It was a while ago so I do not remember all the details. The code changed enough since then that reverting from master today is not trivial. |
I have the same issue in cocoapods 1.8.4.
` |
I just spent all day debugging this issue and found this post. The problem still exists in cocoapods 1.15.2. When adding 4 package_references using post_install, the pbxproj becomes corrupted. When only adding 3, it is working as expected. |
We run into a race condition/UUID conflict that seems to be related to changes made in #627
Our sizeable project uses Cocoapods, and when testing with 1.7.0.beta.2 we run into an issue where a specific number of files included in the Pods project resulted in an apparent UUID conflict, which results in a corrupted Pods.xcodeproj generated.
The issue seems to reproduce only when:
common_ref = project.new_file("Some.common.xcconfig")
After the project has been saved, the newly added file reference gets assigned a already existing UUID (46EB2E00000000) and replaces
rootObject
. With this, the project gets corrupted as root object no longer points to an expected data type (PBXFileReference
instead ofPBXProject
).I'm still trying to find a self-contained project that reproduces the issue, but it's been quite challenging. Saving the project before adding the new reference seems to work around the issue, but causes us to double-save the project which is wasteful.
The text was updated successfully, but these errors were encountered: