Post

Replies

Boosts

Views

Activity

Reply to Swift 5.3 Guided Tour playground will not run "out of the box" on Mac
on Xcode 12 beta 3 this produces output now (where Xcode 12 beta 2 did not) Xcode 12 b2 didn't work Download using macOS Swift Playgrounds app Use iCloud sync to run on iPad Swift Playgrounds Another problem I encountered with Swift 5.3 Guided Tour playground (A Swift Tour — The Swift Programming Language (Swift 5.3) - https://docs.swift.org/swift-book/GuidedTour/GuidedTour.html): Download like would not download directly or load on iPad Pro running iOS 13 Only got it working after downloading on macOS, opening in macOS version of Swift Playgrounds, then using iCloud to sync the playground to iPad. Only then could I open/run the playground on iPad. And it runs much faster on 2015 iPad Pro than on 2015 MacBook Pro in macOS Swift Playgrounds.
Jul ’20
Reply to Error when debugging: Cannot create Swift scratch context
Trying to learn Swift and use debugging. On Xcode Version 12.3 (12C33) any time debugger is entered (on device simulator, or an actual device): Cannot create Swift scratch context (couldn't create a ClangImporter) (lldb)  po symbol in the (lldb) prompt doesn't work. And so no Swift objects or symbols are available; only an Objective C-type view of them. This is very annoying! and makes the debugger and debugging basically worthless in Xcode for Swift. On an M1 Mac mini. I completely uninstalled Xcode and deleted preferences and other developer directories from ~/Library. and re-installed Xcode (from app store). I scoured here and stack overflow for workarounds or diagnoses and nothing has worked. $ system_profiler SPSoftwareDataType Software: 		System Software Overview: 			System Version: macOS 11.1 (20C69) 			Kernel Version: Darwin 20.2.0 			Boot Volume: Macintosh HD 			Boot Mode: Normal 			Computer Name: * 			User Name: * 			Secure Virtual Memory: Enabled 			System Integrity Protection: Enabled 			Time since boot: 1:48 this works (swift from command line to run lldb from within) but I have no idea if it's useful info to help diagnose. ❯ swift Welcome to Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28). Type :help for assistance. 	1> : (lldb) expression -l swift -- import Foundation (lldb)
Jan ’21
Reply to Entering debugger: Cannot create Swift scratch context (couldn't create a ClangImporter)
After hours and days of attempting to narrow down the cause, after I remove all zsh customizations (in dotfiles) on an account, the LLDB Swift debugging finally works again. Swift structure state can be inspected, and po symbol works. (the lldb startup error Cannot create Swift scratch context (couldn't create a ClangImporter) is gone too) I haven't isolated the specific root cause of why this is, but that is the general case.
Jan ’21
Reply to Entering debugger: Cannot create Swift scratch context (couldn't create a ClangImporter)
I isolated it finally to a very very old (mid-1990s) csh-backed shell utility that was being used to add PATH components. I replaced its functionality with ZSH's built-in way to do this, and everything seems to be working as it should be. It's not completely clear what exactly was breaking the LLDB invocation by Xcode, but I am fine with modified way. put at end of path path+=/new/path put at front of path path=(/first/path $path)
Jan ’21