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 errors when using mutually recursive build settings #727

Merged
merged 5 commits into from
Jan 11, 2020

Conversation

revolter
Copy link
Contributor

@revolter revolter commented Nov 7, 2019

No description provided.

@segiddins
Copy link
Member

Looks like that test still fails 😬

@revolter
Copy link
Contributor Author

revolter commented Nov 7, 2019

I know, I'm working on it 😃

@revolter revolter changed the title Enable and fix ignored tests WIP: Enable and fix ignored tests Nov 7, 2019
@revolter revolter changed the title WIP: Enable and fix ignored tests Fix errors when using mutually recursive build settings Nov 7, 2019
@revolter
Copy link
Contributor Author

revolter commented Nov 7, 2019

@segiddins, It's ready for review.

@@ -6,6 +6,8 @@ module Object
# {PBXProject} or a {PBXNativeTarget}.
#
class XCBuildConfiguration < AbstractObject
MUTUAL_RECURSION_SENTINEL = 'xcodeproj.mutual_recursion_sentinel'.freeze
Copy link
Member

Choose a reason for hiding this comment

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

Might actually be more performant to make this = Object.new.freeze. Also, I think it can be a private_constant?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. It doesn't work with Object.new.freeze (actually ::Object.new), because String specific methods are called on it, and so it crashes.
  2. TIL about private_constant.

#
# @return [String] The value of the build setting
#
def resolve_build_setting(key, root_target = nil)
def resolve_build_setting(key, root_target = nil, previous_key = nil)
Copy link
Member

Choose a reason for hiding this comment

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

is it always sufficient to have a single previous key, or do we need a list of all of them?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean for cases like this:

'mutually_recursive' => 'mn: ${mutually_recursive_nested}',
'mutually_recursive_nested' => 'm1: ${mutually_recursive_1} m2: ${mutually_recursive_1}',

?

Case in which both mutually_recursive and mutually_recursive_nested are resolved to nil:

@configuration.resolve_build_setting('mutually_recursive_nested').should.nil?
@configuration.resolve_build_setting('mutually_recursive').should.nil?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Or if you have another specific case in mind, I could make a test for it and see if it works.

@@ -168,9 +181,19 @@ def resolve_variable_substitution(key, value, root_target)
when key
# to prevent infinite recursion
nil
when previous_key
# to prevent infinite recursion; we don't return nil as for the self recursion because it
Copy link
Member

Choose a reason for hiding this comment

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

missing some words at the end?

Copy link
Contributor Author

@revolter revolter Jan 9, 2020

Choose a reason for hiding this comment

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

Dang, and I forgot what exactly I wanted to say. I pushed an update.

@segiddins segiddins merged commit d414815 into CocoaPods:master Jan 11, 2020
@revolter revolter deleted the patch-2 branch January 13, 2020 09:44
@dnkoutso
Copy link
Contributor

dnkoutso commented Feb 4, 2020

This was not rebased and therefore the CHANGELOG entry was in the wrong spot. Will fix for release of 1.15.0

@dnkoutso
Copy link
Contributor

dnkoutso commented Feb 4, 2020

Shipped with 1.15.0!

@revolter
Copy link
Contributor Author

revolter commented Feb 5, 2020

Sorry, and thanks for releasing!

@revolter
Copy link
Contributor Author

revolter commented Feb 5, 2020

@dnkoutso, The release notes incorrectly link to https://github.com/CocoaPods/CocoaPods/issues/706 instead of https://github.com/CocoaPods/Xcodeproj/pull/706.

It was caused by me 🤦🏻‍♂️ I fixed it in #735, but it should be also manually fixed in GitHub's release.

@revolter
Copy link
Contributor Author

revolter commented Feb 6, 2020

Could you edit the GitHub release notes too?

@dnkoutso
Copy link
Contributor

dnkoutso commented Feb 6, 2020

Done.

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