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
Could not access pods_project on post_install hooks when incremental_installation is enabled #8604
Comments
When the |
That is correct. ^ @sebastianv1 can we still not set the ref or have we not "opened" the project for speed? |
We could just open the container project, but I think that sets a bad precedent since others may have similar complaints about other individual projects being nil which would then require us opening all projects every installation (very inefficient for large projects). Also post install hooks should only need to operate over the changed set of projects or targets to apply whatever changes are needed. The only case where this fails is if someone adds a post install hook to a specific pod that won't be regenerated during the next installation, in which |
I dont think we want to get in that mode to detect the |
I see that we can work with |
Why would you need to work with the installation cache? |
For anyone else who comes across this issue, I was able to work around this in my post_install hook using Ruby's Safe Navigation Operator (
|
In my case, using the Safe Navigation Operator does not work I have this configuration in Podfile: platform :ios, '12.2' And the this code below does not make effect: post_install do |installer| If I remove the first configuration of multiple pod projects and incremental installation, the code above works as expected. |
The simplest solution I can find out is manually enable pre_install do |installer|
# We can gather all hooks into single file/directory and check if it is updated.
installer.clean_install = true
end |
Report
What did you do?
When
incremental_installation
option is enabled,installer#pods_project
returnsnil
inpost_install
hook.Before submitting this PR, (1.7.0beta.2) this
Podfile
raises following errors.What did you expect to happen?
We should access
installer.pods_project
in this situation.What happened instead?
When
incremental_installation
is enabled, CocoaPods doesn't generatePods.xcodeproj
when there are nothing changes between cached project.In this case
PodsProjectGeneratorResult#project
becomenil
.So
installer#pods_project
also becomenil
.CocoaPods Environment
Stack
Installation Source
Plugins
Podfile
Project that demonstrates the issue
none
The text was updated successfully, but these errors were encountered: