From 6a9069fa0fbc111fc93d393d3ee1b6c3da6faeca Mon Sep 17 00:00:00 2001 From: sean yu Date: Sun, 1 Mar 2026 21:43:05 -0500 Subject: [PATCH 1/6] =?UTF-8?q?RSDK-13471=20=20=20=20=E2=80=94=20=20=20=20?= =?UTF-8?q?Fix=20local=20hot=20reload?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- meta.json | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/meta.json b/meta.json index e91fae27..f5098bc5 100644 --- a/meta.json +++ b/meta.json @@ -19,5 +19,11 @@ } ], "entrypoint": "bin/orbbec-module", - "first_run": "./first_run.sh" + "first_run": "./first_run.sh", + "build": { + "setup": "bin/setup.sh", + "build": "make build", + "path": "module.tar.gz", + "arch": ["linux/amd64"] + } } From 58c4bd1155bc4b147e2635a8bb677b5969476863 Mon Sep 17 00:00:00 2001 From: sean yu Date: Sun, 1 Mar 2026 21:58:19 -0500 Subject: [PATCH 2/6] chore: add all supported architectures to build section --- meta.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta.json b/meta.json index f5098bc5..93a25f38 100644 --- a/meta.json +++ b/meta.json @@ -24,6 +24,6 @@ "setup": "bin/setup.sh", "build": "make build", "path": "module.tar.gz", - "arch": ["linux/amd64"] + "arch": ["linux/amd64", "linux/arm64", "darwin/arm64", "windows/amd64"] } } From fceebd5ccb8778294b2de7ac806c5e456cfabef3 Mon Sep 17 00:00:00 2001 From: sean yu Date: Mon, 2 Mar 2026 08:24:52 -0500 Subject: [PATCH 3/6] fix: package binary and udev rules into module tarball in build.sh --- bin/build.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bin/build.sh b/bin/build.sh index 2ba82977..96219dd7 100755 --- a/bin/build.sh +++ b/bin/build.sh @@ -38,3 +38,14 @@ conan build . \ -s:a build_type=Release \ -s:a "&:build_type=RelWithDebInfo" \ -s:a compiler.cppstd=17 + +# Package the module binary, meta.json, and first_run.sh into module.tar.gz +# so that `viam module reload-local` picks it up correctly (see meta.json build.path). +STAGING_DIR="$(mktemp -d)" +mkdir -p "${STAGING_DIR}/bin" +cp build-conan/build/RelWithDebInfo/orbbec-module "${STAGING_DIR}/bin/" +cp meta.json "${STAGING_DIR}/" +cp first_run.sh "${STAGING_DIR}/" +cp install_udev_rules.sh "${STAGING_DIR}/" +tar czf module.tar.gz -C "${STAGING_DIR}" . +rm -rf "${STAGING_DIR}" From 3d62656886a788f64db4a563093d599b892fd89f Mon Sep 17 00:00:00 2001 From: sean yu Date: Mon, 2 Mar 2026 08:53:01 -0500 Subject: [PATCH 4/6] fix: use absolute paths in first_run.sh and install_udev_rules.sh first_run.sh used 'cd $(dirname $0)' then 'sudo ./install_udev_rules.sh', which could fail if sudo resets the working directory. install_udev_rules.sh set CURR_DIR but never used it, instead using 'cp ./99-obsensor-libusb.rules' which fails when cwd isn't the script's directory. Both scripts now resolve and use absolute paths. --- bin/build.sh | 2 -- first_run.sh | 4 ++-- install_udev_rules.sh | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/bin/build.sh b/bin/build.sh index 96219dd7..b2bcd62e 100755 --- a/bin/build.sh +++ b/bin/build.sh @@ -39,8 +39,6 @@ conan build . \ -s:a "&:build_type=RelWithDebInfo" \ -s:a compiler.cppstd=17 -# Package the module binary, meta.json, and first_run.sh into module.tar.gz -# so that `viam module reload-local` picks it up correctly (see meta.json build.path). STAGING_DIR="$(mktemp -d)" mkdir -p "${STAGING_DIR}/bin" cp build-conan/build/RelWithDebInfo/orbbec-module "${STAGING_DIR}/bin/" diff --git a/first_run.sh b/first_run.sh index 5ff2ee75..019e084f 100755 --- a/first_run.sh +++ b/first_run.sh @@ -5,8 +5,8 @@ set -euo pipefail OS=$(uname) if [[ "$OS" == 'Linux' ]]; then - cd $(dirname $0) + SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd -P)" # Install udev rules - sudo ./install_udev_rules.sh + sudo "$SCRIPT_DIR/install_udev_rules.sh" fi diff --git a/install_udev_rules.sh b/install_udev_rules.sh index 57ee62d1..271dab0d 100755 --- a/install_udev_rules.sh +++ b/install_udev_rules.sh @@ -11,7 +11,7 @@ CURR_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)" if [ "$(uname -s)" != "Darwin" ]; then # Install UDEV rules for USB device - cp ./99-obsensor-libusb.rules /etc/udev/rules.d/99-obsensor-libusb.rules + cp "$CURR_DIR/99-obsensor-libusb.rules" /etc/udev/rules.d/99-obsensor-libusb.rules echo "usb rules file install at /etc/udev/rules.d/99-obsensor-libusb.rules" fi udevadm control --reload-rules && udevadm trigger From 5b529d5908fd04a4ced9cdd3ca91848520b18b64 Mon Sep 17 00:00:00 2001 From: sean yu Date: Mon, 2 Mar 2026 17:49:25 -0500 Subject: [PATCH 5/6] refactor: use make module.tar.gz for build step instead of manual packaging Switches meta.json build command from 'make build' to 'make module.tar.gz' which uses Conan's deploy() method for tarball creation. Removes the manual staging/packaging from bin/build.sh since it's now redundant. --- bin/build.sh | 8 -------- meta.json | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/bin/build.sh b/bin/build.sh index b2bcd62e..6dd406c0 100755 --- a/bin/build.sh +++ b/bin/build.sh @@ -39,11 +39,3 @@ conan build . \ -s:a "&:build_type=RelWithDebInfo" \ -s:a compiler.cppstd=17 -STAGING_DIR="$(mktemp -d)" -mkdir -p "${STAGING_DIR}/bin" -cp build-conan/build/RelWithDebInfo/orbbec-module "${STAGING_DIR}/bin/" -cp meta.json "${STAGING_DIR}/" -cp first_run.sh "${STAGING_DIR}/" -cp install_udev_rules.sh "${STAGING_DIR}/" -tar czf module.tar.gz -C "${STAGING_DIR}" . -rm -rf "${STAGING_DIR}" diff --git a/meta.json b/meta.json index 93a25f38..c0e7980b 100644 --- a/meta.json +++ b/meta.json @@ -22,7 +22,7 @@ "first_run": "./first_run.sh", "build": { "setup": "bin/setup.sh", - "build": "make build", + "build": "make module.tar.gz", "path": "module.tar.gz", "arch": ["linux/amd64", "linux/arm64", "darwin/arm64", "windows/amd64"] } From ac66ba6ec2229880bad200090eeeb7ecbe099496 Mon Sep 17 00:00:00 2001 From: sean yu <55464069+hexbabe@users.noreply.github.com> Date: Wed, 4 Mar 2026 18:01:32 -0500 Subject: [PATCH 6/6] Remove windows/amd64 from architecture list in meta.json --- meta.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta.json b/meta.json index c0e7980b..49b41ad0 100644 --- a/meta.json +++ b/meta.json @@ -24,6 +24,6 @@ "setup": "bin/setup.sh", "build": "make module.tar.gz", "path": "module.tar.gz", - "arch": ["linux/amd64", "linux/arm64", "darwin/arm64", "windows/amd64"] + "arch": ["linux/amd64", "linux/arm64", "darwin/arm64"] } }