Skip to content

[bug] cp -n: skips without GNU's "not replacing" diagnostic and returns 0 #1879

Done

Description

@caomengxuan666

[bug] cp -n: skips without GNU's "not replacing" diagnostic and returns 0

Found by re-running the 2026-11-25 nightly WinuxCmd probes against a pristine GNU coreutils 9.4 oracle (tarball build). The old comparison had used the Ubuntu noble .deb, whose cp -n is patched to the same behavior as winuxcmd, masking this.

Shapes (pristine GNU 9.4 vs winuxcmd 1.2.1):

printf 'ORIGINAL\n' > keep.txt
printf 'alpha\nbeta\ngamma\n' > a.txt
cp -n a.txt keep.txt; echo rc=$?
cat keep.txt
  • GNU: prints cp: not replacing 'keep.txt', rc=1; target keeps ORIGINAL.
  • winuxcmd: prints cp: warning: behavior of -n is non-portable…, rc=0; target also keeps ORIGINAL.

Fresh target: GNU copies silently (stderr 0 bytes); winuxcmd copies but still prints the same 96-byte warning.

Source check: pristine 9.4 src/copy.c skip branch prints not replacing and returns failure; the string non-portable does not occur anywhere in the pristine 9.4 tree. winuxcmd matches the Ubuntu .deb's patched behavior, not pristine GNU.

Expected: match pristine GNU 9.4 — skip prints cp: not replacing '<dst>' and returns 1; a successful copy under -n prints nothing.

Activity

  1. added
    bug
    on Nov 25, 2026
  2. added a commit that references this issue on Nov 29, 2026
  3. caomengxuan666 commented on Nov 29, 2026

    @caomengxuan666
    MemberAuthor

    队长核验:由 PR #1978 合入修复并关闭(head 088737f,run 46301815810 attempt 2)。

    CI 裁决要点:

    • i18n-drift:SUCCESS。首轮 attempt 1 的 FAILURE 是过期证据——该轮跑在 winuxcmd-i18n Release v0.7.2: Add Scoop manifest and improve installation #44 合入(2026-11-29 20:37:50Z)之前,catalog 仍含已删键 command.cp.warning.no_clobber_deprecated;重跑后 drift 已消。
    • rust2-gate:SUCCESS。attempt 1 的失败只因 engines-fs 分片被 CANCELLED(其日志 blob 已失效),aggregate 日志 FAIL rows (0): none;attempt 2 该分片 SUCCESS,新日志中无任何 FAIL 行,cp32/cp34/cp39 不再出现。
    • 其余 check 全部 SUCCESS(仅 release / update-wpm-source-index / cache-and-notify / sync-i18n-catalog 为 SKIPPED)。

    语义核验(与 pristine GNU coreutils 9.4 oracle 对照):

    • -n = I_ALWAYS_NO:遇已存在目标时跳过复制、rc 1,并输出 not replacing 报错。
    • -n 与 -b / -S 互斥,同时给出为 usage error。
    • gate 三行 cp32/cp34/cp39 曾被误判为 .deb 校准问题,已裁决:实为旧 head 下的真分歧面,现随本修复落定。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions