Skip to content

Commit 48270f3

Browse files
committed
chore: development v0.1.4 - comprehensive testing complete [auto-commit]
1 parent 1edf464 commit 48270f3

File tree

20 files changed

+330
-124
lines changed

20 files changed

+330
-124
lines changed

.cargo/config.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,13 @@ rustflags = [
4545
# =============================================================================
4646
# Windows x86_64 MSVC
4747
# =============================================================================
48+
# NOTE: Do NOT use target-cpu=native here - it breaks cross-compilation from
49+
# macOS ARM64 (the host CPU "apple-m4" is not valid for x86_64 targets).
50+
# Use x86-64-v2 for good compatibility (SSE4.2, POPCNT - supported since ~2009).
4851
[target.x86_64-pc-windows-msvc]
4952
linker = "rust-lld"
5053
rustflags = [
51-
"-C", "target-cpu=native",
54+
"-C", "target-cpu=x86-64-v2",
5255
"-C", "link-arg=/OPT:REF",
5356
"-C", "link-arg=/OPT:ICF",
5457
]

Cargo.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ members = [
3232
# Workspace Package Metadata (inherited by all crates)
3333
# ─────────────────────────────────────────────────────────────────────────────
3434
[workspace.package]
35-
version = "0.1.1"
35+
version = "0.1.4"
3636
edition = "2024"
3737
rust-version = "1.85"
3838
license = "MPL-2.0 OR LicenseRef-UFFS-Commercial"
@@ -66,11 +66,14 @@ futures = "0.3.31"
6666

6767
# ───── Windows APIs (Windows only) ─────
6868
windows = { version = "0.62.2", features = [
69-
"Win32_Storage_FileSystem",
70-
"Win32_System_Ioctl",
71-
"Win32_Storage",
7269
"Win32_Foundation",
70+
"Win32_Security",
71+
"Win32_Storage",
72+
"Win32_Storage_FileSystem",
7373
"Win32_System_Com",
74+
"Win32_System_IO",
75+
"Win32_System_Ioctl",
76+
"Win32_System_Threading",
7477
"Win32_System_Wmi",
7578
] }
7679
windows-core = "0.62.2"
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
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+

crates/uffs-mft/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ name = "mft_read"
6666
harness = false
6767

6868
# ─────────────────────────────────────────────────────────────────────────────
69-
# Lints (inherit from workspace, with unsafe allowed for Windows FFI)
69+
# Lints (inherit from workspace, unsafe allowed case-by-case via #[allow])
7070
# ─────────────────────────────────────────────────────────────────────────────
7171
[lints]
7272
workspace = true

crates/uffs-mft/src/error.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,8 @@ pub enum MftError {
8484
/// Feature not available on this platform.
8585
#[error("MFT reading is only available on Windows")]
8686
PlatformNotSupported,
87+
88+
/// Invalid input provided.
89+
#[error("Invalid input: {0}")]
90+
InvalidInput(String),
8791
}

0 commit comments

Comments
 (0)