Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
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
6 changes: 6 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
[target.x86_64-pc-windows-gnu]
linker = "x86_64-w64-mingw32-gcc"
ar = "x86_64-w64-mingw32-ar"

[target.x86_64-pc-windows-msvc]
rustflags = ["-C", "target-feature=+crt-static"]

[target.i686-pc-windows-msvc]
rustflags = ["-C", "target-feature=+crt-static"]
17 changes: 17 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,23 @@
'custom.regex',
],
},

// Windows Driver Kit (WDK) - keep within 10.0.* series
{
matchDatasources: [
'nuget',
],
matchPackagePatterns: [
'Microsoft\\.Windows\\.DriverKit\\.Wdk',
],
groupName: 'Windows Driver Kit',
groupSlug: 'wdk',
// Only allow patch and minor updates within the 10.0.* version range
allowedVersions: '/^10\\.0\\..+$/',
schedule: [
'before 3am on Monday',
],
},
],

// Custom managers for non-standard dependency sources
Expand Down
34 changes: 34 additions & 0 deletions .github/scripts/diagnose-wdk-build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Diagnostic script for WDK build issues on Windows
# This script collects information useful for debugging wdk-sys bindgen failures

Write-Host "=== WDK Build Environment Diagnostics ===" -ForegroundColor Cyan

Write-Host "`nSystem Information:"
systeminfo | Select-String "OS Version", "Total Physical Memory"

Write-Host "`nRust Toolchain:"
rustc --version
cargo --version

Write-Host "`nWDK Installation Check:"
if (Test-Path "C:\Program Files (x86)\Windows Kits") {
Get-ChildItem "C:\Program Files (x86)\Windows Kits" | ForEach-Object { Write-Host " Found: $_" }
} else {
Write-Host " WARNING: Windows Kits directory not found"
}

Write-Host "`nLLVM/Clang Check:"
clang --version 2>&1 | Select-Object -First 1

Write-Host "`nCargo Environment:"
$env:CARGO_BUILD_JOBS
Write-Host " CARGO_BUILD_JOBS: $($env:CARGO_BUILD_JOBS ?? 'not set')"
Write-Host " Available CPU cores: $([System.Environment]::ProcessorCount)"

Write-Host "`nKnown Issues:"
Write-Host " - wdk-sys 0.5.1 has flaky bindgen thread failures on Windows CI"
Write-Host " - Likely causes: resource exhaustion, LLVM version incompatibility"
Write-Host " - Workaround: reduce parallel jobs with 'cargo build -j 2'"
Write-Host " - Reference: https://github.com/microsoft/windows-drivers-rs/discussions/591"

Write-Host "`n=== End Diagnostics ===" -ForegroundColor Cyan
199 changes: 193 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,28 @@
name: CI

# NOTE: Windows jobs build sideblinder-driver with `-j 1`. This is NOT a
# performance tuning — removing it will break the build. `wdk-macros` 0.5.1
# (a transitive dep via `wdk`) has a race during parallel proc-macro
# expansion: two threads call File::create on the same scratch `.lock` file
# and then LockFileEx, and Windows returns ERROR_INVALID_FUNCTION (os error 1)
# instead of the expected lock-violation error. Other crates build in parallel.
# See CLAUDE.md -> Building for details. Upstream fix tracked at
# microsoft/windows-drivers-rs#463 (migrating fs4 -> std::File::lock); once
# that lands, `-j 1` can be dropped here.

on:
push:
branches: [main]
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
clippy:
name: Clippy
runs-on: windows-latest
runs-on: windows-2022
permissions:
contents: read
steps:
Expand All @@ -23,15 +37,62 @@ jobs:
toolchain: 1.94.1
components: clippy

