Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av

Doh004 posted:

I love the Facebook vs Apple fights ITT.

Nobody wins

Adbot
ADBOT LOVES YOU

LP0 ON FIRE
Jan 25, 2006

beep boop
Is Swift considered well adopted at this point? I've had nothing but trouble with mostly nonsensical, unexplainable errors in my console. Most references online and questions on Stack Overflow seem to Objective-C, some Swift 2 and 3 and almost no Swift 4. Thinking of going back. I was more productive keeping track of references in Obj-C, and Swift seems like a good idea on paper, yet my production has been slowed to a trickle in comparison.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
New projects seem to be almost universally done in swift, but plenty of people have not migrated and likely never will.

TheReverend
Jun 21, 2005

If I were starting a new project I would do it in Swift.

If I had existing objective-c project I would keep it that way.

Getting the two to play nicely is a source of much of my problems

Doctor w-rw-rw-
Jun 24, 2008
It's still got a long way to mature, and compilation can still be megaslow. It'll probably never have decent interop with C++, which is hard to fault it for. Tooling isn't as rock solid as it is for {Obj,}C{,++}, but I think there are a lot of things going for Swift that'll get better.

It's pretty well adopted; I would say that a rather significant chunk of iOS developers nowadays have no clue what MRR even is, or have even done any appreciable amount of work in Objective-C.

Doh004
Apr 22, 2007

Mmmmm Donuts...

LP0 ON FIRE posted:

Is Swift considered well adopted at this point? I've had nothing but trouble with mostly nonsensical, unexplainable errors in my console. Most references online and questions on Stack Overflow seem to Objective-C, some Swift 2 and 3 and almost no Swift 4. Thinking of going back. I was more productive keeping track of references in Obj-C, and Swift seems like a good idea on paper, yet my production has been slowed to a trickle in comparison.

Do not go back. Please use Swift. It is good and only getting better.

LP0 ON FIRE
Jan 25, 2006

beep boop
Now that I've let some time go by I feel that a good chunk of it is my own incompetence than the language. I need to take some time to reread the guides.

That said, anyone know why I'm getting this error in the console when attempting to translate a CIImage combined with this filter? The result is a gray screen where the image should be rendered.

quote:

"Failed to render 921600 pixels because a CIKernel's ROI function did not allow tiling."

code:
var flippedGradient = gradient.transformed(by:CGAffineTransform(scaleX: -1, y: 1))
flippedGradient = gradient.transformed(by:CGAffineTransform(translationX: flippedGradient.extent.width, y: 0)) // causes error

    // mask hue 2 with gradient with transparent background
let alphaMaskBlend2 = CIFilter(name: "CIBlendWithAlphaMask",
                                   withInputParameters: [kCIInputImageKey: hue2,
                                                         kCIInputBackgroundImageKey: transBGCI,
                                                         kCIInputMaskImageKey:flippedGradient])?.outputImage
I just want to flip the gradient. Kind of silly that the way I'm solving that now is creating a whole new gradient.

Stringent
Dec 22, 2004


image text goes here
I might be an outlier, but I absolutely love Swift. I really hate that it's never going to have a much or any presence outside of programming Apple gadgets.

Doctor w-rw-rw-
Jun 24, 2008

Stringent posted:

I might be an outlier, but I absolutely love Swift. I really hate that it's never going to have a much or any presence outside of programming Apple gadgets.

I’m not so sure about that. I think there’s a decent chance of it growing beyond iOS and macOS, but Rust might be stealing its thunder on Linux and Windows due to it being further along in terms of ABI and package management among other things.

Stringent
Dec 22, 2004


image text goes here
I hope you're right. I'm surprised at the notion that Swift and Rust would be seen as competitors though, I'd considered them as more of a Java/C# vs. C++ pairing.

Doctor w-rw-rw-
Jun 24, 2008

Stringent posted:

I hope you're right. I'm surprised at the notion that Swift and Rust would be seen as competitors though, I'd considered them as more of a Java/C# vs. C++ pairing.

Both are native, have C compatibility, method devirtualization, some notion of interfaces (protocols/traits), and aren't C++ - with all its power and baggage - but are safer than C.

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av
Heads up, there's a problematic OpenType ligature that triggers a heap buffer overrun in CoreText's OpenType layout engine, crashing... well, pretty much any macOS or iOS application that shows text. I found a workaround for macOS but it's a little involved:
  • reboot in recovery mode and open a terminal (Utilities → Terminal)
  • run the following command to disable System Integrity Protection (SIP): csrutil disable
  • reboot again, in normal mode
  • from a terminal, run the following command to uninstall one of the fonts that triggers the crash: sudo mv /System/Library/Fonts/KohinoorTelugu.ttc /System/Library/Fonts/KohinoorTelugu.ttc.bak. You may have to re-enter your password for confirmation. It's a font for the Indian Telugu script so I imagine... almost none of you will be affected
  • reboot in recovery mode again, and open a terminal
  • run the following command to re-enable SIP: csrutil enable
  • reboot in normal mode for the last time
Pass it on

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av
For iPhones, the iOS 11.3 beta reportedly fixes the issue

Dog on Fire
Oct 2, 2004

quote:

Starting April 2018, all new iOS apps submitted to the App Store must be built with the iOS 11 SDK, included in Xcode 9 or later.

What does “new apps” mean in this context, does anyone know? Does it include submitting all updates and everything, or just first submissions of new apps in iTunes Connect?

I mean I’m more than 99% sure I know the answer, but ...

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
Usually wording like that does not include upgrades of existing apps.

Past transitions usually worked the same way, e.g. requiring a 64-bit slice.

Expect the requirement to extend to upgrades before long.

IAmKale
Jun 7, 2007

やらないか

Fun Shoe
Are there any good blogs or sites or whatever for following Swift news, library announcements, stuff like that? Something I can jam into Feedly to see what people have been doing with the language. Or is the ecosystem not as robust as, say, React/Angular/JS in general/etc...?

Stringent
Dec 22, 2004


image text goes here
You checked this out from the OP?

https://www.mikeash.com/pyblog/?tag=fridayqna

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

IAmKale posted:

Are there any good blogs or sites or whatever for following Swift news, library announcements, stuff like that? Something I can jam into Feedly to see what people have been doing with the language. Or is the ecosystem not as robust as, say, React/Angular/JS in general/etc...?

Swift Weekly Brief is the best I've seen for Swift. For new libraries I check GitHub trending this week in Swift and in Objective-C.

(Added to the OP.)

Dog on Fire
Oct 2, 2004

pokeyman posted:

Usually wording like that does not include upgrades of existing apps.

Past transitions usually worked the same way, e.g. requiring a 64-bit slice.

Expect the requirement to extend to upgrades before long.

Alright, thanks.

Yeah, I'm in the mindset that pretty much from April on it's going to be risky business to count on compiling with Xcode 8. I was more just after some opinions on this in case someone asks this same question from me.

Doctor w-rw-rw-
Jun 24, 2008
I'd like some clang advice. Posting here because i know a couple of people who know might track this thread from time to time, but if the C/C++ thread is a better choice, let me know.

#1: I want to write a parser for clang diagnostics, so I'm looking at creating a tablegen emitter that uses llvm/tools/clang/include/clang/Basic/Diagnostic.td as an input, and outputs to YAML (with llvm/Support/YAMLTraits.h), and then writing a program to generate a DFA from that which I can then paste a bunch of logs into and get back all valid error parses.

I'm thinking that from that YAML file I might be able to generate a Java, C/C++, or Rust (?) library to take arbitrary text and emit structs (or JSON or protobufs or whatever''s easy) when a diagnostic is successfully parsed. However, I don't currently understand the template (%select, %diff, etc), so I don't currently know how to create a DFA (or if this is the right approach). Any tips?

#2: I want to write a parser for clang stack traces (including Objective-C/C++ method parsing but I'm doing #1 first. I haven't looked into this as much, but hope it's not too hard, but any pointers before the fact might help.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
Instead of messing around with tblgen, I would suggest just building clang and then using the Diagnostic*Kinds.inc files that are generated as part of the build; the pattern for this would be the definition of StaticDiagInfo in DiagnosticIDs.cpp. The language for diagnostic strings is a custom thing documented here and implemented in Diagnostic.cpp; probably the easiest approach is to translate the string into a regexp, for which the laziest solution would involve turning all the %-expansions into .* patterns.

Stack trace formatting is system-specific, I think; it's hard to make a specific suggestion without knowing what you're trying to do.

Doctor w-rw-rw-
Jun 24, 2008

rjmccall posted:

