Repository navigation
Replace objc with objc2 in other projects #174
Copy link
Copy link
Open
Labels
A-frameworkAffects the framework crates and the translator for themAffects the framework crates and the translator for themA-objc2Affects the `objc2`, `objc2-exception-helper` and/or `objc2-encode` cratesAffects the `objc2`, `objc2-exception-helper` and/or `objc2-encode` crateshelp wantedExtra attention is neededExtra attention is needed
Description
As part of moving towards a (somewhat stable) version, I'd like to submit PRs to other projects to set an ecosystem-wide precedence for using this crate, and to see which patterns people are actually using that objc2 doesn't (or doesn't easily) help with.
Popular reverse-dependencies of objc on crates.io (as of the issue creation date):
-
cocoa/cocoa-foundation: Replaceobjcwithobjc2servo/core-foundation-rs#628 / Deprecatecocoa,cocoa-foundationandio-surfaceand link toobjc2crates instead servo/core-foundation-rs#731 -
winit: Initial transition toobjc2rust-windowing/winit#2452 -
glutin: Move toobjc2rust-windowing/glutin#1461 -
: Remove dependency oncore-video-sysobjcLuoZijun/rust-core-video-sys#23, but unmaintained -
metal: Useobjc2instead ofobjcgfx-rs/metal-rs#241 / Recommendobjc2-metalinstead ofmetalgfx-rs/metal-rs#339 -
: unmaintainedgfxbackends -
wgpu-hal: [metal] Useobjc2-metalgfx-rs/wgpu#5641 -
: unmaintainedclipboard -
arboard: Useobjc2and its framework crates 1Password/arboard#148 -
copypasta: Useobjc2and its framework crates alacritty/copypasta#74 -
webbrowser: iOS: Useobjc2amodm/webbrowser-rs#87 -
: Uselocale_configobjc2andobjc2-foundationrust-locale/locale_config#11, seems unmaintained. -
rfd: macOS: Useobjc2crates PolyMeilex/rfd#188 -
glfw: Useobjc2PistonDevelopers/glfw-rs#566 -
wry: Proposal: Useobjc2and its framework crates tauri-apps/wry#1239 -
tao: Useobjc2tauri-apps/tao#1049 -
: nowoffscreen_gl_contextsurfman -
trash: macOS: Useobjc2-foundationByron/trash-rs#107 -
skia: Portmetal-windowexample toobjc2. Add iOS support to example. rust-skia/rust-skia#1249 -
native-dialog: macOS: Useobjc2crates native-dialog-rs/native-dialog-rs#58 -
window_clipboard: Useobjc2and its framework crates hecrj/window_clipboard#27 -
vulkano: macOS/iOS: Useraw-window-metalto get aCAMetalLayerfromraw-window-handlevulkano-rs/vulkano#2561 -
: Probably not compatible with their stated goals.miniquad -
surfman: Useobjc2-*family of crates servo/surfman#334 -
: Likely unmaintained.display-link -
: Discontinued.druid-shell -
dark-light: Useobjc2-foundationandobjc2-app-kitrust-dark-light/dark-light#37 -
btleplug: chore(corebluetooth): Useobjc2and its framework crates deviceplug/btleplug#381 -
tts: Useobjc2/objc2-avf-audiondarilek/tts-rs#57 -
raw-window-metal: Useobjc2and its framework crates rust-windowing/raw-window-metal#15 -
: archivedmsgbox
Others:
-
pathfinder -
wr_glyph_rasterizer -
blurmac: Unmaintained -
alacritty: Useobjc2,objc2-foundationandobjc2-app-kitalacritty/alacritty#8312 -
: Only used for Safari extension, and for dubious reasons, I'm not gonna touch it.ruffle -
veloren: Needsnative-dialogandwgputo migrate -
cacao: Replaceobjcwithobjc2? ryanmcgrath/cacao#28 -
: Possibly unmaintained.bluster -
: Seems unmaintained.clipboard-files -
mac-notification-sys: Version 2 h4llow3En/mac-notification-sys#51 / Updating to objc2 and adding async support h4llow3En/mac-notification-sys#56 / Migrate to objc2 h4llow3En/mac-notification-sys#67 -
slint(i-slint-renderer-skia): macOS: Replace use of old apple creates with modern objc2 replacements slint-ui/slint#6940 -
fruitbasket: Possibly unmaintained. -
glazier: Archived -
lapce: No longer (?) usingcocoa/objcdirectly. -
neovide: chore: remove legacy objc and cocoa neovide/neovide#2390 -
enigo: Move objc dependency to icrate enigo-rs/enigo#250 -
nightlight: Possibly unmaintained. -
current_locale: Fix CI issues i509VCB/current_locale#8 -
sys-locale -
zed: Migrate Zed to objc2 zed-industries/zed#22408 -
: Usescreencapturekitobjc2? doom-fish/screencapturekit-rs#128, they aren't going to. -
eframe: eframe: Useobjc2and its framework crates emilk/egui#4395 -
softbuffer: Useobjc2rust-windowing/softbuffer#210 -
gpu-allocator: 🤘 metal: Migrate toobjc2architecture withobjc2-metalbindings Traverse-Research/gpu-allocator#225 -
tray-icon: Rewrite to useobjc2tauri-apps/tray-icon#172 -
muda: Migrate fromobjc/cocoatoobjc2tauri-apps/muda#221 -
window-vibrancy: Migrate fromobjc/cocoatoobjc2tauri-apps/window-vibrancy#150 -
global-hotkey: Migrate fromobjctoobjc2tauri-apps/global-hotkey#99 -
tauri: feat: Migrate toobjc2tauri-apps/tauri#10924 -
ash-window: ash-window: Updateraw-window-metalto v1.0 ash-rs/ash#939 -
blade: metal: Migrate from metal-rs to objc2 kvark/blade#229 -
: Seems unmaintained.rafx -
dioxus: Port dioxus to useobjc2for interacting with macOS/iOS platform apis DioxusLabs/dioxus#5101 -
kanata: Some discussion about it in Collaboration with enigo crate jtroo/kanata#1527 -
rio: Uses a combination ofobjcandobjc2, they're clearly aware ofobjc2 -
crossfont: Useobjc2for determining whether font smoothing is enabled alacritty/crossfont#69 -
candle: [Metal] update to objc2_metal huggingface/candle#3064 -
servo: fonts: Port macOS font code to useobjc2-*crates servo/servo#41711 -
rdev: Update cocoa Narsil/rdev#172 -
: Plans for collaboration withcidreobjc2? yury/cidre#2 -
bluest: feat: refactor to use objc2 and add l2cap support alexmoon/bluest#33
Using CoreFoundation:
-
core-foundation: Future of this project and discussion aboutobjc2servo/core-foundation-rs#729 -
coreaudio-rs: Useobjc2crates RustAudio/coreaudio-rs#128 -
cpal: Updatecoreaudio-rsRustAudio/cpal#943 -
sysinfo: Useobjc2-core-foundationGuillaumeGomez/sysinfo#1461 -
iana-time-zone: Useobjc2-core-foundationstrawlab/iana-time-zone#147 -
font-kit: Useobjc2crates servo/font-kit#273 -
crossfont: Use moreobjc2framework crates alacritty/crossfont#74 -
webbrowser: macos: Migrate toobjc2-core-foundationamodm/webbrowser-rs#96 / Move to objc2 for macos amodm/webbrowser-rs#117 -
accessibility: Migrate to objc2 eiz/accessibility#12, needsCFSTRsupport. - ...
Using SystemConfiguration:
-
system-configuration: Useobjc2-system-configurationinstead ofsystem-configuration-sys? mullvad/system-configuration-rs#69 -
hyper-util -
if-watch -
netdev: Seems to only use it in dead code -
default-net: Renamed tonetdev
Using Security:
-
security-framework: Consider usingobjc2-security? kornelski/rust-security-framework#224 -
rustls-platform-verifier -
rustls-native-certs -
native-tls -
cargo-credential-macos-keychain -
keyring -
apple-codesign -
secure-enclave-rs: Migrate to objc2-security carlvoller/secure-enclave-rs#4
Using IOKit:
-
serialport: Useobjc2-io-kitserialport/serialport-rs#296 -
gilrs: https://gitlab.com/gilrs-project/gilrs/-/merge_requests/163
Using CoreServices:
-
fsevent-sys: Useobjc2-core-foundationandobjc2-core-servicesoctplane/fsevent-rust#48 -
notify: Useobjc2-core-foundationandobjc2-core-servicesnotify-rs/notify#726
Using dispatch:
Reacted by Mary Guillemard, Jinlei Li, Yerkebulan Tulibergenov, Lee C. Baker and s1rius
Reacted by Yerkebulan Tulibergenov, John Nunley, Marijn Suijten and Lee C. Baker
Reacted by Yerkebulan Tulibergenov
Reacted by Yerkebulan Tulibergenov, Arto Bendiken and Takagi Tasuku
Metadata
Metadata
Assignees
Labels
A-frameworkAffects the framework crates and the translator for themAffects the framework crates and the translator for themA-objc2Affects the `objc2`, `objc2-exception-helper` and/or `objc2-encode` cratesAffects the `objc2`, `objc2-exception-helper` and/or `objc2-encode` crateshelp wantedExtra attention is neededExtra attention is needed
Activity
jinleili commentedon Sep 7, 2022
As soon as
metal-rsmerges the PR you replaced with objc2, I'm interested in completing thewgpu-hal parti509VCB commentedon Nov 24, 2022
Mentioning https://github.com/norse-rs/raw-window-metal since ash-window depends on it.
pentamassiv commentedon Nov 20, 2023
I created an issue to replace it in enigo enigo-rs/enigo#249
paulora2405 commentedon Nov 24, 2023
PR with the replacement of
objcwithicratewas merged in enigo-rs/enigo#250.notgull commentedon Nov 24, 2023
rust-windowing/softbuffer#181
osiewicz commentedon Dec 25, 2024
I created an issue to replace our uses of objc with objc2 in Zed: zed-industries/zed#22408
hoodie commentedon Apr 6, 2025
@madsmtm you can check off mac-notification-sys with 0.6.4
arihant2math commentedon Oct 23, 2025
I'm working on porting blurmac from
objctoobjc2in servo's in-tree copy of it. I've run into the problem ofClassDecl::add_methodbeing strict about what is allows as a method.Previously things like
extern "C" fn(&mut Object, Sel) -> *mut Objectworked, but it seems that is no longer the case. What would you suggest doing?(Code in https://github.com/servo/servo/blob/481f147143d155ae9cd5426eed47269e57bd6b47/third_party/blurmac/src/delegate.rs)
madsmtm commentedon Oct 23, 2025
Try casting to
extern "C" fn(_, _) -> _, Rust can be very particular about higher-kinded lifetimes, but doesn't allow properly expressing it in bounds.Also, IIRC I might've removed support for
&mut Object, try&Objectinstead.arihant2math commentedon Oct 23, 2025
Thanks, that fixed it.
nicoburns commentedon Dec 15, 2025
PR for Dioxus DioxusLabs/dioxus#5101