diff --git a/common/prefix.h b/common/prefix.h index 7d0265c25..30ee18f63 100644 --- a/common/prefix.h +++ b/common/prefix.h @@ -13,7 +13,11 @@ public: if (prefix.empty()) { prefix = util::random_string(15); } - msgq_path = Path::shm_path() + "/msgq_" + prefix; +#ifdef __APPLE__ + msgq_path = "/tmp/msgq_" + prefix; +#else + msgq_path = "/dev/shm/msgq_" + prefix; +#endif bool ret = util::create_directories(msgq_path, 0777); assert(ret); setenv("OPENPILOT_PREFIX", prefix.c_str(), 1); diff --git a/common/prefix.py b/common/prefix.py index b19ce1472..86f69671d 100644 --- a/common/prefix.py +++ b/common/prefix.py @@ -1,4 +1,5 @@ import os +import platform import shutil import uuid @@ -11,7 +12,8 @@ from openpilot.system.hardware.hw import DEFAULT_DOWNLOAD_CACHE_ROOT class OpenpilotPrefix: def __init__(self, prefix: str = None, create_dirs_on_enter: bool = True, clean_dirs_on_exit: bool = True, shared_download_cache: bool = False): self.prefix = prefix if prefix else str(uuid.uuid4().hex[0:15]) - self.msgq_path = os.path.join(Paths.shm_path(), "msgq_" + self.prefix) + shm_path = "/tmp" if platform.system() == "Darwin" else "/dev/shm" + self.msgq_path = os.path.join(shm_path, "msgq_" + self.prefix) self.create_dirs_on_enter = create_dirs_on_enter self.clean_dirs_on_exit = clean_dirs_on_exit self.shared_download_cache = shared_download_cache diff --git a/msgq_repo b/msgq_repo index f3f440102..349bf449b 160000 --- a/msgq_repo +++ b/msgq_repo @@ -1 +1 @@ -Subproject commit f3f440102ef0a22e0ab1c7400b8c8a98eb6275c5 +Subproject commit 349bf449b7329527162598de357bfecf232abc3f diff --git a/tools/install_python_dependencies.sh b/tools/install_python_dependencies.sh index c2db249cf..4454845fc 100755 --- a/tools/install_python_dependencies.sh +++ b/tools/install_python_dependencies.sh @@ -25,7 +25,5 @@ source .venv/bin/activate if [[ "$(uname)" == 'Darwin' ]]; then touch "$ROOT"/.env - echo "# msgq doesn't work on mac" >> "$ROOT"/.env - echo "export ZMQ=1" >> "$ROOT"/.env echo "export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES" >> "$ROOT"/.env fi