From 61608db786e163a55b11bdd1c557f0cd663c5d11 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Wed, 15 Jul 2026 21:39:47 -0700 Subject: [PATCH] jp: fix linking on macOS (#38353) * jp: fix linking on macOS * mv to root --- SConstruct | 5 +++++ openpilot/tools/jotpluggler/test_jotpluggler.py | 11 +++++++++++ 2 files changed, 16 insertions(+) create mode 100644 openpilot/tools/jotpluggler/test_jotpluggler.py diff --git a/SConstruct b/SConstruct index 72a25e12d..2a69cd2e3 100644 --- a/SConstruct +++ b/SConstruct @@ -166,6 +166,11 @@ env = Environment( tools=["default", "cython", "compilation_db", "rednose_filter"], toolpath=["#site_scons/site_tools", "#rednose_repo/site_scons/site_tools"], ) +# SCons' Darwin linker tool doesn't define the variables used to expand RPATH. +if arch == "Darwin": + env["RPATHPREFIX"] = "-Wl,-rpath," + env["RPATHSUFFIX"] = "" + env["_RPATH"] = "${_concat(RPATHPREFIX, RPATH, RPATHSUFFIX, __env__)}" if arch != "larch64": env['_LIBFLAGS'] = _libflags diff --git a/openpilot/tools/jotpluggler/test_jotpluggler.py b/openpilot/tools/jotpluggler/test_jotpluggler.py new file mode 100644 index 000000000..b9b751c4a --- /dev/null +++ b/openpilot/tools/jotpluggler/test_jotpluggler.py @@ -0,0 +1,11 @@ +import subprocess +from pathlib import Path + + +JOTPLUGGLER_DIR = Path(__file__).parent + + +def test_help(): + result = subprocess.run(["./jotpluggler", "-h"], cwd=JOTPLUGGLER_DIR, capture_output=True, text=True) + assert result.returncode == 0, result.stderr + assert "Usage:" in result.stderr