Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(ci): SDK harness load path, save-slot isolation, libudev
The C harness linked but could not load libastraweave_sdk.so, and
Windows had no cl on PATH. Point the loader at target/release and
import the MSVC environment. Save-slot tests use a private temp
directory so a leftover cwd does not fill every slot. Editor and PBR
jobs install libudev, which libudev-sys requires.

Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
  • Loading branch information
cursoragent and lazyxeon committed Oct 14, 2026
commit e7db0dba4072a35b7552aafa9d04cf6e9b268982
4 changes: 3 additions & 1 deletion .github/workflows/editor-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ jobs:
libxcb-xfixes0-dev \
libxkbcommon-dev \
libegl1-mesa-dev \
libwayland-dev
libwayland-dev \
libudev-dev \
pkg-config

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@1.89.0
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pbr-pipeline-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y libx11-dev libxcursor-dev libxrandr-dev libxi-dev \
libasound2-dev mesa-vulkan-drivers libvulkan1
libasound2-dev mesa-vulkan-drivers libvulkan1 libudev-dev pkg-config

- name: Check formatting
run: cargo fmt --all -- --check
Expand Down Expand Up @@ -134,7 +134,7 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y libx11-dev libxcursor-dev libxrandr-dev libxi-dev \
libasound2-dev mesa-vulkan-drivers libvulkan1
libasound2-dev mesa-vulkan-drivers libvulkan1 libudev-dev pkg-config

- name: Test astraweave-render
run: |
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/sdk-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@1.89.0
- name: MSVC developer environment
if: matrix.os == 'windows-latest'
uses: ilammy/msvc-dev-cmd@v1
- name: Build SDK
run: cargo build -p astraweave-sdk --release
- name: Install cbindgen
Expand Down Expand Up @@ -46,8 +49,8 @@
return 0;
}
EOF
cc -I. -L target/release -o c_harness c_harness.c -lastraweave_sdk -lpthread -ldl -lm
./c_harness | tee harness_out.txt
cc -I. -L target/release -Wl,-rpath,'$ORIGIN/target/release' -o c_harness c_harness.c -lastraweave_sdk -lpthread -ldl -lm
LD_LIBRARY_PATH=target/release ./c_harness | tee harness_out.txt
# Semantic version gate: compare printed version to Cargo.toml version
VER=$(sed -n 's/^version\s*=\s*"\([^"]\+\)"/\1/p' astraweave-sdk/Cargo.toml | head -n1)
OUT=$(head -n1 harness_out.txt)
Expand Down
23 changes: 17 additions & 6 deletions crates/astraweave-persistence-player/src/save_slots.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,18 @@ pub struct SaveSlot {
mod tests {
use super::*;

/// Workspace `cargo test` shares a cwd. A relative save dir left behind by
/// an earlier run makes `next_available_slot` look full.
fn isolated_saves(name: &str) -> PathBuf {
let dir = std::env::temp_dir().join(format!("aw_save_slots_{name}_{}", std::process::id()));
let _ = fs::remove_dir_all(&dir);
dir
}

#[test]
fn test_save_load_roundtrip() {
let manager = SaveSlotManager::new(10, PathBuf::from("test_saves"));
let dir = isolated_saves("roundtrip");
let manager = SaveSlotManager::new(10, dir.clone());
let profile = PlayerProfile::default();

// Save to slot 0
Expand All @@ -290,12 +299,13 @@ mod tests {

// Cleanup
manager.delete_slot(0).unwrap();
fs::remove_dir_all("test_saves").unwrap();
fs::remove_dir_all(&dir).unwrap();
}

#[test]
fn test_list_slots() {
let manager = SaveSlotManager::new(10, PathBuf::from("test_saves2"));
let dir = isolated_saves("list");
let manager = SaveSlotManager::new(10, dir.clone());
let profile = PlayerProfile::default();

// Save to slots 0, 1, 2
Expand All @@ -313,12 +323,13 @@ mod tests {
for i in 0..3 {
manager.delete_slot(i).unwrap();
}
fs::remove_dir_all("test_saves2").unwrap();
fs::remove_dir_all(&dir).unwrap();
}

#[test]
fn test_next_available_slot() {
let manager = SaveSlotManager::new(3, PathBuf::from("test_saves3"));
let dir = isolated_saves("next");
let manager = SaveSlotManager::new(3, dir.clone());
let profile = PlayerProfile::default();

// Initially, slot 0 should be available
Expand Down Expand Up @@ -347,6 +358,6 @@ mod tests {
for i in 0..3 {
manager.delete_slot(i).unwrap();
}
fs::remove_dir_all("test_saves3").unwrap();
fs::remove_dir_all(&dir).unwrap();
}
}
Loading