Skip to content
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

Fix incremental installation when dependent pod resources change #11568

Merged

Conversation

jszumski
Copy link
Contributor

@jszumski jszumski commented Sep 29, 2022

Fixes #11567: for projects using incremental_installation: true, consuming pods were not updated when their dependencies add/rename/remove resource_bundles. When SomePodWithResources updates a resource bundle in its podspec, there should be a corresponding update to ConsumingPod in the ConsumingPod-resources.sh build script:

if [[ "$CONFIGURATION" == "Debug" ]]; then
  install_resource "${PODS_CONFIGURATION_BUILD_DIR}/SamplePodWithResources/SomeBundleName.bundle"
fi
if [[ "$CONFIGURATION" == "Release" ]]; then
  install_resource "${PODS_CONFIGURATION_BUILD_DIR}/SamplePodWithResources/SomeBundleName.bundle"
fi

Notable changes:

  • The cache calculation now receives a copy of the pod list so it can examine dependent pod attributes. This caused a lot of diff noise because each call site changed.
  • The cache key dictionary now lists RESOURCES for dependencies (if applicable). This ensures the {name}-resource.sh script is regenerated when dependencies change bundled resources.

@@ -167,6 +204,7 @@ def self.from_aggregate_target(sandbox, aggregate_target)
res.relative_path_from(sandbox.project_path.dirname).to_s
end
contents['FILES'] = (relative_resource_file_paths + relative_on_demand_resource_file_paths).sort_by(&:downcase)
contents['RESOURCES'] = resource_dependencies.flatten.uniq.sort_by(&:downcase) if resource_dependencies.any?
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm open to changing this key since its not immediately obvious how FILES and RESOURCES are different.

@dnkoutso dnkoutso added this to the 1.12.0 milestone Sep 29, 2022
@jszumski jszumski force-pushed the fix-incremental-installation-resources branch from 06d2dc9 to d47bdde Compare September 30, 2022 14:21
@dnkoutso dnkoutso modified the milestones: 1.12.0, 1.12.1 Feb 27, 2023
@dnkoutso dnkoutso modified the milestones: 1.12.1, 1.13.0 Apr 18, 2023
@jszumski jszumski force-pushed the fix-incremental-installation-resources branch from d47bdde to 4d260ce Compare September 22, 2023 19:23
@CocoaPodsBarista
Copy link

1 Warning
⚠️ Please include a CHANGELOG entry to credit yourself!
You can find it at CHANGELOG.md.

Here's an example of your CHANGELOG entry:

* Fix incremental installation when dependent pod resources change  
  [jszumski](https://github.com/jszumski)
  [#issue_number](https://github.com/CocoaPods/CocoaPods/issues/issue_number)

note: There are two invisible spaces after the entry's text.

Generated by 🚫 Danger

@dnkoutso dnkoutso merged commit 88a9db6 into CocoaPods:master Sep 22, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incremental installation only partially updates when dependencies update resource bundles
3 participants