Skip to content

Commit 3106009

Browse files
authored
Stabilize packaging CI and temporarily disable Windows jobs (#1)
* Fix GitHub Actions bundle helper execution * ci: allow run on all push branches * Allow CI pushes from all branches * Fix CI runner config and planning references * Fix macOS dsview-sys CI issues * Fix Windows CI build configuration * Fix macOS ARM64 libusb include paths * Set up MSVC environment in Windows CI * Cache vcpkg binaries in Windows CI * Create vcpkg cache directory in CI * Add Windows compat header for sys time * Temporarily disable Windows CI workflows
1 parent 7b5896b commit 3106009

28 files changed

Lines changed: 631 additions & 620 deletions

.github/actions/package-and-validate/action.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ runs:
1919
- name: Package bundle
2020
shell: bash
2121
run: |
22-
cargo +stable -Zscript tools/package-bundle.rs \
22+
PYTHON_BIN=python3
23+
if ! command -v "$PYTHON_BIN" >/dev/null 2>&1; then
24+
PYTHON_BIN=python
25+
fi
26+
"$PYTHON_BIN" tools/package-bundle.py \
2327
--exe "${{ inputs.exe-path }}" \
2428
--runtime "${{ inputs.runtime-path }}" \
2529
--resources DSView/DSView/res \
@@ -30,7 +34,11 @@ runs:
3034
- name: Validate bundle
3135
shell: bash
3236
run: |
33-
cargo +stable -Zscript tools/validate-bundle.rs \
37+
PYTHON_BIN=python3
38+
if ! command -v "$PYTHON_BIN" >/dev/null 2>&1; then
39+
PYTHON_BIN=python
40+
fi
41+
"$PYTHON_BIN" tools/validate-bundle.py \
3442
--archive "dsview-cli-${{ inputs.version }}-${{ inputs.target }}.tar.gz" \
3543
--target "${{ inputs.target }}"
3644

.github/actions/setup-native-prereqs/action.yml

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,9 @@ runs:
2929
build-essential \
3030
cmake \
3131
pkg-config \
32-
gcc-aarch64-linux-gnu \
33-
g++-aarch64-linux-gnu \
34-
libglib2.0-dev:arm64 \
35-
libusb-1.0-0-dev:arm64 \
36-
libfftw3-dev:arm64
32+
libglib2.0-dev \
33+
libusb-1.0-0-dev \
34+
libfftw3-dev
3735
3836
- name: Install macOS dependencies
3937
if: startsWith(inputs.target, 'x86_64-apple-darwin') || startsWith(inputs.target, 'aarch64-apple-darwin')
@@ -45,12 +43,34 @@ runs:
4543
if: inputs.target == 'x86_64-pc-windows-msvc'
4644
shell: pwsh
4745
run: |
46+
if ($env:VCPKG_DEFAULT_BINARY_CACHE) {
47+
New-Item -ItemType Directory -Force -Path $env:VCPKG_DEFAULT_BINARY_CACHE | Out-Null
48+
}
49+
4850
# vcpkg is pre-installed on GitHub-hosted Windows runners
49-
vcpkg install glib:x64-windows libusb:x64-windows fftw3:x64-windows
51+
vcpkg install glib:x64-windows libusb:x64-windows fftw3:x64-windows pkgconf:x64-windows
52+
53+
$VcpkgRoot = if ($env:VCPKG_INSTALLATION_ROOT) { $env:VCPKG_INSTALLATION_ROOT } elseif ($env:VCPKG_ROOT) { $env:VCPKG_ROOT } else { throw "vcpkg root environment variable is not set" }
54+
$Triplet = "x64-windows"
55+
$PkgConfigPath = "$VcpkgRoot/installed/$Triplet/lib/pkgconfig;$VcpkgRoot/installed/$Triplet/share/pkgconfig"
56+
$PkgConfigBin = "$VcpkgRoot/installed/$Triplet/tools/pkgconf"
57+
$RuntimeBin = "$VcpkgRoot/installed/$Triplet/bin"
58+
$DebugRuntimeBin = "$VcpkgRoot/installed/$Triplet/debug/bin"
59+
60+
"DSVIEW_VCPKG_ROOT=$VcpkgRoot" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
61+
"DSVIEW_VCPKG_TRIPLET=$Triplet" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
62+
"CMAKE_TOOLCHAIN_FILE=$VcpkgRoot/scripts/buildsystems/vcpkg.cmake" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
63+
"PKG_CONFIG_PATH=$PkgConfigPath" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
64+
"PKG_CONFIG_LIBDIR=$PkgConfigPath" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
65+
"PATH=$RuntimeBin;$DebugRuntimeBin;$PkgConfigBin;$env:PATH" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
5066
5167
- name: Install Windows ARM64 dependencies
5268
if: inputs.target == 'aarch64-pc-windows-msvc'
5369
shell: pwsh
5470
run: |
71+
if ($env:VCPKG_DEFAULT_BINARY_CACHE) {
72+
New-Item -ItemType Directory -Force -Path $env:VCPKG_DEFAULT_BINARY_CACHE | Out-Null
73+
}
74+
5575
# vcpkg is pre-installed on GitHub-hosted Windows runners
5676
vcpkg install glib:arm64-windows libusb:arm64-windows fftw3:arm64-windows

.github/workflows/ci.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ name: CI
22

33
on:
44
push:
5-
branches: [master]
65
pull_request:
76
branches: [master]
87

@@ -21,15 +20,11 @@ jobs:
2120
- target: x86_64-unknown-linux-gnu
2221
runner: ubuntu-latest
2322
- target: aarch64-unknown-linux-gnu
24-
runner: ubuntu-latest
23+
runner: ubuntu-24.04-arm
2524
- target: x86_64-apple-darwin
26-
runner: macos-13
25+
runner: macos-15-intel
2726
- target: aarch64-apple-darwin
2827
runner: macos-14
29-
- target: x86_64-pc-windows-msvc
30-
runner: windows-latest
31-
- target: aarch64-pc-windows-msvc
32-
runner: windows-latest
3328

3429
steps:
3530
- name: Checkout repository

.github/workflows/release.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,11 @@ jobs:
2020
- target: x86_64-unknown-linux-gnu
2121
runner: ubuntu-latest
2222
- target: aarch64-unknown-linux-gnu
23-
runner: ubuntu-latest
23+
runner: ubuntu-24.04-arm
2424
- target: x86_64-apple-darwin
25-
runner: macos-13
25+
runner: macos-15-intel
2626
- target: aarch64-apple-darwin
2727
runner: macos-14
28-
- target: x86_64-pc-windows-msvc
29-
runner: windows-latest
30-
- target: aarch64-pc-windows-msvc
31-
runner: windows-latest
3228

3329
steps:
3430
- name: Checkout repository
@@ -135,12 +131,11 @@ jobs:
135131
This release provides pre-built bundles for:
136132
- Linux x86_64 and ARM64
137133
- macOS x86_64 (Intel) and ARM64 (Apple Silicon)
138-
- Windows x86_64 and ARM64
139134
140135
### Bundle Contents
141136
142137
Each bundle contains:
143-
- `dsview-cli` executable (or `dsview-cli.exe` on Windows)
138+
- platform-appropriate `dsview-cli` executable
144139
- `runtime/` directory with the platform-specific runtime library
145140
- `resources/` directory with DSLogic Plus firmware and bitstreams
146141

.planning/STATE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ See: .planning/PROJECT.md
4747
- Full test suite passing (0 failures)
4848
- No gaps or blockers identified
4949

50-
**Verification Report:** `.planning/phases/01-create-a-proper-readme-covering-project-background-core-usage-build-and-test-instructions-and-add-github-actions-ci-release-workflows-that-build-and-test-binaries-for-windows-linux-and-macos-on-x64-and-arm64/01-VERIFICATION.md`
50+
**Verification Report:** `.planning/phases/01-readme-ci-release-workflows/01-VERIFICATION.md`
5151

5252
## Key Decisions
5353

5454
- D-01: Target-aware runtime naming contract established via `runtime_library_name()` helper
5555
- D-02: Portable CMake build supports Linux/macOS/Windows with platform-conditional dependencies
56-
- D-03: Bundle packaging uses cargo-script pattern for standalone tool execution
56+
- D-03: Bundle packaging uses repo-local Python helpers for standalone tool execution
5757
- D-04: Bundle validation includes smoke tests for --help commands without hardware dependency
5858
- D-05: Single source of truth for runtime naming via dsview_sys::runtime_library_name()
5959
- D-06: Bundled runtime/resource discovery as default CLI behavior with developer fallback

.planning/phases/01-create-a-proper-readme-covering-project-background-core-usage-build-and-test-instructions-and-add-github-actions-ci-release-workflows-that-build-and-test-binaries-for-windows-linux-and-macos-on-x64-and-arm64/.gitkeep renamed to .planning/phases/01-readme-ci-release-workflows/.gitkeep

File renamed without changes.

.planning/phases/01-create-a-proper-readme-covering-project-background-core-usage-build-and-test-instructions-and-add-github-actions-ci-release-workflows-that-build-and-test-binaries-for-windows-linux-and-macos-on-x64-and-arm64/01-01-PLAN.md renamed to .planning/phases/01-readme-ci-release-workflows/01-01-PLAN.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
phase: 01-create-a-proper-readme-covering-project-background-core-usage-build-and-test-instructions-and-add-github-actions-ci-release-workflows-that-build-and-test-binaries-for-windows-linux-and-macos-on-x64-and-arm64
2+
phase: 01-readme-ci-release-workflows
33
plan: 01
44
title: Establish six-target native portability and bundle contract foundations
55
subsystem: native-portability
@@ -15,8 +15,8 @@ files_modified:
1515
- crates/dsview-sys/src/lib.rs
1616
- crates/dsview-sys/tests/runtime_packaging.rs
1717
- crates/dsview-core/tests/bundle_discovery.rs
18-
- tools/package-bundle.rs
19-
- tools/validate-bundle.rs
18+
- tools/package-bundle.py
19+
- tools/validate-bundle.py
2020
must_haves:
2121
truths:
2222
- The repository-built runtime becomes the only supported runtime path and must stop assuming Linux-only `.so` naming.
@@ -28,17 +28,17 @@ must_haves:
2828
- crates/dsview-sys/native/CMakeLists.txt
2929
- crates/dsview-sys/tests/runtime_packaging.rs
3030
- crates/dsview-core/tests/bundle_discovery.rs
31-
- tools/package-bundle.rs
32-
- tools/validate-bundle.rs
31+
- tools/package-bundle.py
32+
- tools/validate-bundle.py
3333
key_links:
34-
- from: .planning/phases/01-create-a-proper-readme-covering-project-background-core-usage-build-and-test-instructions-and-add-github-actions-ci-release-workflows-that-build-and-test-binaries-for-windows-linux-and-macos-on-x64-and-arm64/01-CONTEXT.md
34+
- from: .planning/phases/01-readme-ci-release-workflows/01-CONTEXT.md
3535
to: crates/dsview-sys/build.rs
3636
via: D-01 through D-07 native portability and bundle-relative runtime/resource contract
37-
- from: .planning/phases/01-create-a-proper-readme-covering-project-background-core-usage-build-and-test-instructions-and-add-github-actions-ci-release-workflows-that-build-and-test-binaries-for-windows-linux-and-macos-on-x64-and-arm64/01-VALIDATION.md
37+
- from: .planning/phases/01-readme-ci-release-workflows/01-VALIDATION.md
3838
to: crates/dsview-sys/tests/runtime_packaging.rs
3939
via: Wave 0 target-aware runtime naming/path coverage
40-
- from: .planning/phases/01-create-a-proper-readme-covering-project-background-core-usage-build-and-test-instructions-and-add-github-actions-ci-release-workflows-that-build-and-test-binaries-for-windows-linux-and-macos-on-x64-and-arm64/01-RESEARCH.md
41-
to: tools/validate-bundle.rs
40+
- from: .planning/phases/01-readme-ci-release-workflows/01-RESEARCH.md
41+
to: tools/validate-bundle.py
4242
via: required archive-root layout and post-unpack validation helper contract
4343
---
4444

@@ -53,8 +53,8 @@ This plan covers target-aware runtime naming, portable native build seams, repo-
5353
<task type="auto">
5454
<name>Refactor `dsview-sys` build orchestration around target-aware runtime naming and tool selection</name>
5555
<read_first>
56-
- .planning/phases/01-create-a-proper-readme-covering-project-background-core-usage-build-and-test-instructions-and-add-github-actions-ci-release-workflows-that-build-and-test-binaries-for-windows-linux-and-macos-on-x64-and-arm64/01-CONTEXT.md
57-
- .planning/phases/01-create-a-proper-readme-covering-project-background-core-usage-build-and-test-instructions-and-add-github-actions-ci-release-workflows-that-build-and-test-binaries-for-windows-linux-and-macos-on-x64-and-arm64/01-RESEARCH.md
56+
- .planning/phases/01-readme-ci-release-workflows/01-CONTEXT.md
57+
- .planning/phases/01-readme-ci-release-workflows/01-RESEARCH.md
5858
- crates/dsview-sys/build.rs
5959
- crates/dsview-sys/src/lib.rs
6060
</read_first>
@@ -71,7 +71,7 @@ This plan covers target-aware runtime naming, portable native build seams, repo-
7171
<task type="auto">
7272
<name>Make `crates/dsview-sys/native/CMakeLists.txt` honest for Linux, macOS, and Windows shared-library builds</name>
7373
<read_first>
74-
- .planning/phases/01-create-a-proper-readme-covering-project-background-core-usage-build-and-test-instructions-and-add-github-actions-ci-release-workflows-that-build-and-test-binaries-for-windows-linux-and-macos-on-x64-and-arm64/01-RESEARCH.md
74+
- .planning/phases/01-readme-ci-release-workflows/01-RESEARCH.md
7575
- crates/dsview-sys/native/CMakeLists.txt
7676
- crates/dsview-sys/build.rs
7777
</read_first>
@@ -88,44 +88,44 @@ This plan covers target-aware runtime naming, portable native build seams, repo-
8888
<task type="auto">
8989
<name>Define the stable bundle layout, dependency contract, and repo-local package assembly helper</name>
9090
<read_first>
91-
- .planning/phases/01-create-a-proper-readme-covering-project-background-core-usage-build-and-test-instructions-and-add-github-actions-ci-release-workflows-that-build-and-test-binaries-for-windows-linux-and-macos-on-x64-and-arm64/01-CONTEXT.md
92-
- .planning/phases/01-create-a-proper-readme-covering-project-background-core-usage-build-and-test-instructions-and-add-github-actions-ci-release-workflows-that-build-and-test-binaries-for-windows-linux-and-macos-on-x64-and-arm64/01-RESEARCH.md
91+
- .planning/phases/01-readme-ci-release-workflows/01-CONTEXT.md
92+
- .planning/phases/01-readme-ci-release-workflows/01-RESEARCH.md
9393
- crates/dsview-core/src/lib.rs
9494
- Cargo.toml
9595
</read_first>
96-
<files>tools/package-bundle.rs, tools/validate-bundle.rs, Cargo.toml</files>
97-
<action>Create one repo-local packaging helper at `tools/package-bundle.rs` or an equivalent small Rust binary that assembles release-style archives named `dsview-cli-v{version}-{target-triple}.tar.gz` on Unix and `dsview-cli-v{version}-{target-triple}.zip` on Windows. The helper must build the internal archive root `dsview-cli-v{version}-{target-triple}/` containing `dsview-cli[.exe]`, `runtime/<platform-runtime-name>`, and `resources/` with exactly the DSLogic Plus files checked by `ensure_resource_file_set()` (`DSLogicPlus.bin`, `DSLogicPlus-pgl12.bin`, and either `DSLogicPlus.fw` or `DSLogic.fw`). In the same helper flow, add an explicit per-target runtime-dependency contract for non-system shared libraries: determine which extra dynamic libraries must be bundled or explicitly declared as platform prerequisites for macOS and Windows MSVC builds, encode that rule in the package helper inputs, and make `tools/validate-bundle.rs` verify the resulting runtime payload instead of assuming the main runtime library is sufficient on every target.</action>
96+
<files>tools/package-bundle.py, tools/validate-bundle.py, Cargo.toml</files>
97+
<action>Create one repo-local packaging helper at `tools/package-bundle.py` or an equivalent small Rust binary that assembles release-style archives named `dsview-cli-v{version}-{target-triple}.tar.gz` on Unix and `dsview-cli-v{version}-{target-triple}.zip` on Windows. The helper must build the internal archive root `dsview-cli-v{version}-{target-triple}/` containing `dsview-cli[.exe]`, `runtime/<platform-runtime-name>`, and `resources/` with exactly the DSLogic Plus files checked by `ensure_resource_file_set()` (`DSLogicPlus.bin`, `DSLogicPlus-pgl12.bin`, and either `DSLogicPlus.fw` or `DSLogic.fw`). In the same helper flow, add an explicit per-target runtime-dependency contract for non-system shared libraries: determine which extra dynamic libraries must be bundled or explicitly declared as platform prerequisites for macOS and Windows MSVC builds, encode that rule in the package helper inputs, and make `tools/validate-bundle.py` verify the resulting runtime payload instead of assuming the main runtime library is sufficient on every target.</action>
9898
<acceptance_criteria>
9999
- the plan implementation target includes a single documented archive naming family across CI and release flows
100100
- the package helper assembles `runtime/` and `resources/` subdirectories under a versioned archive root rather than emitting loose files
101101
- resource payload selection is limited to the DSLogic Plus firmware and bitstreams already required by `crates/dsview-core`
102102
- the helper can accept the target triple and resolved runtime filename as explicit inputs so CI does not guess layout rules independently
103-
- the packaging contract explicitly states whether additional non-system runtime dependencies must be bundled or guaranteed externally on Linux, macOS, and Windows, and `tools/validate-bundle.rs` enforces that contract
103+
- the packaging contract explicitly states whether additional non-system runtime dependencies must be bundled or guaranteed externally on Linux, macOS, and Windows, and `tools/validate-bundle.py` enforces that contract
104104
</acceptance_criteria>
105105
</task>
106106

107107
<task type="auto">
108108
<name>Backfill Wave 0 tests for runtime naming, bundle discovery, and archive validation</name>
109109
<read_first>
110-
- .planning/phases/01-create-a-proper-readme-covering-project-background-core-usage-build-and-test-instructions-and-add-github-actions-ci-release-workflows-that-build-and-test-binaries-for-windows-linux-and-macos-on-x64-and-arm64/01-VALIDATION.md
110+
- .planning/phases/01-readme-ci-release-workflows/01-VALIDATION.md
111111
- crates/dsview-sys/tests
112112
- crates/dsview-core/tests
113113
- crates/dsview-core/src/lib.rs
114114
</read_first>
115-
<files>crates/dsview-sys/tests/runtime_packaging.rs, crates/dsview-core/tests/bundle_discovery.rs, tools/validate-bundle.rs</files>
116-
<action>Add the Wave 0 coverage called out in `01-VALIDATION.md`: create `crates/dsview-sys/tests/runtime_packaging.rs` for target-aware runtime filename and path-shape assertions, create `crates/dsview-core/tests/bundle_discovery.rs` for executable-relative runtime/resource layout and `--resource-dir` precedence expectations, and create `tools/validate-bundle.rs` as the shared artifact validation helper that unpacks an archive, asserts `dsview-cli[.exe]`, `runtime/`, and `resources/` exist in the expected versioned root, checks the platform runtime filename plus any declared bundled companion libraries, and verifies the required DSLogic Plus resource files are present. The validator must also run the concrete no-hardware smoke commands `dsview-cli --help`, `dsview-cli devices list --help`, and one repo-owned bundle-discovery validation command or test entrypoint that proves the unpacked executable resolves bundled `runtime/` and `resources/` without requiring attached hardware.</action>
115+
<files>crates/dsview-sys/tests/runtime_packaging.rs, crates/dsview-core/tests/bundle_discovery.rs, tools/validate-bundle.py</files>
116+
<action>Add the Wave 0 coverage called out in `01-VALIDATION.md`: create `crates/dsview-sys/tests/runtime_packaging.rs` for target-aware runtime filename and path-shape assertions, create `crates/dsview-core/tests/bundle_discovery.rs` for executable-relative runtime/resource layout and `--resource-dir` precedence expectations, and create `tools/validate-bundle.py` as the shared artifact validation helper that unpacks an archive, asserts `dsview-cli[.exe]`, `runtime/`, and `resources/` exist in the expected versioned root, checks the platform runtime filename plus any declared bundled companion libraries, and verifies the bundled `resources/` directory is present. The validator must also run the concrete no-hardware smoke commands `dsview-cli --help`, `dsview-cli devices list --help`, and one repo-owned bundle-discovery validation command or test entrypoint that proves the unpacked executable resolves bundled `runtime/` and `resources/` without requiring attached hardware.</action>
117117
<acceptance_criteria>
118118
- all three Wave 0 gaps named in `01-VALIDATION.md` for runtime naming, bundle discovery, and package validation have concrete implementation targets
119119
- `crates/dsview-sys/tests/runtime_packaging.rs` explicitly covers Linux, macOS, and Windows runtime filename expectations
120120
- `crates/dsview-core/tests/bundle_discovery.rs` explicitly covers default executable-relative paths and `--resource-dir` override precedence
121-
- `tools/validate-bundle.rs` is suitable for both local validation and later GitHub Actions reuse instead of duplicating layout checks in YAML
121+
- `tools/validate-bundle.py` is suitable for both local validation and later GitHub Actions reuse instead of duplicating layout checks in YAML
122122
- the validator performs the exact post-unpack smoke command set required by Phase 1 rather than only checking archive shape
123123
</acceptance_criteria>
124124
</task>
125125

126126
<verification>
127127
- Run `cargo test -p dsview-sys runtime_packaging`
128128
- Run `cargo test -p dsview-core --test bundle_discovery`
129-
- Build a local bundle with the package helper for the host target and validate it with `tools/validate-bundle.rs`
129+
- Build a local bundle with the package helper for the host target and validate it with `tools/validate-bundle.py`
130130
- Confirm the validated bundle root contains `dsview-cli[.exe]`, `runtime/`, and `resources/` with the target-correct runtime library name and DSLogic Plus payload only
131131
</verification>

0 commit comments

Comments
 (0)