Commit Graph

11 Commits

Author SHA1 Message Date
can1357 3d9f28dd46 refactor: resolved cross-platform build warnings and add windows-sys features
- Add conditional attributes to silence dead-code warnings on platform-specific code and fields.
- Update target dependencies in pi-walker/Cargo.toml with explicit windows-sys feature sets.
- Simplify time cast expressions in linux_reflink and rcopy modules.
2026-07-27 17:04:52 +02:00
can1357 a569385b8e fix(shell): captured find -exec child stdio into scope streams
- find -exec/-execdir children inherited the omp process's real
  stdout/stderr, spamming output into the TUI terminal and bypassing
  shell redirects; they also inherited the host env instead of the
  shell's exported environment.
- Added pi_uutils_ctx::run_captured (moved from uu-xargs' private
  helper): stdin null, stdout streamed into scope stdout, stderr
  drained on a helper thread and forwarded after exit.
- uu-find exec matchers now use env_clear + env_snapshot and
  run_captured; MultiExecMatcher rebuilds a std Command from the
  argmax command's accumulated state (argmax only Derefs immutably).
- uu-xargs reuses the shared helper; added pi-shell regression test
  asserting -exec child stdout flows through the shell redirect with
  the exported env.
2026-07-24 20:06:29 +02:00
can1357 5a73d65b7a feat(shell): integrated additional coreutils into shell builtins
- Added base64, checksum utilities (md5, sha1, sha224, sha256, sha384, sha512, b2sum), path utilities (basename, dirname), and text processing tools (cut, tee, tr, paste, comm) to the shell.
- Registered new utility builtins in crates/pi-shell/src/coreutils.rs and crates/pi-shell/src/shell.rs.
- Updated Cargo.toml to include the necessary dependencies for the new core utilities.
2026-07-11 19:07:01 +02:00
can1357 d1015a6b87 Merge PR #3774: fix(natives): cap rayon pool on Windows (@roboomp) 2026-07-01 21:42:25 +02:00
roboomp dbab0ef84d fix(uutils): wired grep/rg directory walks to observe scope cancellation
The grep and rg in-process builtins passed no-op heartbeats to pi_walker
when recursing into a directory, so the uutils scope's cancel flag was
ignored mid-walk. The shell wrapper sets that flag on abort/timeout and
then awaits the blocking task — with no heartbeat hookup, a cancelled
recursive grep/rg waited for the whole tree to be scanned before the
shell could return exit 130.

Add pi_uutils_ctx::is_cancelled() and have grep's search_dir, rg's
search_dir, and rg's collect_filtered_files supply heartbeats that
return io::ErrorKind::Interrupted when the flag is set. The walker maps
that to WalkError::Interrupted, which the utilities now silently treat
as a harness cancellation (no spurious 'native directory scan
interrupted' on the command's stderr — the shell wrapper owns the
user-visible exit code).

Regression tests pre-set the cancel flag and assert grep -r /
rg / rg --files exit without scanning the matching file in the tree.

Fixes #3933
2026-06-30 23:37:20 +00:00
roboomp d55b948ad0 fix(natives): avoided current-thread rayon fallback
- Used the probed worker count instead of registering the loader thread as Rayon's only worker.
- Kept patched Rayon callsites sequential when no worker thread can be spawned.
- Guarded count_tokens and vendored sort from lazily touching the global pool in the zero-worker case.

Fixes #3770
2026-06-29 02:48:32 +00:00
can1357 4c3c2fc3e3 chore: update chanelogs 2026-06-28 20:43:32 +02:00
can1357 82a5ba5d47 fix(cross-cutting): caught and recover from utility panics
- Switch build profile to `panic = "unwind"` to allow catching panics in vendored uutils code.
- Add `run_caught` to wrap utility execution in `catch_unwind`, converting panics into non-zero exit codes.
- Update `pi-natives` to distinguish between recoverable utility panics and fatal process crashes, preventing recovered panics from appearing in user-facing crash reports.
2026-06-28 20:42:04 +02:00
can1357 e22f6517f8 refactor: migrated format_usage to pi-uutils-ctx
- Implement an argv-independent `format_usage` within `pi-uutils-ctx`.
- Update all vendor crates to import the function from the new location.

Fixes #3727
2026-06-28 17:05:52 +02:00
can1357 39a055a1e5 feat: implemented ripgrep-based rg shell builtin
- Implemented `rg` shell builtin using ripgrep libraries to enable file and directory searching.
- Added `RgSink` to handle output formatting, context, and vimgrep compatibility.
- Updated shell context and IO flags to support stdin as search input.
- Added integration tests for directory recursion, ignore filtering, and stdin handling.
2026-06-26 16:33:05 +02:00
can1357 b5dac65b31 feat: implemented coreutils shell builtins via in-process execution
- Introduced `pi-uutils-ctx` to manage thread-local I/O redirection, environment context, and path resolution for in-process utilities.
- Integrated a suite of vendored coreutils (cat, find, grep, head, ls, mkdir, mv, rm, sort, tail, uniq, wc) as shell builtins.
- Added infrastructure for command cancellation, streaming I/O, and locale-aware error reporting within the shell environment.
- Configured shell-side dispatch logic to route commands through the new utility context, enhancing performance and binary integration.
2026-06-26 12:00:34 +02:00