- name: Install LLVM 17
shell: pwsh
run: |
$llvmVersion = "17.0.6"
$llvmUrl = "https://github.com/llvm/llvm-project/releases/download/llvmorg-$llvmVersion/LLVM-$llvmVersion-win64.exe"
$llvmInstaller = "$env:TEMP\LLVM-$llvmVersion-win64.exe"
Write-Host "Downloading LLVM $llvmVersion from official release..."
curl.exe -L -o $llvmInstaller $llvmUrl
if ($LASTEXITCODE -ne 0) {
Write-Host "ERROR: Failed to download LLVM"
exit 1
}
Write-Host "Installing LLVM $llvmVersion..."
& $llvmInstaller /S /D="C:\LLVM"
if ($LASTEXITCODE -ne 0) {
Write-Host "ERROR: Failed to install LLVM"
exit 1
}
Write-Host "LLVM installed successfully"

- name: Verify Windows SDK and WDK
shell: pwsh
run: |
Write-Host "Verifying Windows SDK and WDK installation..."

# Verify WDK headers are available (windows-2022 includes them)
$wdk_paths = @(
"C:\Program Files (x86)\Windows Kits\10\Include",
"C:\Program Files\Windows Kits\10\Include"
)

$found = $false
foreach ($path in $wdk_paths) {
if (Test-Path $path) {
Write-Host "✓ Found Windows Kits at: $path"
$found = $true
break
}
}

if (-not $found) {
Write-Host "ERROR: Windows Kits not found - WDK headers are required"
exit 1
}

- name: Cache dependencies
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1

- name: Clippy
run: cargo clippy --all-targets --all-features -- -D warnings
run: |
cargo clippy --workspace --exclude sideblinder-driver --all-targets --all-features -- -D warnings
cargo clippy -p sideblinder-driver -j 1 --all-targets --all-features -- -D warnings

test:
name: Test
runs-on: windows-latest
runs-on: windows-2022
needs: clippy
permissions:
contents: read
Expand All @@ -46,16 +107,79 @@ jobs:
with:
toolchain: 1.94.1

- name: Cache LLVM 17 installer
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
with:
path: C:\tools\LLVM-17.0.6-win64.exe
key: llvm-17.0.6-win64

- name: Install LLVM 17
shell: pwsh
run: |
$llvmVersion = "17.0.6"
$llvmUrl = "https://github.com/llvm/llvm-project/releases/download/llvmorg-$llvmVersion/LLVM-$llvmVersion-win64.exe"
$llvmInstaller = "C:\tools\LLVM-$llvmVersion-win64.exe"
$toolsDir = "C:\tools"

if (-not (Test-Path $llvmInstaller)) {
if (-not (Test-Path $toolsDir)) {
New-Item -ItemType Directory -Path $toolsDir -Force | Out-Null
}
Write-Host "Downloading LLVM $llvmVersion from official release..."
curl.exe -L -o $llvmInstaller $llvmUrl
if ($LASTEXITCODE -ne 0) {
Write-Host "ERROR: Failed to download LLVM"
exit 1
}
} else {
Write-Host "Using cached LLVM installer"
}

Write-Host "Installing LLVM $llvmVersion..."
& $llvmInstaller /S /D="C:\LLVM"
if ($LASTEXITCODE -ne 0) {
Write-Host "ERROR: Failed to install LLVM"
exit 1
}
Write-Host "LLVM installed successfully"

- name: Verify Windows SDK and WDK
shell: pwsh
run: |
Write-Host "Verifying Windows SDK and WDK installation..."

# Verify WDK headers are available (windows-2022 includes them)
$wdk_paths = @(
"C:\Program Files (x86)\Windows Kits\10\Include",
"C:\Program Files\Windows Kits\10\Include"
)

$found = $false
foreach ($path in $wdk_paths) {
if (Test-Path $path) {
Write-Host "✓ Found Windows Kits at: $path"
$found = $true
break
}
}

if (-not $found) {
Write-Host "ERROR: Windows Kits not found - WDK headers are required"
exit 1
}

- name: Cache dependencies
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1

- name: Test
run: cargo test --locked
run: |
cargo test --workspace --exclude sideblinder-driver --locked
cargo test -p sideblinder-driver -j 1 --locked

build:
name: Release Build
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: windows-latest
runs-on: windows-2022
needs: test
permissions:
contents: read
Expand All @@ -70,11 +194,74 @@ jobs:
with:
toolchain: 1.94.1

