Skip to content

Example for building extensions #815

@djc

Description

@djc

Hey, thanks for all your work on the objc2 crate ecosystem, I've been playing with and it's gotten me pretty excited about being able to build for macOS (and maybe iOS etc) using (hopefully pure) Rust.

As an initial (maybe quite ambitious) project, I've been trying to get an FSKit filesystem going without involving any Swift code (using a lot of assistance from Claude code). I can now see it in Login Items & Extensions / File System Extensions. My next step is to try and mount it, and I have a basic class definition inheriting from FSUnaryFileSystem written up.

However, when I try to mount this thing I get errors like this:

djc-2021 main fs-exp $ mount -F -t FSExp /dev/null ~/tmp/fs-exp
mount: Probing resource: The operation couldn’t be completed. (com.apple.extensionKit.errorDomain error 2.)
mount: Unable to invoke task

A little searching and a bunch of LLM-assisted churn have not led me to a solution so far. Claude seems to have decided that the extension isn't being loaded at all because the right symbols cannot be found in it. I've run experiments with writing a debug log file early in main() and in ctor::ctor() thing (which AIUI should run before main), but these have not resulted in actual debug log files.

I was wondering/hoping if you might have some advice, know of some example code, or a project doing something like this (with an .appex extension).

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-frameworkAffects the framework crates and the translator for themdocumentationImprovements or additions to documentation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions