cherry-pick: upstream AppContainer support (libuv#5181)

Merged
RO
4mo ago
+741-16

Cherry-picks upstream libuv#5181 (2cadaa40, "win: fix unique named pipes to work inside Windows AppContainer" by Russ Cox) onto the bun branch.

Upstream change: conditionally inserts LOCAL\ into uv__unique_pipe_name when the process token is an AppContainer token, adds the test/appcontainer.c launcher and a CI step that runs the full test suite inside a container, and adds RETURN_SKIP_IN_APPCONTAINER skips for tests that cannot work there (symlinks, junctions, ACL edits).

The cherry-pick had two small textual conflicts because bun is 138 commits behind 2cadaa40's parent:

  • test/task.h: upstream moved the UNUSED macro earlier in the file and dropped the Windows notify_parent_process stub. Resolved by dropping the now-duplicate UNUSED block and keeping the Windows stub (the real Windows implementation in runner-win.c is not part of this commit).
  • test/test-fs.c: upstream's hunk uses TEST_FS_IMPL, a macro from an intermediate commit not present on this base. Resolved with TEST_IMPL + the RETURN_SKIP_IN_APPCONTAINER line.

Verified on Windows Server 2019 x64: all targets build (including the new uv_run_appcontainer.exe) and ctest -C RelWithDebInfo passes 2/2 (uv_test + uv_test_a, 100%). Running uv_run_appcontainer.exe on that box exits 0xC0000142 because the non-interactive session lacks a window-station grant; upstream's own GitHub Actions CI exercises it on an interactive runner.

Relationship to #5: this covers only the pipe-namespace fix and the AppContainer test harness. The tty console read cancellation, uv_pipe_bind EACCES/EADDRINUSE disambiguation, fs error fidelity, and uv_os_is_app_container() public API are in #5 and not here.