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 requirements cloning for :testspecs #401

Merged
merged 1 commit into from
Aug 29, 2017

Conversation

justinseanmartin
Copy link

🌈

Found an issue where the requirements weren't being deep copied when using the :testspecs directive in combination with the :configurations directive. It would lead to an error message showing up with:

[!] The subspecs of MyPod are linked to different build configurations for the Pods-MyApp target. CocoaPods does not currently support subspecs across different build configurations.

This addresses the issue by deep copying the requirements Hash contained within the Array instead of just copying the array containing those requirements.

@dnkoutso
Copy link
Contributor

We discovered this locally, verified it works as expected.

@dnkoutso dnkoutso merged commit 29997b3 into CocoaPods:master Aug 29, 2017
@@ -921,7 +921,8 @@ def parse_subspecs(name, requirements)
end if subspecs

test_specs.each do |ss|
store_pod("#{name}/#{ss}", *requirements.dup)
requirements_copy = requirements.map(&:dup)
store_pod("#{name}/#{ss}", *requirements_copy)
Copy link
Contributor

Choose a reason for hiding this comment

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

this was basically returning a shallow clone of the requirements and when using test specs we are actually adding a pod not overriding like it happens for when using :subspecs.

The shallow clone caused the store_pod to remove the configuration when parsing the test spec and then the parent had 0 configuration causing an inconsistency between the parent configurations and the test spec configuration.

@@ -409,6 +409,15 @@ module Pod
@child.all_whitelisted_configurations.sort.should == %w(Debug Release)
end

it 'whitelistes pod configurations with testspecs' do
Copy link
Contributor

Choose a reason for hiding this comment

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

meh: whitelists

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.

3 participants