Repository navigation
Conversation
Six utilities that need POSIX APIs Windows does not expose. All six are nix-only for the same reason and to the same degree: chroot and chown/chgrp need chroot(2) and the user/group databases; chcon and runcon need SELinux; pinky needs utmp. They stay in build.vsh's Windows ignore list, so no Windows build is attempted. Shared support lives in common/: ids_nix.c.v holds the group and user lookup both ownership tools use, so chgrp and chown share one implementation rather than two; selinux holds the context parser the context tools share; and die()/fail_with_help() exist because GNU's exit statuses differ by failure kind, which the previous common.exit_with_error_message could not express. The exit codes were measured rather than assumed: chown exits 1 for a bad operand while chroot and runcon exit 125 for anything they could not do, and an unknown group or user is a one-line diagnostic with no 'Try --help'. Verification was by cross-compiling each tool for Linux and running it under WSL, since V can emit Linux C from Windows but cannot link it. Not all six match: chown, chgrp, chroot, chcon, runcon and mknod's diagnostics do, byte for byte including the curly quotes GNU puts around operands. pinky's default table matches, but its -i, -w and -q variants use column layouts I did not decode, and the suite for these is named _nix_test.v so Windows never compiles it and the ubuntu CI jobs are the first real execution.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Six utilities that need POSIX APIs Windows does not expose. All six are nix-only to the same degree:
chrootandchown/chgrpneedchroot(2)and the user/group databases;chconandrunconneed SELinux;pinkyneeds utmp. They stay inbuild.vsh's Windows ignore list, so no Windows build is attempted.Shared support lives in
common/:ids_nix.c.vholds the group and user lookup both ownership tools use, sochgrpandchownshare one implementation rather than two;selinuxholds the context parser the context tools share; anddie()/fail_with_help()exist because GNU's exit statuses differ by failure kind, which the previouscommon.exit_with_error_messagecould not express.The exit codes were measured rather than assumed:
chownexits 1 for a bad operand whilechrootandrunconexit 125 for anything they could not do. That distinction is real and the old helper flattened it.Verification was by cross-compiling each tool for Linux and running it under WSL, since V can emit Linux C from Windows but cannot link it.
Not all six match, and I want to be specific.
chown,chgrp,chroot,chcon,runconandmknod's diagnostics match byte-for-byte, including the curly quotes GNU puts around operands.pinky's default table matches, but its-i,-wand-qvariants use column layouts I did not decode — the flag-to-column mapping behaves counter-intuitively (-iomits the Name column, not the idle time) and I ran out of budget before nailing it. That's an honest gap, not a claim of parity.The
_nix_test.vsuites are named so Windows never compiles them, which means theubuntu-*CI jobs are the first real execution of this code. That's a genuine risk and it's stated in the commit message.