Return-Path: X-Original-To: apmail-cordova-dev-archive@www.apache.org Delivered-To: apmail-cordova-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EC15CEA71 for ; Mon, 21 Jan 2013 17:03:27 +0000 (UTC) Received: (qmail 57597 invoked by uid 500); 21 Jan 2013 17:03:27 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 57573 invoked by uid 500); 21 Jan 2013 17:03:27 -0000 Mailing-List: contact dev-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list dev@cordova.apache.org Received: (qmail 57565 invoked by uid 99); 21 Jan 2013 17:03:27 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Jan 2013 17:03:27 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of brian.leroux@gmail.com designates 209.85.212.51 as permitted sender) Received: from [209.85.212.51] (HELO mail-vb0-f51.google.com) (209.85.212.51) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Jan 2013 17:03:21 +0000 Received: by mail-vb0-f51.google.com with SMTP id fq11so4651618vbb.38 for ; Mon, 21 Jan 2013 09:03:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=t5ObbEUMHE55Y6oIkcUyXHrjnlS/RYLthRvbCArAkFI=; b=GI9LN0X4mnor1OkqVjGpJ2o4JAG0iFrTJ/x3SwNrF/f0zJqWZhPSo/MNve1SD1xFzb ws38y6flLgOun5vpwlWrmtoCIV7Gcmc/nQ/K4C9TEupZRG2eXDCde26I21nyv2xJh9A0 ifOo4c+4+NPpfbGZDP9OBNy1Z2rm7XkfdhKMHsuezlgZEqN7BL7ixjMX7FPuU15akxhg XUHvAFbY9CEYIfrKP31UdH0dvpSXoCTwtMw1WcJ7Bg4lJGR/SYfm8jbT1symRFakYG5v kRm4dXiO10jWzbUjSfHWqW6RFeo5b8zGiasn+FkyPJ1kJeORYc9Q0kkBv1Ge19hj6EP2 EfMA== MIME-Version: 1.0 X-Received: by 10.52.93.77 with SMTP id cs13mr18156368vdb.118.1358787780427; Mon, 21 Jan 2013 09:03:00 -0800 (PST) Sender: brian.leroux@gmail.com Received: by 10.58.38.230 with HTTP; Mon, 21 Jan 2013 09:03:00 -0800 (PST) In-Reply-To: References: <15115FEB-FF42-4D28-9AB2-69ECC5DE2264@gmail.com> Date: Mon, 21 Jan 2013 11:03:00 -0600 X-Google-Sender-Auth: O_o3mmlepGmXOEV7TMUpVQ1jy7k Message-ID: Subject: Re: Should Automatic Reference Counting be on? From: Brian LeRoux To: dev@cordova.apache.org Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org I say we roll w/ the assumption of #3 (but share your pragmatism that #2 will likely result). On Mon, Jan 21, 2013 at 10:27 AM, Andrew Grieve wrot= e: > Not sure how to move forward with this. I don't think that asking plugin > devs to use macros to make their code work in both environments is > reasonable. We don't do that in any of our core plugins. > > I don't think plugin devs will be motivated to update their plugins to us= e > ARC until we change the default template to use ARC, and they get users > complaining. > If not using two libraries, then setting -fno-objc-arc on each file *will= * > fix things, but it's not very obvious how to do that. > > Proposal #1: > -We add a plugin-wide setting to plugin.xml that says whether the plugin > uses ARC. We teach plugman to set the -fno-objc-arc flag for these. If th= e > plugin.xml ever changes this setting, then we need to edit the project fi= le > and remove the flag. > -We don't change our default project template until CLI is our documented > way of creating projects. > > Proposal #2: > -We add a per-file setting to plugin.xml that says which files use ARC. W= e > teach plugman to set the -fno-objc-arc flag for these. If the plugin.xml > ever changes this setting, then we need to edit the project file and remo= ve > the flag. > -We don't change our default project template until CLI is our documented > way of creating projects. > > Proposal #3: > -We assume plugman-installable plugins use ARC > -We don't change our default project template until CLI is our documented > way of creating projects. > > I like #3 since it's simpler, but I'm afraid we'll have to support #2 in > the end due to plugins that depend on third-party code. > > > On Fri, Jan 11, 2013 at 1:34 PM, Shazron wrote: > >> Actually Cordova core has been ARC for a couple of releases now. Good id= ea >> for the plugin tool default to non-ARC, this should be covered in the >> spec... >> >> On Friday, January 11, 2013, Kerri Shotts wrote: >> >> > My two cents: >> > >> > If it's feasible to support ARC, I'd go for it. Having worked with ARC >> and >> > non-ARC code, ARC is definitely easier on my brain cells -- I'm far to= o >> > likely to leak memory like a sieve with manual memory management=85 >> > >> > That said, converting Cordova's base code from non-ARC to ARC may not = be >> > trivial. In theory, you can just get rid of autoreleases, retains, >> > deallocs, and handle properties (assign/retain/copy --> weak,strong), = but >> > sometimes you end up getting into toll-free bridging between Cocoa and >> Core >> > Foundation, and occasionally you run into more obscure problems (such = as >> > ARC releasing the object before the code expected it. Easy to fix, but >> not >> > always /obvious/ prior to experiencing the issue.) >> > >> > Once we have ARC support, though, the -fno-objc-arc compiler flag is = a >> > per-file setting, so I would think that the plugin tools could set tha= t >> > flag based on whether or not the plugin supported ARC or not. (I would >> > think this should be determined in the metadata somewhere? Perhaps >> > defaulting to no-ARC if there's no metadata saying one way or the othe= r?) >> > >> > >> > On Jan 11, 2013, at 9:14 AM, Andrew Grieve > > >> > wrote: >> > >> > > This caught me off-guard as well, and I filed an issue to fix it up: >> > > https://issues.apache.org/jira/browse/CB-2180 >> > > >> > > I don't think it'll be entirely straight-forward though, because som= e >> > > plugins still do not support ARC. >> > > >> > > What are everyone's thoughts on how to address this? One option is t= o >> > have >> > > the default project template already set-up with two lib targets. On= e >> for >> > > ARC and one without ARC. Another option is to instruct users how to = set >> > the >> > > compile flag to disable arc on a per-file basis. >> > > >> > > Do we want to support ARC and non-ARC plugins in plugman? >> > > >> > > >> > > On Thu, Jan 10, 2013 at 6:52 PM, Jacob Weber > > >> > wrote: >> > > >> > >> When I create a new iOS project with Cordova 2.3, Automatic Referen= ce >> > >> Counting (CLANG_ENABLE_OBJC_ARC) is turned off. And the code (e.g. >> > >> AppDelegate.m) uses autorelease, which I'm pretty sure is incompati= ble >> > with >> > >> ARC. >> > >> >> > >> Is this correct? Based on this blog post, I thought it should be on= : >> > >> >> > >> >> > >> http://shazronatadobe.wordpress.com/2012/09/05/automatic-reference-count= ing-arc-and-cordova-plugins/ >> > >> >> > >> Jacob >> > >> > >>