Instead of messing around with tblgen, I would suggest just building clang and then using the Diagnostic*Kinds.inc files that are generated as part of the build; the pattern for this would be the definition of StaticDiagInfo in DiagnosticIDs.cpp. The language for diagnostic strings is a custom thing documented here and implemented in Diagnostic.cpp; probably the easiest approach is to translate the string into a regexp, for which the laziest solution would involve turning all the %-expansions into .* patterns.

Stack trace formatting is system-specific, I think; it's hard to make a specific suggestion without knowing what you're trying to do.

Ah, thanks for the suggestion. I figured that regexes might be easier, but I'd stubbornly tried to find a non-regex solution.

I'm curious how stack traces differ between systems. How do they usually differ and why? Intel/ARM - 32/64 - Itanium / Microsoft ABI? I was thinking of taking crash dumps or dtraces and digesting them into something queriable, for example pivoting on a particular method call, figuring out nonsense traces automatically, or aggregating crashes into a problematic code paths report. clang+lldb can be generally assumed; dtrace isn't as important (and I don't know what it's actually calling under the covers)

Seems like a fun and useful project of reasonable scope, and I've been meaning to get better acquainted with clang recently.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
The process of actually capturing a stack trace, demangling symbols, etc. is all specific to the OS that the compiler is running on, and both the information we gather and how we print it is in code that has to be ported to new host OSes. I don't think there's been any effort to get that code to use a common format.

Doctor w-rw-rw-
Jun 24, 2008
Sounds like I'll just have to parse it out as needs dictate, then. Thanks for your help!

IAmKale
Jun 7, 2007

やらないか

