[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
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

Make ARC default to true #267

Closed
mk opened this issue May 23, 2012 · 33 comments
Closed

Make ARC default to true #267

mk opened this issue May 23, 2012 · 33 comments
Labels
d1:easy An easy ticket that is a good start for first-time contributors s5:blocked t1:enhancement Enhancements that have not been picked up yet. Please comment if you plan to work on it

Comments

@mk
Copy link
Member
mk commented May 23, 2012

I was wondering if we should make the requires_arc flag default to true. I know it would break backwards compatibility but looking ahead I think it could make sense because:

  • when it defaults to false and a library uses arc, you get leaks which I consider to be worse than the other way around: when it defaults to true and a library does not use it, you get build errors
  • more and more libraries are adopting it
  • apple default to it as well
  • we could change all the specs and flip the flag

What do you think?

@alloy
Copy link
Member
alloy commented May 23, 2012

It makes a lot of sense, but I need to mull it over a bit. Let’s schedule this for after the 0.6.0 release.

@mk
Copy link
Member Author
mk commented May 23, 2012

Not sure if this is implemented already: if we make this change (or another breaking change to the Specs format) at a later time, can we use the min version from https://github.com/CocoaPods/Specs/blob/master/CocoaPods-version.yml to prompt the user to update his CocoaPods gem in case the Specs repo requires a more recent version than the one installed?

@alloy
Copy link
Member
alloy commented May 23, 2012

Afaik @irrationalfab implemented all of that feature, so yeah :)

@fabiopelosin
Copy link
Member

Yes the feature is implemented as described.

Regarding the issue I agree with the proposal, just my two cents.

@alloy
Copy link
Member
alloy commented May 23, 2012

Ok, then let’s do it.

@mk Will you work on that? And if so, do you think you can do it before the 1st of June (target RC1 release date), or should we schedule it for 0.6.1?

@mk
Copy link
Member Author
mk commented May 30, 2012

sorry guys, I missed the follow-ups.

@irrationalfab awesome!
@alloy I'll try to look at it tomorrow. Have fun at euruko and good luck with your talk! I won't be able to make it, but @kommen and I will promote CocoaPods at WWDC instead.

@fabiopelosin
Copy link
Member

Another reason for defaulting ARC to true is that xcodebuild fails (and hence pod spec lint) if it encounters memory management methods while compiling with ARC. With the current behavior instead if you forget to add the flag you end up creating a very leaky pod.

@alloy
Copy link
Member
alloy commented Sep 6, 2012

Planned for after 0.14.0. This will also require an update of basically all specs.

@fabiopelosin
Copy link
Member

Currently (0.17) ARC is required and when all the specs of the master repo have a value, the flag can be changed.

@fabiopelosin
Copy link
Member

This depends on #960 as it would be the only safe way to set the flag to false on the specs which do not declare it.

(My above comment is incorrect and this is not being checked by the linter)

@kylef
Copy link
Contributor
kylef commented Oct 21, 2013

Maybe it would make sense to change this default for yaml specs. That way the existing DSL specs will continue to work. The DSL>yaml migrator should disable ARC if it wasn't explicitly enabled in the DSL.

This should be a solid way to do this without any existing pods breaking.

@fabiopelosin
Copy link
Member

The plan is more or less the same: convert programmatically the whole repo to YAML and then explicitly set the value to no for the specs/subspecs which do not specify a value.

@CocoaPodsBot
Copy link

Issue has been confirmed by @AhmadAlokush

@mk mk assigned CocoaPodsBot and unassigned CocoaPodsBot Mar 29, 2014
@segiddins
Copy link
Member

@Keithbsmiley haven't you done this/made progress on this?

@fabiopelosin
Copy link
Member

@segiddins before doing this trunk needs to be released and the whole repo must be conveyed to JSON. Marking the issue as blocked.

@keith
Copy link
Member
keith commented Apr 16, 2014

The specs are ready for this yes. We can re run my scripts if any new specs have been added that some include this setting

@segiddins
Copy link
Member

@Keithbsmiley / @alloy / @irrationalfab ping?

@orta
Copy link
Member
orta commented Jun 22, 2014

I want this, dev pods defaulting to not-ARC is annoying.

@keith
Copy link
Member
keith commented Jun 22, 2014

Same

@keith
Copy link
Member
keith commented Jun 22, 2014

If anyone wants to do a validate on the specs repo just to make sure nothing snuck in without a definition that might be nice. But last I checked everything was good there.

@segiddins
Copy link
Member

@Keithbsmiley care to share your scripts?

@keith
Copy link
Member
keith commented Jun 22, 2014

@alloy
Copy link
Member
alloy commented Jun 23, 2014

I want this too, please write up a list of transition steps/TODOs once you know the status of the conversion script.

@fabiopelosin
Copy link
Member

Can I have a confirmation that the specs are ready?

@fabiopelosin
Copy link
Member

172 are still missing the setting according to this simple script:

require 'json'
missing_requires_arc_count = 0
specs = Dir.glob('/Users/fabio/.cocoapods/repos/master/**/*.json')
specs.each do |spec|
  json = JSON.parse(File.read(spec))
  if json['requires_arc'].nil?
    version, name = spec.split('/')[-2..-1]
    puts "#{name} (#{version})"
    missing_requires_arc_count += 1
  end
end

puts "\n\nChecked #{specs.count} specs"
puts "#{missing_requires_arc_count} are missing the requires_arc setting"

@fabiopelosin
Copy link
Member

Updated script (thanks @kylef):

require 'json'
missing_requires_arc_count = 0
specs = Dir.glob('/Users/fabio/.cocoapods/repos/master/**/*.json')
specs.each do |spec|
  contents = File.read(spec)
  unless contents.include?('requires_arc')
    version, name = spec.split('/')[-2..-1]
    puts "#{name} (#{version})"
    missing_requires_arc_count += 1
    # p spec
  end
end

puts "\n\nChecked #{specs.count} specs"
puts "#{missing_requires_arc_count} are missing the requires_arc setting"
// ...
Checked 17501 specs
130 are missing the requires_arc setting

@keith
Copy link
Member
keith commented Jul 20, 2014

Yep. My script isn't going to work for this in it's current state since it was for ruby specs.

@keith
Copy link
Member
keith commented Jul 20, 2014

Fixed and pushed CocoaPods/Specs@c50d2b1

@Whirlwind
Copy link
Contributor

How should I convert my private repo ? Is there a script to do it?

@orta
Copy link
Member
orta commented Oct 9, 2014

chances are its quicker to just copy and paste s.requires_arc = true into your existing specs

@Whirlwind
Copy link
Contributor

too many specs in my repo😁

@alloy
Copy link
Member
alloy commented Oct 10, 2014

@Whirlwind See the comments above by @Keithbsmiley and @fabiopelosin.

@Whirlwind
Copy link
Contributor

:( only .json, not .spec

Ashton-W pushed a commit to Ashton-W/Core that referenced this issue Nov 2, 2015
amorde pushed a commit that referenced this issue Oct 27, 2024
Merge `1-9-stable` (1.9.0.beta.3) into `master`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
d1:easy An easy ticket that is a good start for first-time contributors s5:blocked t1:enhancement Enhancements that have not been picked up yet. Please comment if you plan to work on it
Projects
None yet
Development

No branches or pull requests

9 participants