Skip to content

Commit 50ed2df

Browse files
committed
fix(packaging): fix glob expansion and missing HOME fallback
Fix glob in px4-gazebo.sh that could match multiple arch directories by using find instead of shell glob. Add /tmp fallback when HOME is unset in main.cpp to avoid writing to filesystem root. Signed-off-by: Ramon Roche <mrpollo@gmail.com>
1 parent 781ae88 commit 50ed2df

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

.github/workflows/sitl_containers.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
fi
6868
6969
build-deb:
70-
name: "Build .deb (${{ matrix.target }}/${{ matrix.arch }})"
70+
name: "Build .deb (${{ matrix.label }}/${{ matrix.arch }})"
7171
needs: setup
7272
runs-on: [runs-on,"runner=4cpu-linux-${{ matrix.runner }}","image=ubuntu24-full-${{ matrix.runner }}","run-id=${{ github.run_id }}",extras=s3-cache,spot=false]
7373
container:
@@ -78,10 +78,10 @@ jobs:
7878
fail-fast: false
7979
matrix:
8080
include:
81-
- { target: sih, arch: amd64, runner: x64, setup_flags: "--no-sim-tools" }
82-
- { target: sih, arch: arm64, runner: arm64, setup_flags: "--no-sim-tools" }
83-
- { target: default, arch: amd64, runner: x64, setup_flags: "" }
84-
- { target: default, arch: arm64, runner: arm64, setup_flags: "" }
81+
- { label: sih, target: sih, arch: amd64, runner: x64, setup_flags: "--no-sim-tools" }
82+
- { label: sih, target: sih, arch: arm64, runner: arm64, setup_flags: "--no-sim-tools" }
83+
- { label: gazebo, target: default, arch: amd64, runner: x64, setup_flags: "" }
84+
- { label: gazebo, target: default, arch: arm64, runner: arm64, setup_flags: "" }
8585
steps:
8686
- name: Fix git in container
8787
run: |

Tools/packaging/px4-gazebo.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ export GZ_SIM_SERVER_CONFIG_PATH="${PX4_GZ_SERVER_CONFIG}"
1818
# to the unversioned libgz-physics-dartsim-plugin.so. The runtime package only
1919
# ships versioned .so files; the unversioned symlink lives in the -dev package.
2020
# Create it if missing so Gazebo finds the DART engine without installing -dev.
21-
GZ_PHYSICS_ENGINE_DIR=$(echo /usr/lib/*/gz-physics-7/engine-plugins)
22-
if [ -d "$GZ_PHYSICS_ENGINE_DIR" ]; then
21+
GZ_PHYSICS_ENGINE_DIR=$(find /usr/lib -maxdepth 3 -type d -name "engine-plugins" -path "*/gz-physics-7/*" 2>/dev/null | head -1)
22+
if [ -n "$GZ_PHYSICS_ENGINE_DIR" ] && [ -d "$GZ_PHYSICS_ENGINE_DIR" ]; then
2323
UNVERSIONED="$GZ_PHYSICS_ENGINE_DIR/libgz-physics-dartsim-plugin.so"
2424
if [ ! -e "$UNVERSIONED" ]; then
2525
VERSIONED=$(ls "$GZ_PHYSICS_ENGINE_DIR"/libgz-physics*-dartsim-plugin.so.* 2>/dev/null | head -1)

platforms/posix/src/px4/common/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ int main(int argc, char **argv)
276276

277277
} else {
278278
const char *home = getenv("HOME");
279-
state_base = std::string(home ? home : "") + "/.local/share";
279+
state_base = std::string(home ? home : "/tmp") + "/.local/share";
280280
}
281281

282282
working_directory = state_base + "/px4/rootfs";

0 commit comments

Comments
 (0)