Skip to content

crash with xcode writing to Cute's persistence directory #1

@xinsight

Description

@xinsight

Hi Ryan,

I ran into an interesting problem with Cute. Xcode/lldb would save code coverage info (default.profraw) to Cute's working directory, which would then cause Cute to barf when it found a file that was not the json it expected.

Why does lldb save to Cute's working directory? Well, the problem seems to be with the use of FileManger and changing the current working directory. Have a look at Apple's hilarious comments in the header:

/* Process working directory management. Despite the fact that these are instance methods on
NSFileManager, these methods report and change (respectively) the working directory for the
entire process. Developers are cautioned that doing so is fraught with peril.
     */
    open var currentDirectoryPath: String { get }

    open func changeCurrentDirectoryPath(_ path: String) -> Bool

Thanks Apple! So basically, we need to use absolute paths. I'm going to add this - but just thought i'd leave a note here in case anyone else runs into this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions