Archive for July 1, 2016

Friday, July 1, 2016

Xcode Clobbered by socketfilterfw at Launch

Iritscen:

Every time I open Xcode, there is massive hard drive churn. iStat seems to indicate that the culprit is socketfilterfw. The computer is not properly useable again for upwards of 2 minutes since the disk churn slows everything to a crawl.

I’ve been getting this, too, except that (with an SSD) the main symptom is extremely high CPU usage. It takes more like 10 minutes to resolve.

When Xcode launches, the OS X Firewall needs to scan the entire Xcode application bundle for some reason (some kind of checksum validation?). socketfilterfw is the Firewall’s agent for doing this.

It was suggested that we fiddle with the Firewall settings under the Security preference pane to try to fix this, and I’ve found that by removing the listing for Xcode and turning off the setting “Automatically allow signed software to receive incoming connections”, it seems to have stopped socketfilterfw from taking over my computer for a couple minutes at every launch of Xcode. I also tried changing Xcode’s Firewall listing from “allow” to “block”, and this did not make a difference; only removing it from the list did.

Simply removing Xcode from the list fixed the problem for me. I’m not sure what functionality I’m losing by not allowing Xcode to accept connections.

See also: Ask Different.

Spotify Update Rejected From the App Store

Peter Kafka (via Peter Steinberger):

“This latest episode raises serious concerns under both U.S. and EU competition law,” Gutierrez wrote. “It continues a troubling pattern of behavior by Apple to exclude and diminish the competitiveness of Spotify on iOS and as a rival to Apple Music, particularly when seen against the backdrop of Apple’s previous anticompetitive conduct aimed at Spotify … we cannot stand by as Apple uses the App Store approval process as a weapon to harm competitors.”

[…]

Apple doesn’t require subscription services to use its iTunes billing service, but it doesn’t allow them to use an alternate payment system within the app, as Google does. Apple charges a monthly fee of up to 30 percent for those that do use its billing system — and it doesn’t want app makers to use the apps to promote alternate subscription options outside the apps.

[…]

In Spotify’s case, the company has used Apple’s billing system for years, but passed on Apple’s fee to customers by charging $13 a month instead of the $10 a month the service sells for outside Apple’s store.

It sounds like Apple is not singling out Spotify for special scrutiny. Rather, Spotify was trying to get around Apple’s longstanding in-app purchase rules. That said, I believe said rules are anti-competitive and bad for both customers and developers.

See also: Hacker News, John Gruber, Nick Heer, Juli Clover, Andrew Cunningham, and Emily Blake.

Update (2016-07-02): John Paczkowski:

In a letter sent to Spotify general counsel Horacio Gutierrez on Friday, Apple general counsel Bruce Sewell rebutted the streaming music service’s June 26 allegations that Apple is “causing grave harm to Spotify and its customers” by rejecting a recent update to Spotify’s iOS app. “We find it troubling that you are asking for exemptions to the rules we apply to all developers and are publicly resorting to rumors and half-truths about our service,” Sewell wrote in a letter obtained by BuzzFeed News.

Juli Clover:

Sewell’s letter to Spotify ends with some clarification on why Spotify’s app was rejected on May 26. Spotify replaced its in-app subscription purchase options with an account sign-up feature Apple says was "clearly intended to circumvent Apple’s in-app purchase rules."

Why Swift Ditched Tuple-to-Tuple Function Modeling

Jordan Rose (via Jaden Geller):

The real blow, however, came with that very first idea: that we could treat methods with different argument labels as simple overloads in type. This led to poor diagnostics where the compiler couldn’t decide whether to believe the types or the argument labels, and might tell you you have the wrong argument labels rather than a type mismatch. For pretty much every Apple API, this was the wrong decision. On top of all that, it was really hard to refer to a method when you didn’t want to call it. (Most methods with the same base name still have unique labels, so you don’t need the types to disambiguate.)

So we introduced the notion of “full names”, which are the things you see written as move(from:to:) (and which are represented by DeclName in the compiler). Almost immediately diagnostics got better, testing optional protocol requirements got shorter, and a lot of compiler implementation got simpler.

[…]

And then we kind of got stuck here. We have full names used throughout the compiler, but tuple labels still appear in types. They’re still used in mangling.

Objective-C Class Properties

Andrew Madsen:

Xcode 8 ships with a new versions of Clang and LLVM (800.0.2.24.1, and 8.0.0 as of the first beta). The new version of Clang adds support for class properties in Objective-C. The feature is not yet fully documented anywhere that I can find, so I did a little experimenting.

[…]

It is important to note that unlike regular instance properties, Objective-C class properties can not be synthesized using @synthesize, nor are they automatically synthesized by the compiler. You are responsible for implementing accessor methods for them yourself. (You can also use an @dynamic for them to tell the compiler that accessor methods will be provided at runtime.)

Rest in Motion

Nate Soares (via Alexis Gallagher):

This is a failure mode that I used to fall into pretty regularly. I would model my work as a finite stream of tasks that needed doing. I’d think “once I’ve done the laundry and bought new shoes and finished the grocery shopping and fixed the bugs in my code and finished the big refactor, everything will be in order, and I’ll be able to rest.” And in that state of mind, every new email that hit my inbox, every new bug discovered in my code, every tool of mine that wore down and needed repair, would deal me damage.

I was modeling my work as finite, with the rest state being the state where all tasks were completed, and so every new task would push me further from that precious rest state and wear me down.

[…]

Look at all the streams you want to move through, assess how much bandwidth you have available, and then simply move through the streams at the appropriate clip.