Skip to content

WIP: winx-reclaim — GCC wall class completion + cpio operand boundary (#1412, #1422) - #1423

Merged
caomengxuan666 merged 3 commits into
mainfrom
fix/winx-reclaim-1422
Oct 27, 2026
Merged

caomengxuan666 merged 3 commits into
mainfrom
fix/winx-reclaim-1422

Conversation

@caomengxuan666

@caomengxuan666 caomengxuan666 commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

WIP: winx-reclaim — GCC module wall class completion + cpio operand boundary

Cluster: issue-clearance winx-reclaim (WinuxCmd handed back to this side 2026-10-27). Full evidence: cluster REPORT.md.

GCC module wall series (#1401/#1406/#1407/#1412)

The per-file fixes for the four filed walls landed on main via PR #1391, but the full GCC build was never re-run to completion afterwards (build15 died on a missing Wine interpreter, zero files compiled). Re-running the full GCC 16.2 build on current main (ea8e40c) shows the four were one class — module units not self-sufficient under GCC — with instances still latent in 11 files, several unreachable in every build until now because each build died at an earlier wall:

Verification: a keep-going (ninja -k 0) GCC build of the whole tree now compiles every translation unit except one (see below), including all four originally filed files.

Fixes #1401
Fixes #1406
Fixes #1407
Fixes #1412

The next wall (reported, not fixed here)

src/utils/file_io.cppm still fails under GCC — its only remaining errors are three sites (fifo read/write streams, /dev/stdin stream) constructing std::ifstream/std::ofstream from a FILE*, an MSVC stdlib extension that libstdc++ does not declare under import std. Reformulating that FILE*→stream bridge is a behavior-bearing product change, out of this cluster's header/export-class scope; it is characterized in the cluster REPORT for a follow-up. Until it falls, GCC builds of commands importing utils (and local Wine probes) stay blocked; MSVC CI is green on this branch.

cpio operand boundary (#1422)

cpio had no -F/--file at all and member names went to raw CreateFileW. This PR adds -F/--file (archive path through the shared operand boundary; missing archive is rc 1 with a diagnostic) and routes every member-name open through the boundary (extended form; normalized form for trailing separators), with the member-name policy written in the code comment and unit pins: -F create/list round trip, -F missing archive, trailing-dot member round trip, NUL.txt member round trip.

Fixes #1422

Not in this PR

Refs #1127
Refs #1396

@caomengxuan666
caomengxuan666 force-pushed the fix/winx-reclaim-1422 branch 4 times, most recently from ab586ab to 4cd94a5 Compare October 27, 2026 14:41
#1406/#1407/#1412)

The four filed walls were fixed per-file via PR #1391 (version.cppm
inner export, regex/string size_t, utf8 PCH/std conflict), but the full
GCC build was never re-run to completion afterwards (build15 died on a
missing Wine interpreter with zero files compiled). Re-running it on
current main shows the defects were one class, not four files: module
units that are not self-sufficient under GCC — a C++ header must be
seen before the windows.h chain so c++config.h's std declarations land
with C++ linkage (#1412 mechanism); bare size_t/uint64_t/_fileno/
_fdopen must come from their own headers instead of MSVC header-chain
leaks (#1406/#1407 mechanism); and exports must be well-formed —
no 'export' inside an export block/namespace, and 'export using' may
only name entities exported at their declarations (#1401 mechanism).

A keep-going (-k 0) GCC 16.2 build of the whole tree enumerates every
remaining instance; this commit fixes the class in one pass:
- #1412 guard (pre-include <cstddef> + #undef NOMINMAX) for every
  pch-first fragment lacking it: native_path (the wall the baseline
  build actually stops at), cmd_meta, console, file_io, i18n, pager,
  wildcard, win32 (its second include is aclapi.h, another windows
  header — no C++ header precedes pch.h there either), childproc
  (its <filesystem> sits after pch.h, too late to serve as the guard).
- i18n: add <cstdint> (bare uint64_t in legacy_key; pristine-file probe
  shows both errors, the guard alone leaves this one).
- console: add <stdio.h> (_fileno). file_io: add <stdio.h> (_fdopen).
- text_io: it has no global fragment at all and uses bare size_t;
  add the fragment with <cstddef>.
- file_io: remove the six inner 'export' keywords inside
  'export namespace file_io' (the version.cppm shape, with a NOTE).
- cppbar: export the terminal namespace and the color/style entities
  (RGB, apply_color, reset_color, StyleConfig, Style) at their
  declarations so the trailing export-using block names only entities
  with external linkage, exactly as Color/ProgressBar already did.
  This TU was unreachable in every earlier build (it imports :console).

Refs #1401
Refs #1406
Refs #1407
Refs #1412
…y, add -F (#1422)

cpio's archive I/O bypassed the shared operand boundary entirely: it
had no -F/--file option (archives were stdin/stdout only) and member
names went to raw CreateFileW, reopening the #1332/#1333 defect class
for archive content (a member named 'name.' or 'NUL.txt' named the
wrong file or the NUL device).

- Add -F/--file: the archive path is an argv operand resolved through
  the boundary (read_file/write_file); -i/-t read the archive from the
  file instead of stdin; -o writes it there instead of stdout. A
  missing archive file is rc 1 with a diagnostic.
- Route every member-name open (create read, extract write, extract
  -d parent chain via create_directories_w, -m reopen, list probe)
  through operand_path_w: make_api_path_operand's extended form, or
  the normalized form when a trailing separator was present (#1052).
- Written member-name policy (code comment + tests): shell-dialect
  rooted spellings fold through the boundary exactly like argv
  operands (bare '/' = payload root, #1364 ruling); Windows-native
  absolute and relative names are taken literally, as GNU cpio takes
  member names literally.

Unit pins (tests/unit/cpio): -F create/list round trip, -F missing
archive, trailing-dot member round trip, NUL.txt member round trip.

Fixes #1422
caomengxuan666 added a commit that referenced this pull request Oct 27, 2026
….1.21 release checklist

- packaging/ffi/README.md: DESIGN 4.1 layout on the packaging side
  (usr/bin/ffi/v1.1.21/winuxcore.dll + tiers.tsv, current.txt pointer,
  SHA256SUMS.txt incl. the DLL line, keep-last-2 GC, rollback),
  wpm-index ffi field wiring described (P2, not applied)
- packaging/ffi/FFI-EXPERIMENTAL-NOTICE.md: in-package D8 notice -
  default off, NIU_WINUXCMD_FFI=1 to enable, SmartScreen/Defender
  notes, signed DLL as the hard gate for non-experimental FFI
- packaging/ffi-interim-release-checklist.md: 12 pre-release gates,
  all honestly marked unmet where unmet (incl. the real CI snapshot
  for PRs #1414/#1415/#1423), plus the CMake install-rule patch
  proposal for the coordinator - CMakeLists/CMakePresets/src are
  outside this prep's file surface and are NOT touched
- prep only: no tag, no release
…empDir

The cpio trailing-dot pin (#1422) failed on real Windows at the
fixture layer, not in the product: temp_dir_detail::extended_path
absolutized every fixture path through GetFullPathNameW, which
strips trailing '.'/' ' components onto the DOS sibling (#1283),
so TempDir::write("name.") actually created the file "name" and
read("name.") read the sibling back. The literal "name." file
never existed on disk, cpio -o correctly reported it unreadable,
and the extract read-back could never see the literal name.

extended_path now detects literal dot/space components (the same
predicate the product's native_path uses) and absolutizes them
lexically under the \\?\ namespace, mirroring
to_extended_path_preserving; every other spelling keeps the
GetFullPathNameW result unchanged. Directory creation in
write/write_bytes/mkdir goes through the same boundary so a
trailing-dot/space directory segment is created literally too.

Refs #1422
@caomengxuan666
caomengxuan666 marked this pull request as ready for review October 27, 2026 18:32
@caomengxuan666
caomengxuan666 merged commit 797254c into main Oct 27, 2026
7 of 8 checks passed
@caomengxuan666
caomengxuan666 deleted the fix/winx-reclaim-1422 branch October 30, 2026 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment