|
| 1 | +# Changelog Healing - 2026-01-17 |
| 2 | + |
| 3 | +## Issue 1: CI pipeline succeeds despite cross-compilation failure |
| 4 | + |
| 5 | +### What Failed |
| 6 | +The CI pipeline (`rust-script scripts/ci-pipeline.rs go -v`) completed with exit code 0 even though the Windows cross-compilation failed with: |
| 7 | +``` |
| 8 | +rustc-LLVM ERROR: 64-bit code requested on a subtarget that doesn't support it! |
| 9 | +'apple-m4' is not a recognized processor for this target (ignoring processor) |
| 10 | +``` |
| 11 | + |
| 12 | +### Root Cause |
| 13 | +Two issues: |
| 14 | + |
| 15 | +1. **`.cargo/config.toml`**: The Windows target had `target-cpu=native` which refers to the host CPU (Apple M4 on macOS ARM64), not the target CPU (x86_64). This is invalid for cross-compilation. |
| 16 | + |
| 17 | +2. **`scripts/build-cross-all.rs`**: When `build_for_target()` returned `false` (build failed), the script continued to the next target and eventually exited with code 0, not propagating the failure. |
| 18 | + |
| 19 | +### Fix Applied |
| 20 | + |
| 21 | +**File: `.cargo/config.toml`** |
| 22 | +- Changed `target-cpu=native` to `target-cpu=x86-64-v2` for the Windows target |
| 23 | +- Added comment explaining why `native` breaks cross-compilation |
| 24 | +- `x86-64-v2` provides good compatibility (SSE4.2, POPCNT - supported since ~2009) |
| 25 | + |
| 26 | +**File: `scripts/build-cross-all.rs`** |
| 27 | +- Changed to fail-fast: immediately `exit(1)` when any build fails |
| 28 | +- Removed the pattern of collecting failures and checking at the end |
| 29 | + |
| 30 | +--- |
| 31 | + |
| 32 | +## Issue 2: Benchmark binary killed during test enumeration (SIGKILL) |
| 33 | + |
| 34 | +### What Failed |
| 35 | +After fixing Issue 1, the CI failed with: |
| 36 | +``` |
| 37 | +error: creating test list failed |
| 38 | +for `uffs-core::bench/search_benchmarks`, command ... aborted with signal 9 (SIGKILL) |
| 39 | +``` |
| 40 | + |
| 41 | +### Root Cause |
| 42 | +The coverage test command used `--all-targets` which includes benchmarks. The benchmark binary (`search_benchmarks`) creates large DataFrames (up to 100,000 rows) during initialization. When `cargo nextest` runs `--list` to enumerate tests, it loads the benchmark binary which triggers this initialization, causing memory pressure or timeout leading to SIGKILL. |
| 43 | + |
| 44 | +### Fix Applied |
| 45 | + |
| 46 | +**File: `scripts/ci-pipeline.rs`** |
| 47 | +- Changed `--all-targets` to `--lib --bins --tests` in three places: |
| 48 | + 1. Line ~484: `phase1_testing()` function |
| 49 | + 2. Line ~690: `coverage_report()` function |
| 50 | + 3. Line ~807: `phase1_optimized()` function |
| 51 | +- Added comments explaining why benchmarks are excluded |
| 52 | + |
| 53 | +--- |
| 54 | + |
| 55 | +## Issue 3: Unused crate dependency warnings in uffs-mft |
| 56 | + |
| 57 | +### What Failed |
| 58 | +Compilation warnings about unused crate dependencies: |
| 59 | +- Library (`lib.rs`): `anyhow`, `clap`, `indicatif`, `tokio`, `tracing`, `tracing_subscriber` |
| 60 | +- Binary (`main.rs`): `bitflags`, `criterion`, `rayon`, `thiserror`, `uffs_mft`, `uffs_polars`, `zstd`, `indicatif`, `tracing` |
| 61 | + |
| 62 | +### Root Cause |
| 63 | +Cargo doesn't support per-binary dependencies. The `uffs-mft` crate has both a library and a binary: |
| 64 | +- The library uses some dependencies (e.g., `bitflags`, `thiserror`) |
| 65 | +- The binary uses other dependencies (e.g., `clap`, `indicatif`) |
| 66 | +- Some dependencies are platform-gated with `#[cfg(windows)]` |
| 67 | + |
| 68 | +On non-Windows platforms, the platform-gated code is not compiled, making those dependencies appear unused. |
| 69 | + |
| 70 | +### Fix Applied |
| 71 | + |
| 72 | +**File: `crates/uffs-mft/src/lib.rs`** |
| 73 | +- Added `use X as _;` statements for binary-only dependencies |
| 74 | +- Added `#[cfg(not(windows))]` gated suppressions for Windows-only dependencies |
| 75 | + |
| 76 | +**File: `crates/uffs-mft/src/main.rs`** |
| 77 | +- Added `use X as _;` statements for library-only dependencies |
| 78 | +- Added `#[cfg(not(windows))]` gated suppressions for Windows-only dependencies |
| 79 | + |
| 80 | +### Verification |
| 81 | +Run: `cargo check --package uffs-mft` |
| 82 | +- Should complete with no warnings |
| 83 | + |
0 commit comments