zed icon indicating copy to clipboard operation
zed copied to clipboard

iOS support for iPad

Open jaanli opened this issue 9 months ago • 6 comments

Check for existing issues

  • [X] Completed

Describe the feature

It would be super helpful to have iOS support, as collaborative editing is often made a lot easier with the screen and form factor of the iPad Pro.

Would this be possible? Happy to beta test / contribute if I can.

If applicable, add mockups / screenshots to help present your vision of the feature

Happy to submit a Figma user flow if needed :)

jaanli avatar May 16 '24 03:05 jaanli

Would love to see iOS support be a thing. The low-level graphics stack (Metal etc.) is very similar to macOS, so don't think a port would be that far out of reach[^1] as already mentioned in https://github.com/zed-industries/zed/issues/12039#issuecomment-2119789647.

[^1]: Also more feasible than e.g. Visual Studio Code, which is built on web tech (while the server version runs in Safari, there's no Electron for iOS and native UIs are generally nicer anyway).

fwcd avatar Jul 10 '24 21:07 fwcd

We at @onefact need this as well for our work with doctors.

Is there a WebAssembly port yet? We’d be happy to help contribute this.

jaanli avatar Jul 11 '24 12:07 jaanli

Is there a WebAssembly port yet?

https://github.com/zed-industries/zed/issues/12332#issuecomment-2134638801

fwcd avatar Jul 11 '24 13:07 fwcd

I'm interested in this because I want to use Zed via a remote connection to either my home Mac Studio or a linux cloud workstation - both from an iPad pro, and, even more so, from a Vision Pro, which as I understand it is closer to an iOS device as well.

anEXPer avatar Jul 22 '24 19:07 anEXPer

I'm interested in this because I want to use Zed via a remote connection to either my home Mac Studio or a linux cloud workstation - both from an iPad pro, and, even more so, from a Vision Pro, which as I understand it is closer to an iOS device as well.

#me2

seniorgoogles avatar Aug 14 '24 00:08 seniorgoogles

This would be a super killer feature with remote development and ciao ciao vscode

MastroPino avatar Aug 21 '24 13:08 MastroPino

I had a quick look into this:

  • Added toolchain: rustup target add aarch64-apple-ios
  • Used https://github.com/passepartoutvpn/openssl-apple to build OpenSSL
  • Build: OPENSSL_DIR=/path/to/openssl-apple/bin/iPhoneOS17.5-arm64.sdk cargo build --target=aarch64-apple-ios

This gets fairly far. However, it fails on wasmtime, which does not have support for iOS yet (In general, the inability to JIT code on non-macOS Apple platforms is going to be problematic):

wasmtime build errors
error: unknown directive
  |
note: instantiated into assembly here
 --> <inline asm>:2:1
  |
2 | .hidden wasmtime_fiber_start_21_0_1
  | ^

error: unknown directive
  |
note: instantiated into assembly here
 --> <inline asm>:4:1
  |
4 | .type wasmtime_fiber_start_21_0_1,@function
  | ^

error: unknown directive
   |
note: instantiated into assembly here
  --> <inline asm>:37:5
   |
37 |     .size wasmtime_fiber_start_21_0_1,.-wasmtime_fiber_start_21_0_1
   |     ^

error: unknown directive
   |
note: instantiated into assembly here
  --> <inline asm>:39:1
   |
39 | .hidden wasmtime_fiber_init_21_0_1
   | ^

error: unknown directive
   |
note: instantiated into assembly here
  --> <inline asm>:41:1
   |
41 | .type wasmtime_fiber_init_21_0_1,@function
   | ^

error: unknown directive
   |
note: instantiated into assembly here
  --> <inline asm>:61:9
   |
61 |         .size wasmtime_fiber_init_21_0_1,.-wasmtime_fiber_init_21_0_1
   |         ^

error: unknown directive
   |
note: instantiated into assembly here
  --> <inline asm>:63:1
   |
63 | .hidden wasmtime_fiber_switch_21_0_1
   | ^

error: unknown directive
   |
note: instantiated into assembly here
  --> <inline asm>:65:1
   |
65 | .type wasmtime_fiber_switch_21_0_1,@function
   | ^

error: unknown directive
    |
note: instantiated into assembly here
   --> <inline asm>:110:9
    |
110 |         .size wasmtime_fiber_switch_21_0_1,.-wasmtime_fiber_switch_21_0_1
    |         ^

error: ADR/ADRP relocations must be GOT relative
   |
note: instantiated into assembly here
  --> <inline asm>:47:13
   |
47 |             adrp x17, _wasmtime_fiber_start_21_0_1
   |             ^

error: unknown AArch64 fixup kind!
   |
note: instantiated into assembly here
  --> <inline asm>:47:13
   |
47 |             adrp x17, _wasmtime_fiber_start_21_0_1
   |             ^

error: unknown AArch64 fixup kind!
   |
note: instantiated into assembly here
  --> <inline asm>:48:13
   |
48 |             add x17, x17, :lo12:_wasmtime_fiber_start_21_0_1
   |             ^

error: could not compile `wasmtime-fiber` (lib) due to 12 previous errors

I see at least two options:

  • Keep WebAssembly support in the Zed iOS port. This means probably adopting another (additional) WebAssembly runtime that works on iOS. Maybe just the built-in JavaScriptCore?
  • Remove WebAssembly support. This means gating all WebAssembly-related functionality behind a feature flag.

turbolent avatar Aug 29 '24 16:08 turbolent

Very excited for this!

mikayla-maki avatar Aug 29 '24 17:08 mikayla-maki

To start with, and also make it easier to port Zed to other platforms (e.g. WebAssembly), it might make sense to make it easier to port the "core" of Zed, i.e. putting the WebAssembly-based extension functionality behind a feature flag.

From looking at the commits, it seems like @maxdeviant and @maxbrunsfeld worked a lot on the extensions functionality: What do you think?

I'd be happy to start working on this

turbolent avatar Aug 30 '24 17:08 turbolent

If i may add - even if it is already out of active support - targeting iPad Pro 1. gen and orient on iPad 5th/6th gen as the common baseline might be the lowest as it gets while maintaing upwards compatibility and build a common denominator. Besides that these models are widespread and still in use.

In any case, happy to help testing!

P.s.: if iPhone will be intended to become a target the according models would be iPhone X/XS (for out-of-support iOS like 1. gen iPad) and iPhone XR (for supported iOS - like 6th gen iPad).

paclarap avatar Sep 06 '24 20:09 paclarap

Looks like the issue in wasmtime is bytecodealliance/wasmtime#8735

turbolent avatar Sep 06 '24 22:09 turbolent

Was just looking at this issue and saw the wasmtime issue above was fixed less than an hour ago :)

abuchanan920 avatar Jan 06 '25 17:01 abuchanan920