#1061612 coreutils: cp -n deprecation warning gives questionable advice

Package:
coreutils
Source:
coreutils
Description:
GNU core utilities
Submitter:
Sven Joachim
Date:
2024-01-28 16:54:02 UTC
Severity:
normal
#1061612#5
Date:
2024-01-27 13:00:14 UTC
From:
To:
,----
| $ cp -n /bin/true tmp
| cp: warning: behavior of -n is non-portable and may change in future; use --update=none instead
`----

The advice to use the --update=none option is highly questionable,
because this option is even less portable than -n.  It is not available
in coreutils older than 9.3 or in other cp implementations.

The result is that package maintainers follow the deprecation advice
likely without also introducing a versioned dependency on coreutils,
causing problems for backports and partial upgrades.  There is also one
Debian port (hurd-i386) which does not even have a recent enough
coreutils version.

See 1061610 in debhelper, which I have just opened.

#1061612#10
Date:
2024-01-27 16:02:15 UTC
From:
To:
There is no alternative that I can see. I didn't create this situation,
it was created upstream. You can continue to use -n and ignore the
warning, but in future if debian stops patching -n to behave the way it
always has in order to match upstream, stuff will break. If debian keeps
patching -n, then then anything you write in debian will be depending on
behavior that differs in other distributions and will break everywhere
else (except older versions of those distributions). It's a mess.

This warning isn't for debian developers of existing packages, because
debian is maintaining compatibility (at least for now); you'll see a
warning message but the actual behavior hasn't changed and won't change
in debian without some coordination with affected packages. But for
developers with *new* upstream code that uses -n, which behavior does
the code expect? There are now two answers and *the only solution is to
not use -n*; it's not possible to simply file bugs with packages and fix
it once, because this is an ongoing incompatibility. I understand that
the messages are somewhat obnoxious, but my attempt to address the
situation upstream instead failed.

#1061612#15
Date:
2024-01-28 12:26:13 UTC
From:
To:
That is a very aggressive deprecation.
IMHO it would have been better for debian to have -n behave
like it did previously and (silently) skip files and not set an error exit status.
If it was a mess, this is a mess squared.
I guess this forces our hand a bit.
I'll address upstream...

#1061612#20
Date:
2024-01-28 16:50:17 UTC
From:
To:
So we should silently have debian behave differently from every other
linux distribution moving forward? How on earth does that serve anyone's
interest?