- name: Cache LLVM 17 installer
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
with:
path: C:\tools\LLVM-17.0.6-win64.exe
key: llvm-17.0.6-win64

- name: Install LLVM 17
shell: pwsh
run: |
$llvmVersion = "17.0.6"
$llvmUrl = "https://github.com/llvm/llvm-project/releases/download/llvmorg-$llvmVersion/LLVM-$llvmVersion-win64.exe"
$llvmInstaller = "C:\tools\LLVM-$llvmVersion-win64.exe"
$toolsDir = "C:\tools"

if (-not (Test-Path $llvmInstaller)) {
if (-not (Test-Path $toolsDir)) {
New-Item -ItemType Directory -Path $toolsDir -Force | Out-Null
}
Write-Host "Downloading LLVM $llvmVersion from official release..."
curl.exe -L -o $llvmInstaller $llvmUrl
if ($LASTEXITCODE -ne 0) {
Write-Host "ERROR: Failed to download LLVM"
exit 1
}
} else {
Write-Host "Using cached LLVM installer"
}

Write-Host "Installing LLVM $llvmVersion..."
& $llvmInstaller /S /D="C:\LLVM"
if ($LASTEXITCODE -ne 0) {
Write-Host "ERROR: Failed to install LLVM"
exit 1
}
Write-Host "LLVM installed successfully"

- name: Verify Windows SDK and WDK
shell: pwsh
run: |
Write-Host "Verifying Windows SDK and WDK installation..."

# Verify WDK headers are available (windows-2022 includes them)
$wdk_paths = @(
"C:\Program Files (x86)\Windows Kits\10\Include",
"C:\Program Files\Windows Kits\10\Include"
)

$found = $false
foreach ($path in $wdk_paths) {
if (Test-Path $path) {
Write-Host "✓ Found Windows Kits at: $path"
$found = $true
break
}
}

if (-not $found) {
Write-Host "ERROR: Windows Kits not found - WDK headers are required"
exit 1
}

- name: Cache dependencies
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1

- name: Build
run: cargo build --release --locked
run: |
cargo build --workspace --exclude sideblinder-driver --release --locked
cargo build -p sideblinder-driver -j 1 --release --locked

- name: Get version
id: version
Expand Down
18 changes: 9 additions & 9 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[submodule "joystick_gremlin"]
path = joystick_gremlin
[submodule "reference/joystick_gremlin"]
path = reference/joystick_gremlin
url = https://github.com/WhiteMagic/JoystickGremlin.git
[submodule "mw5_ffb"]
path = mw5_ffb
[submodule "reference/mw5_ffb"]
path = reference/mw5_ffb
url = https://github.com/HappyFox/MW5_FFB.git
[submodule "vjoy"]
path = vjoy
[submodule "reference/vjoy"]
path = reference/vjoy
url = https://github.com/BrunnerInnovation/vJoy.git
[submodule "sidewinder-arduino"]
path = sidewinder-arduino
url = https://github.com/Poil/sidewinder-arduino
[submodule "reference/sidewinder-arduino"]
path = reference/sidewinder-arduino
url = https://github.com/Poil/sidewinder-arduino.git
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added
- IPC protocol versioning: GUI and app now detect version mismatches and fail fast with a user-facing error instead of silently corrupting data. Documented in `docs/ipc-protocol.md`.

### Changed
- All project artifacts renamed from `sidewinder` to `sideblinder` (crate names, binary names,
config directory, named pipe, tray class). References to the "Microsoft Sidewinder Force
Feedback 2" hardware are unchanged.
- Each crate now carries its own independent version. The workspace-level version is managed
separately from individual crates.
- **sideblinder-ipc**: IPC frame payload size increased from 22 to 23 bytes (now includes protocol version byte). Breaking change for external consumers of the wire format.
- **sideblinder-driver**: Force feedback queue now accepts shared references for push/pop, allowing concurrent UMDF callback access without exclusive ownership.

## [0.7.0] - 2026-04-14

Expand Down
Loading
Loading