Fun Shoe
How can I get more insight into the decisions that went into Swift? Is there a PEP equivalent (Python's well-defined justification for various features) for the language?

At this moment in time, I'm most curious about trailing closures:



I see things like this and I'm left scratching my head because the inline closure format, where you assign the closure within the method call, seems most readable. A trailing closure, meanwhile, seems like something someone unfamiliar with the language would be unable to comprehend without diving into the language. Surely there's some justification somewhere for why both forms were included?

ManicJason
Oct 27, 2003

He doesn't really stop the puck, but he scares the hell out of the other team.
That sort of thing was my biggest barrier in learning Swift. I'd read/watch all of the latest info on Swift but then still find myself unable to comprehend some simple examples on a first and second read.

I ended up inheriting a bunch of Swift code at a new job and was forced to power through and learn it. Now I spend my time evenly split between Swift and Objective-C, and I much, much prefer Swift.


Changes to Swift are discussed in detail over at the Swift Evolution Github page. The Commonly Rejected Changes page is especially interesting.

jawbroken
Aug 13, 2007

messmate king
Trailing closures weren't invented by Swift. They are relatively common in recent languages as they allow higher-order functions to look as neat as native constructs. If you have a style that makes heavy use of such functions then removing all the double bracketing helps a lot. From another perspective, aside from a few special features (like break and continue), all the conditional and loop constructs in the language could just be higher order functions, but you probably wouldn't want to wrap all of that code in both parentheses and curly brackets.

As for history, they were present from the first beta I believe, so you're not going to find information about it in the Swift Evolution proposals.

lord funk
Feb 16, 2004

I both enjoy and hate some of the flexibility of syntax in Swift. Recently I've been struggling with coming up with a consistent style for things like computed property getters. Do I use 'get { }' or just return something? Without using 'get' it looks really similar to a function, but it's a bit cleaner... except when there are multiple lines of code ahhhhhhh I don't know I'll just 50/50 it and nothing will look right :/

IAmKale
Jun 7, 2007

やらないか

Fun Shoe

jawbroken posted:

Trailing closures weren't invented by Swift. They are relatively common in recent languages as they allow higher-order functions to look as neat as native constructs. If you have a style that makes heavy use of such functions then removing all the double bracketing helps a lot. From another perspective, aside from a few special features (like break and continue), all the conditional and loop constructs in the language could just be higher order functions, but you probably wouldn't want to wrap all of that code in both parentheses and curly brackets.

As for history, they were present from the first beta I believe, so you're not going to find information about it in the Swift Evolution proposals.
Hmm, when you mentioned "high-order functions" I started to suspect that means these are concepts incorporated from popular functional programming languages? I only have a passing knowledge of FP in general, not enough to pick up right away that things like this might come from different programming paradigms. I have a very practical background in Python and JavaScript so I'm just not familiar with some of this "new" syntax.

LP0 ON FIRE
Jan 25, 2006

beep boop
I'm attempting to migrate an Xcode project to another computer. It gives me the warning "Warning: unable to build chain to self-signed root for signer" and when it runs it crashes immediately similarly to what is shown in this Stack Overflow:

App working on simulator but not on iPhone( dyld`__abort_with_payload dyld`_dyld_start)

My issue seems similar to what is described on the Apple Developer Forums here: https://forums.developer.apple.com/thread/86161

and similar to what is described on this Stack Overflow: Xcode ios app development code signing

except the suggestions of deleting certificates and re-adding them, re-adding my account and restarting didn't seem to help. I have removed my developer cert for the second time and now I don't see it coming back, and I'm at a loss of knowing how to get it back since my dev portal doesn't appear to have a place to download it like it used to.

e: I've determined ANY project on this computer results in the same crash and warning.

LP0 ON FIRE fucked around with this message at 18:31 on Feb 21, 2018

Dog on Fire
Oct 2, 2004

LP0 ON FIRE posted:

I'm attempting to migrate an Xcode project to another computer. It gives me the warning "Warning: unable to build chain to self-signed root for signer" and when it runs it crashes immediately similarly to what is shown in this Stack Overflow:

App working on simulator but not on iPhone( dyld`__abort_with_payload dyld`_dyld_start)

My issue seems similar to what is described on the Apple Developer Forums here: https://forums.developer.apple.com/thread/86161

and similar to what is described on this Stack Overflow: Xcode ios app development code signing

except the suggestions of deleting certificates and re-adding them, re-adding my account and restarting didn't seem to help. I have removed my developer cert for the second time and now I don't see it coming back, and I'm at a loss of knowing how to get it back since my dev portal doesn't appear to have a place to download it like it used to.

e: I've determined ANY project on this computer results in the same crash and warning.

Could it be that on the new computer you're missing this Apple's intermediate certificate: https://developer.apple.com/support/certificates/expiration/?

Kind of a long shot because it's kind of an old issue, so I'd imagine the new cert has been installed by some software update at some point already, but ...

Edit: Also you can export your old developer certificate from your old computer's Keychain Access. It exports to a .p12 file and that way you also get the cert's private key along with the cert itself. I don't think you have much use of your developer certificate without the private key.

Dog on Fire fucked around with this message at 18:54 on Feb 21, 2018

LP0 ON FIRE
Jan 25, 2006

beep boop

Dog on Fire posted:

Could it be that on the new computer you're missing this Apple's intermediate certificate: https://developer.apple.com/support/certificates/expiration/?

Kind of a long shot because it's kind of an old issue, so I'd imagine the new cert has been installed by some software update at some point already, but ...

Edit: Also you can export your old developer certificate from your old computer's Keychain Access. It exports to a .p12 file and that way you also get the cert's private key along with the cert itself. I don't think you have much use of your developer certificate without the private key.

Unfortunately that new cert didn’t work. Thanks for the suggestions. Looks like I might have to either get my cert and key like you suggest from my work’s computer or maybe I could use a different account? This whole thing is pretty ridiculous. Isn’t there some way I can get a new iPhone Developer cert from the Apple Dev website anymore like I used to?

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

LP0 ON FIRE posted:

Unfortunately that new cert didn’t work. Thanks for the suggestions. Looks like I might have to either get my cert and key like you suggest from my work’s computer or maybe I could use a different account? This whole thing is pretty ridiculous. Isn’t there some way I can get a new iPhone Developer cert from the Apple Dev website anymore like I used to?

You can make a dev cert on the dev portal yep. developer.apple.com go to Account then Certificates, Something, Profiles. For distribution certs you’re limited to I think two per dev team so you might have to revoke an old one to make a new one.

Comedy option is to delete everything in the dev portal then let Xcode automatically set everything up.

LP0 ON FIRE
Jan 25, 2006

beep boop

pokeyman posted:

You can make a dev cert on the dev portal yep. developer.apple.com go to Account then Certificates, Something, Profiles. For distribution certs you’re limited to I think two per dev team so you might have to revoke an old one to make a new one.

Comedy option is to delete everything in the dev portal then let Xcode automatically set everything up.

E: Hold on I’m an idiot I’m no longer Enrolled!

I can’t believe I’m asking this here because I sound mind numbingly clueless, but I see nothing in Account that says Certificates. I see Documentation, Downloads, Forums, Download Tools, etc. I was looking for this before and it made me think that Apple completely stripped this off their site and relied it being solely managed through Xcode. I looked in Downloads and Download Tools, the account dropdown menu. Nothing or I might be blind.

LP0 ON FIRE fucked around with this message at 19:23 on Feb 21, 2018

Froist
Jun 6, 2004

LP0 ON FIRE posted:

I can’t believe I’m asking this here because I sound mind numbingly clueless, but I see nothing in Account that says Certificates. I see Documentation, Downloads, Forums, Download Tools, etc. I was looking for this before and it made me think that Apple completely stripped this off their site and relied it being solely managed through Xcode. I looked in Downloads and Download Tools, the account dropdown menu. Nothing or I might be blind.

Silly question: Do you have a paid developer account? They've stripped all the provisioning management features from the portal if you're using the automatic Xcode signing for personal devices.

pokeyman posted:

Comedy option is to delete everything in the dev portal then let Xcode automatically set everything up.

"Comedy" becomes "most likely to work" unless you're part of a team.

LP0 ON FIRE
Jan 25, 2006

beep boop

Froist posted:

Silly question: Do you have a paid developer account? They've stripped all the provisioning management features from the portal if you're using the automatic Xcode signing for personal devices.


"Comedy" becomes "most likely to work" unless you're part of a team.

Okay yes now we’re getting somewhere :downs:

It looks like I can’t do the comedy option unless I’m enrolled though.

LP0 ON FIRE
Jan 25, 2006

beep boop
E: This looks like a problem: In Xcode’s account preferences the “Role” column says “User”. From other explanations of how to test on a device without being enrolled, that should say “Free”, but I don’t know any way of changing that and I’ve tried readding my account there several times.

I don’t think I’ve ever been in the situation of testing an app on device without a dev account or profile and I don’t even know which combination is possible so I’ll have to read up on this.

LP0 ON FIRE fucked around with this message at 19:33 on Feb 21, 2018

LP0 ON FIRE
Jan 25, 2006

beep boop
I made an entirely new Apple dev account, selected that one for the team, I see the new signing certificate and I get the same exact problems - crash and “unable to build chain to self signed root for signer” warning! Arghh this computer is corrupt.

If there's any hope left, here is the entire warning:

quote:

CodeSign /Users/myName/Library/Developer/Xcode/DerivedData/my_App_Name-eemyxqpas***********/Build/Products/Debug-iphoneos/My\ App.app
cd "/Users/myName/Documents/XcodeProjects/My App/My-App v2"
export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"

Signing Identity: "iPhone Developer: myEmail@gmail.com (Q*********)"
Provisioning Profile: "iOS Team Provisioning Profile: us.siteName.myAppName-C"
(3*******-****-****-****-************)

/usr/bin/codesign --force --sign 6*************************************** --entitlements /Users/myName/Library/Developer/Xcode/DerivedData/my_App_Name- eemyxqpas***********/Build/Intermediates.noindex/My\ App.build/Debug-iphoneos/My\ App.build/My\ App.app.xcent --timestamp=none /Users/myName/Library/Developer/Xcode/DerivedData/my_App_Name-eemyxqpas***********/Build/Products/Debug-iphoneos/My\ App.app

/Users/myName/Library/Developer/Xcode/DerivedData/my_App_Name-eemyxqpas***********/Build/Products/Debug-iphoneos/My App.app: replacing existing signature
Warning: unable to build chain to self-signed root for signer "iPhone Developer: myEmail@gmail.com (Q*********)"

LP0 ON FIRE fucked around with this message at 20:15 on Feb 21, 2018

Dog on Fire
Oct 2, 2004

Have you checked your "iPhone Developer: ..." certificate in Keychain Access? If you haven't then maybe there's some useful information there? For example if the certificate is valid or if it isn't valid then why.

"Checked" as in right-click on the certificate -> "Get Info" or "Evaluate ..."

Adbot
ADBOT LOVES YOU

LP0 ON FIRE
Jan 25, 2006

beep boop

Dog on Fire posted:

Have you checked your "iPhone Developer: ..." certificate in Keychain Access? If you haven't then maybe there's some useful information there? For example if the certificate is valid or if it isn't valid then why.

"Checked" as in right-click on the certificate -> "Get Info" or "Evaluate ..."

“Certificate status: Good” for both Apple IDs

But!! “No root certificate found”

Edit: I just checked them again and instead it says “success” instead of “No root certificate found”. What??

LP0 ON FIRE fucked around with this message at 20:39 on Feb 21, 2018

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply