-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Xcode10 (new build system) - if incremental build, Embed script doesn't run #8073
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
Comments
I have the same issue. This causes me having to rebuild the entire project, which takes about 15 minutes. But I only changed a single line in code in one of the development pods. |
I have a possible temporary solution |
Even in the current build system the input/output files are used to speed up builds. If nothing has changed then there is no need to run these scripts. Please include a sample app demonstrating this issue as I cannot reproduce locally. |
Here is the sample project https://github.com/mkubista/CocoapodsTest
Project is in git with all necessary files. |
I have the same issue in a large project with around 6 development pods. Whenever we modify anything in a development pod, we are forced to perform a full clean & build before the changes are propagated on device (or in simulator). |
Thanks for sample will take a look when time permits. |
Confirmed. |
Quick debugging shows its a new build system issue only and despite the file timestamp changing Xcode does not treat the resulting framework as "dirty" and therefore skips the script phase... Will try to see if I can work around it but unfortunately this might need to be a radar instead. |
This is an unfortunate regression in Xcode 10 new build system. Switching to legacy system makes it work just fine. I believe Apple is aware of this. Switching the input/output paths to point to the actual executable inside the framework makes the problem go away but we may not want to do that. This means that the script phases will re-run correctly as long as the sources of the framework change but it won't catch resource changes or other things inside the For now it seems that Xcode 10 build system will always require a clean build to ensure latest changes are present which sucks. We could maybe add an option to not use input/output paths which would "fix" this but it is ultimately a workaround. |
I will try to report it in Apple Bug reporter. Will see, what they will say... |
I created a radar (41126633) for that in June. They are aware, got a sample project and are working on fixing it. Unfortunately, I do not have any more information. |
Thank you!! |
The new Xcode 10 build system does not play well with CocoaPods, resulting in iterative builds not picking up changes in source files. This results in a remarkably frustrating debugging experience because breakpoints will often not be associated with the lines you expect them to be, and functionality that you're testing won't actually be testable until you perform a clean build. See CocoaPods/CocoaPods#8073 for additional details.
FYI: Tested on Xcode 10.1 beta (10O23u) and issue still occurs. |
I think the best thing for us to do is to provide an option not to use input/output paths. This will cause the script phase to run always but at least folks wont have to do clean builds. |
Just click File->Project(WorkingSpack)Settings ->Build system (Legacy Build System) will make the problem ok ! |
How about Beta 4? |
Doesn't work on Xcode 11 Beta 4 either. |
The official workaround is to set a user-defined build setting |
I tested this right now and it works. I only have expletives. |
@maxkattner omg. I wish we would have known this earlier.........................! Was this a response from Apple to your radar? |
One of their developers pointed me to the changelog and then noticed the mistake in its name provided in the document. I just checked and it is still wrongly named in the changelog. |
@maxkattner tried it, it works with normal input/output paths but doesn't work with xcfilelists......... |
Did you already file a radar yourself? If not please do so and give them this additional info there. Thanks! |
I had one filed yes and updated it with that info. I think i might file a new one though as my existing one was marked as a duplicate. |
1.8.0.beta.2 was released that fixes this issue by using |
@dnkoutso Is there a way to disable |
Hey, sorry, I'm late to this discussion,
Adding this to my Podfile:
Or setting my workspace build system to legacy does not allow me to pick up incremental changes in a "development" pod ( Please let me know! Thanks! |
This is going to solve all your issues. 100% confirmed!! https://stackoverflow.com/questions/50552752/how-to-rebuild-development-pod-changes |
@nickgzzjr To fix the issue you can disable pre_install do |installer|
# Workaround for https://github.com/CocoaPods/CocoaPods/issues/8073
# For more context see https://github.com/CocoaPods/CocoaPods/issues/8073#issuecomment-628092129
installer.analysis_result.targets.each do |target|
project_path = target.user_project.path + "project.pbxproj"
text = File.read(project_path)
new_contents = text.gsub(/objectVersion = .*/, "objectVersion = 48;")
File.open(project_path, "w") {|file| file.puts new_contents }
end
end |
Xcode 12 beta 1 claims to be fixing the issue with xcfilelists as well:
Release notes https://developer.apple.com/documentation/xcode-release-notes/xcode-12-beta-release-notes |
CocoaPods has already been updated to use |
Confirmed Xcode 12 Beta 1 fixes this issue with the project given in comment #8073 (comment) Keeping this closed. |
Haha you're fast 👍 😄 |
Just a heads up non of this was fixed in Xcode 13. Bug still exists. |
Uh oh!
There was an error while loading. Please reload this page.
READ THIS FIRST (08/23/2019 update by @dnkoutso)
UPDATE 06/22/2020
Xcode 12 also claims to fix the issue for xcfilelists! (https://developer.apple.com/documentation/xcode-release-notes/xcode-12-beta-release-notes)
For CocoaPods > 1.8.0.beta.1 a fix was merged in #9125 by using
USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES
instead ofALLOW_RECURSIVE_SCRIPT_INPUTS
that Xcode 11 Beta notes have mistakenly said.However, #9125 still does NOT work if your project uses xcfilelists which CocoaPods utilizes automatically and as long as your project is Xcode 9.3 compatible.
An additional radar has been filed to Apple for xcfilelist to work with
USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES
.Report
What did you do?
ℹ I made changes in some code files in local development pod
What did you expect to happen?
ℹ After build and run in xCode, the changes are incorporated into the resulting package.
What happened instead?
ℹ The old binary is in package. The
[CP] Embed Pods Frameworks
script doesnt run. Its because of build optimalisation in new xCode - when it detects no change in input or output files specified for script, the script is not started.When we did enter the binary file from the content of the
.framework
folder into the input files list, everything is OK. Clean build is also OK.So the solution would be to have no input and out files at all, or during
pod install
add also content files of frameworks into the input files list.Strange thing - in the build log in Report navigator, the output of the
[CP] Embed Pods Frameworks
appeared even when it didn't actually run (I modified the script to echo current time, so I can see the same time stamps)CocoaPods Environment
ℹ
Project that demonstrates the issue
ℹ Unfortunately, project cannot be shown in public.
The text was updated successfully, but these errors were encountered: