holochain / lair

secret lair private keystore
Apache License 2.0
42 stars 11 forks source link

Socket path too big in iOS #118

Open guillemcordoba opened 11 months ago

guillemcordoba commented 11 months ago

iOS gives each app a specific storage location, with a very long path from the root, more than 100 characters long when taking all the folder into account. This causes a socket path too long error when the lair keystore server is run.

I've been able to work around this issue by changing where the socket file gets created so that it lives on a temporary directory:

Instead of this line:

                let mut con_path = if cfg!(target_os="ios") { // Work around the "socked path is too long" limit
                    std::env::temp_dir()
                } else {
                    dunce::canonicalize(root_path)?
                };
                con_path.push("socket");

Not sure this should be the way to do things (I could open a PR for this).

matthme commented 11 months ago

FYI in launcher and kangaroo this is "fixed" downstream by creating a symlink in the temp directory that points to the actual path: https://github.com/holochain-apps/holochain-kangaroo/commit/0505e9c5a2cf57148dc74bd2038c87a47420f698