Skip to content

RFC b4: add native Windows support

Adrian Neftali Sanchez tools 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest13 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13tests: specify UTF-8 encoding when opening files in text modesrc/tests/test___init__.py+1 -10 replies
2/13tests: use os.path.join/normpath for portable path assertionssrc/tests/test_review_tracking.py src/tests/test_three_way_merge.py+2 -20 replies
3/13b4: add cross-platform username resolution in _setup_user_configsrc/b4/__init__.py+8 -30 replies
4/13b4: resolve platform-native data and cache directoriessrc/b4/__init__.py+4 -00 replies
5/13b4: normalise git-reported absolute paths with os.path.normpathsrc/b4/__init__.py+5 -00 replies
6/13b4: select platform-appropriate default pagersrc/b4/__init__.py+1 -10 replies
7/13ez: use portable uid/gid accessors in write_to_tarsrc/b4/ez.py+2 -20 replies
8/13tui: The _suspend_to_shell function assumes a POSIX environment, relying on $SHELL and shell-specific arguments (e.g., --rcfile) that are invalid on Windows.src/b4/tui/_common.py+32 -260 replies
9/13tests: replace NamedTemporaryFile with tmp_path in patatt fixturesrc/tests/test_patatt.py+20 -110 replies
10/13pyproject: add Windows operating-system classifierpyproject.toml+1 -00 replies
11/13ci: add ci.ps1 for running the quality-gate pipeline on Windowsci.ps1+15 -00 replies
12/13review_tui: write git tracking commit before updating DBsrc/b4/review_tui/_tracking_app.py+15 -90 replies
13/13review_tui: guard against unmounted diff-viewer In certain asynchronous contexts or during rapid UI transitions, _show_content may be invoked before the diff-viewer widget has been fully mounted in the DOM. This is particularly reproducible in headless test environments and on platforms with slower console I/O initialization.src/b4/review_tui/_review_app.py+7 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 00/13] b4: add native Windows support

Hello everyone,

This series aims to provide native Windows support for b4.

While Linux remains the primary environment for kernel development, many contributors find themselves on Windows systems due to corporate policies, hardware constraints, or environments where WSL and virtual machines are restricted or unavailable. Enabling b4 to run natively allows these contributors to participate in patch review and mailing list workflows more efficiently.

The changes focus on platform-neutral path handling, encoding consistency, and process management. Key highlights:

- Portability: Replaced POSIX-specific assumptions (UID/GID, path separators, and shell execution) with cross-platform equivalents.
- Stability: Fixed race conditions in the TUI worker and added defensive guards for widget mounting, which became more apparent under Windows' asynchronous I/O model (IocpProactor).
- Testing: Added ci.ps1 to allow local validation of the full quality-gate pipeline on Windows.

The entire test suite (900+ tests) was validated on Windows 11. While some minor UI timing flakiness persists in the test environment due to console latency, the core functionality is stable and ready for use.

I am open to maintaining the Windows-specific execution paths and addressing any regressions that may arise on this platform.

Adrian Neftali Sanchez (13):
tests: specify UTF-8 encoding when opening files in text mode
tests: use os.path.join/normpath for portable path assertions
b4: add cross-platform username resolution in _setup_user_config
b4: resolve platform-native data and cache directories
b4: normalise git-reported absolute paths with os.path.normpath
b4: select platform-appropriate default pager
ez: use portable uid/gid accessors in write_to_tar
tui: The _suspend_to_shell function assumes a POSIX environment,
relying on $SHELL and shell-specific arguments (e.g., --rcfile) that are invalid on Windows.
tests: replace NamedTemporaryFile with tmp_path in patatt fixture
pyproject: add Windows operating-system classifier
ci: add ci.ps1 for running the quality-gate pipeline on Windows
review_tui: write git tracking commit before updating DB
review_tui: guard against unmounted diff-viewer In certain
asynchronous contexts or during rapid UI transitions, _show_content may be invoked before the diff-viewer widget has been fully mounted in the DOM. This is particularly reproducible in headless test environments and on platforms with slower console I/O initialization.

 ci.ps1                             | 15 ++++++++
 pyproject.toml                     |  1 +
 src/b4/__init__.py                 | 22 +++++++++---
 src/b4/ez.py                       |  4 +--
 src/b4/review_tui/_review_app.py   |  8 ++++-
 src/b4/review_tui/_tracking_app.py | 24 ++++++++-----
 src/b4/tui/_common.py              | 58 ++++++++++++++++--------------
 src/tests/test___init__.py         |  2 +-
 src/tests/test_patatt.py           | 31 ++++++++++------
 src/tests/test_review_tracking.py  |  2 +-
 src/tests/test_three_way_merge.py  |  2 +-
 11 files changed, 113 insertions(+), 56 deletions(-)
 create mode 100644 ci.ps1
Signature · 1 line
2.45.0.windows.1